Submitting to WebService : the values are lost in transit! - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Submitting to WebService : the values are lost in transit!

Last post 04-06-2010 02:07 PM by Dan Peerenboom. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-22-2009 06:40 AM

    Submitting to WebService : the values are lost in transit!


    I'm having difficulties submitting an InfoPath 2007 form to a C# 2.0 WebService. The WS submit on the InfoPath side seems to go fine (I used Fiddler to capture the soap stream, and it seems correct, and no error is reported in InfoPath)

    Here is what I have done :

    - I created an InfoPath form from a blank template using the fields I need.

    - I saved the form as source files

    - in the source folder, "xsd.exe myschema.xsd /classes /l:cs /n:WebServices" from the .Net 2.0 SDK command line (and WebSevices is the namespace of my WebService)

    - I add the newly created "myschema.cs" file to my Visual Studio 2008 project (that has .NET 2.0 target compilation)

    - I add a new WebMethod to a WebService, as this :

            public void submitForm(myFields form)
                   // do stuff, but mainly I have a breakpoint at the start so I can debug the WS before I do anything crazy

    - I compile the WS and run it in debug mode in the built-in VS test IIS server (no problem so far)

    - In the InfoPath form, I add a new submit to webservice data connexion to the test server (using myFields as root, and submitting as XML tree and everything)

    - I run the form and fill it, submit (no error), then it brings me back to Visual Studio (it stops on my breakpoint in the WebMethod)

    then I inspect the "form" element (the one the WebService gets from InfoPath). It is not null, but every attribute has either a null value (even sections), or false (for bools)...


    Am I missing something ?

    (The SOAP submit query from InfoPath seems correct, there are values in it, and I also tried sending the XML through as text, or sending the full document. Neither works any better)

     My guess would be that the WebService is unable to parse the SOAP stream, so it creates an empty myFields object. How could I be able to debug that?





  • 07-20-2009 03:27 PM In reply to

    Re: Submitting to WebService : the values are lost in transit!

    Did you get an answer or solution for this?? I am having same problem.
  • 04-06-2010 02:07 PM In reply to

    Re: Submitting to WebService : the values are lost in transit!

    This is happening to me, though almost 1 year since the original post of this thread. I followed the same procedure used by nTuX, except the namespace for the service was called InfoPathService as stated in Philo Janus's book, Pro InfoPath 2007. I've read in other posts that to submit data to a webservice one has to use the "queryFields" fields. That makes sense if the goal to to return data to InfoPath, but I want to submit data to the web service and it will connect to a SQL Server db and insert a row in a table. I can get the insert to work, but the values are all NULL. What's interesting is the first time I created my InfoPath form, it was created from a blank form and it didn't have any "queryFields" or "dataFields" nodes. Afterwards, and after I created the web service, I created a new InfoPath form and this time created from the same web service. InfoPath created the "dataFields" node, but not the "queryFields" node. I suspect it was because there was no WebMethod that would return data back to InfoPath, but I am only guessing as I haven't tried it. Getting back to the problem at hand, is it probably true that the above procedure outlined by nTuX is correct, but somewhere in the manifest file or something there is an incorrect setting and all we have to do is debug it? Or, is there something actually wrong with the procedure?

     Thanks for any input on this...


    Filed under: ,
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.