InfoPath Web Service Main Data Source Change
I recently started working with InfoPath. And, as I did in the beginning, I am still sticking to my first impression about it - it was designed to bring ASP .NET developers down :))
One of the first issues I stumbled upon was the Main Data Source update. I couldn't find this anywhere, and also couldn't make it work. And I desperately needed it, as my form had nothing more and nothing less than 1000 fields :|
Scenario: you have an InfoPath form that submits data to a Web Service. The input parameter of the submit method is an object. If this object has one too many fields and, at a point, changes, or if you move to production server and you need to update the web service URL, then you have yourself a Main Data Source Change scenario.
Wrong Solution: you first try to update the web service url from the Tools -> Data Connections menu option. Here, you can modify the service URL and you do just that. You are then asked to map the web service submit to the datasource on the form. Unfortunately it doesn't work. No matter the options selected here. The object, once in the web service, does not read any of the properties you modified in the InfoPath form.
If you have changed the web service and now must submit other properties of the object, you notice that the method above does not modify the main data source. It has the old fields still. You can try the Tools -> Convert Main Data Source menu option, but no matter what the input XML file is, the web service still parses an empty object.
Right Solution: I tried all of the above. I struggled for a while and that is why I did not detail the above very much. What you need to know is the solution.
To modify the Web Service Main Submit you must do it the old fashioned way.
Save the form as Source Files. In the directory that you save these files you will find an xsf file, usually called manifest.xsf. In this file InfoPath keeps the web service URL. if you have to update it, do it here.
Also in this folder you will find one or more xsd files. The larger one is the main data source correspondent. In this file you can modify the fields of the main data source. Be careful with the tags. You have to do the same thing in the template.xml file. If you only modify the fields in the xsd file, the field will be shown in Data Source View, but when you try to bind it to a control on the form, InfoPath will return an error saying that the field is not available.
And that is it. After that, open the manifest.xsf in design mode as Save As xsn file.
The web service submit should now work perfectly.
Posted by
Madalina
at
20:18:11
|
Permanent Link
|
|
Recent Comments
Starting form the sample I mentioned
Thanks for posting this. It sav
The left image does not overlap t
Was Looking for the "inline" and "at