submitting data to a web service - InfoPath Dev
in

InfoPath Dev

submitting data to a web service

Last post 07-28-2009 02:30 AM by MashadaG. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-21-2009 09:42 AM

    submitting data to a web service

    Hi

    I am new to InfoPath 2007 and I am working on a live project that requires its use asap. I require to retrieve and submit data via a web service (SQL2005) that I have written in VB.NET. The retrieval part works fine but my main problem is with the submit part. What I am confused is what the signature for the submit method should be like. After I receive the data, I need to do some internal biz process calculations before I persist it in the database

     This is how I am retrieving the data. That works well and returns an xml document in place of a dataset as that is not supported. <WebMethod()> _Public Function GetAllRecords(ByVal acad_period As String, ByVal aos_code As String, ByVal aos_period As String) As System.Xml.XmlDocument This is how I am retrieving the data (this is the difficult part that I cannot understand). What signature do I use for the web service that receives the submitted data. For instance how do I get the values in the controls as if these are submitted back, they must exist in some type of object. That is what I do not understand. <WebMethod()> _   Public Function SaveRec() As String        

    I would appreciate any help or pointing in the right direction, this has really been nagging me all week :(

      

     

  • 07-21-2009 12:37 PM In reply to

    Re: submitting data to a web service

    Hi MashadaG and welcome to our forum!

    I don't understand your post. It seems like you are doing something in a way that is way too complicated, but it's also possible that I am just confused because I don't understand your scenario very well.

    What I will recommend is to install our free Web Service trial. I guarantee you'll be able to receive and submit data to SQL 2005 in very little time (certainly shouldn't take more than an hour or two to install, configure and have working). That may be an option for you. We can give you an extended trial if you want it. Might be a good stopgap to get your stuff working and then you'll have more time to debug your custom Web Service. I'm not trying to get you to buy anything but rather just trying to offer a free alternative to get unblocked so that you can show your solution working, etc.

    Patrick Halstead
    Project Manager at Qdabra
  • 07-22-2009 01:26 AM In reply to

    Re: submitting data to a web service

    Patrick

    Thanks for your response. I am trying to achieve the most basic of things I believe but I have no clue as to how to proceed. Consider this a customer and orders example. The relationship is one to many respectively. This means that the orders bit will be in a repeating table on the form say. Now retrieving that info via a web service is quite straight-forward as I will create a web method that returns an XML document.

    What I am struggling with is the submit method. Say I create a web method called SaveRecords(), I am not sure what parameters to pass to it for me to  then access the data that is returned from the InfoPath form. What I want to do is to access the data returned and do some calculations e.g. add VAT then submit this to a stored procedure. I believe the web method should be something like SaveRecords (ByVal Obj as ObjType), what I am not sure is what should ObjType be? Is it a class, enum??? That's what I do not understand.

     That said I will try out your web service.

    Thanks for the help

  • 07-28-2009 02:30 AM In reply to

    Re: submitting data to a web service

    I have figured what to do, just in case anyone else has a similar problem.

    Use the submit data as string option in the data connections bit. This will submit an XML string that can then be transformed into a dataset in the web service, use a signature as below e.g. 

        <WebMethod()> _

       Public Function SaveRpt(ByVal cls As String)

            Dim ds1 As New DataSet

            Dim tr As TextReader = New StringReader(cls)

            Dim xr As XmlReader = New XmlTextReader(tr)

            ds1.ReadXml(xr)

            Dim rr As DataRow

            strMsg = ds1.Tables.Count

            For Each rr In ds1.Tables("tbl").Rows

                strMsg = strMsg & " *** " & rr.Item("item1").ToString

            Next

    Hope this helps someone as it has driven mne up the wall for a while :)

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.