Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2007

Tip: Looking for answers? Try searching our database.

Open a form saved via a web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel - 03 Apr 2007 02:34 GMT
Hi all,

I have created a web service that saves an InfoPath form to a SharePoint
forms server.  Everything works fine except for when a form has a date field
on it, the web service saves it successfully to the forms server however the
saved form won’t open, receiving a “Schema validation found non-datatype
errors:” error.

The web service just takes the form xml and using SharePoints object model
saves it into the form library.  I call this web service from InfoPath when
the form is submitted.

After more testing I found that if I change the date fields in the form
template to strings, and publish the form I can open the previously saved
forms that were receiving the error, but any new forms created off this
template do not open.

Does anyone have any suggestions to help me troubleshoot this issue?
S.Y.M. Wong-A-Ton - 03 Apr 2007 09:18 GMT
From within SharePoint, right-click on one of your forms, and save it
locally. Then browse to the form, right-click on it, and open it with
Notepad. Locate your date field and check what the format of the date is that
has been saved. Perhaps SharePoint or your web service has modified the date
to an unrecognizable format for InfoPath.
---
S.Y.M. Wong-A-Ton

> Hi all,
>
[quoted text clipped - 14 lines]
>
> Does anyone have any suggestions to help me troubleshoot this issue?
Daniel - 03 Apr 2007 23:30 GMT
Thanks for your reply.

I have already checked through the XML saved in the form and there is
nothing that looks wrong.  

If I save the infopath form back to SharePoint using InfoPath's save button
and then use my webservice to save the same infopath form to the form libary
the only difference between the two xml documents are,
the one saved with infopath has <?xml version="1.0" encoding="utf-8"?>
and the one saved with my webservice has <?xml version="1.0"?>

What doesnt make sense to me is if I publish a new template the old froms
work but any newly saved forms do not.

Cheers

Dan.

> From within SharePoint, right-click on one of your forms, and save it
> locally. Then browse to the form, right-click on it, and open it with
[quoted text clipped - 22 lines]
> >
> > Does anyone have any suggestions to help me troubleshoot this issue?
S.Y.M. Wong-A-Ton - 04 Apr 2007 08:06 GMT
Then the only other thing I can think of is that the code you're using to
save the forms is corrupting something in the forms. What code are you using
in the web service to save the forms?
---
S.Y.M. Wong-A-Ton

> Thanks for your reply.
>
[quoted text clipped - 40 lines]
> > >
> > > Does anyone have any suggestions to help me troubleshoot this issue?
S.Y.M. Wong-A-Ton - 04 Apr 2007 08:10 GMT
You may also want to check this blog post:
http://blogs.officezealot.com/bsandeman/archive/2006/09/29/13787.aspx
---
S.Y.M. Wong-A-Ton

> Thanks for your reply.
>
[quoted text clipped - 40 lines]
> > >
> > > Does anyone have any suggestions to help me troubleshoot this issue?
Daniel - 05 Apr 2007 07:28 GMT
Thanks for your help.  Sorry I have been slow to reply, i have been away for
the past day.

The WebService just takes the Forms XML and adds it to the libary.

          SPSite site = new SPSite(vSite);
           SPWeb web = site.OpenWeb(vWeb);
           web.AllowUnsafeUpdates = true;

           SPList list = web.GetList(vListURL);

           XmlDocument xmlDocument = new XmlDocument();
           xmlDocument.LoadXml(xmlConents);

           MemoryStream memoryStream = new MemoryStream();
           xmlDocument.Save(memoryStream);

           SPFolder fldr = web.GetFolder(vListName);
           SPFileCollection files = fldr.Files;
           
           SPFile spAdded =  files.Add(vFileName, memoryStream, true);
           files = fldr.Files;

           SPItem ListItem = list.Items[spAdded.UniqueId];

           ListItem["Submitted"] = "Yes";
           ListItem["Template Link"] = vTemplateURL;

           ListItem.Update();

I will try the suggestion in the link you provided.  Hopefully thats all the
issue is.

Thanks again for your help.

> You may also want to check this blog post:
> http://blogs.officezealot.com/bsandeman/archive/2006/09/29/13787.aspx
[quoted text clipped - 45 lines]
> > > >
> > > > Does anyone have any suggestions to help me troubleshoot this issue?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.