Passing dataset to a web service - InfoPath Dev
in

InfoPath Dev

Passing dataset to a web service

Last post 08-13-2007 01:55 PM by shaun.nieves. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-28-2007 01:56 AM

    • spudy
    • Top 150 Contributor
    • Joined on 03-23-2006
    • United Kingdom
    • Posts 67

    Passing dataset to a web service

    I have a repeating group in my infopath form which I need to send to SQL db. I have a web service set up to do this. I configured the data connection using the update function of the web service and attempted to use the repeating group as the parameter (dataset) to pass to the web service.

    Needless to say (as here I am again in this forum) it does not work. The error message complains that the table mapping name does not match that which is expected by the web service. The repeating group in the forms datasource has the same name as the dataset name expected by the web service, but evidently this is not enough.

    Can anybody enlighten me on this issue?

    Thanks Spudy.

  • 07-02-2007 09:30 AM In reply to

    Re: Passing dataset to a web service

    You might try sending it to the Web Service as XML text and then creating a dataset from it in the Web Service.

  • 07-20-2007 03:46 PM In reply to

    Re: Passing dataset to a web service

    Here is what I did to use a web service to pass to a sharepoint list. The code is in VB.Net Hope it helps.

                    Dim numRows As Integer = thisXDocument.DOM.selectNodes("//my:myFields/my:Waste_Line_Items").length()

                    'MsgBox(numRows, MsgBoxStyle.OKOnly)

                    Dim i As Integer

                    If thisXDocument.IsNew Then

                        For i = 1 To numRows

                            'Capture node values

                            Dim TRACKNUM As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:TRACKNUM").text

                            'MsgBox(TRACKNUM, MsgBoxStyle.OKOnly)

                            Dim LINENUM As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:LINENUM").text

                            'MsgBox(LINENUM, MsgBoxStyle.OKOnly)

                            Dim PROFILENUM As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:PROFILENUM").text

                            'MsgBox(PROFILENUM, MsgBoxStyle.OKOnly)

                            Dim MATERIAL As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:MATERIAL").text

                            'MsgBox(MATERIAL, MsgBoxStyle.OKOnly)

                            Dim WEIGHT As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:WEIGHT").text

                            'MsgBox(MATERIAL, MsgBoxStyle.OKOnly)

                            Dim CONTTYP As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:CONTTYP").text

                            'MsgBox(CONTTYP, MsgBoxStyle.OKOnly)

                            Dim ACTUAL As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:ACTUAL").text

                            'MsgBox(ACTUAL, MsgBoxStyle.OKOnly)

                            Dim LOCUNIT As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:LOCUNIT").text

                            'MsgBox(LOCUNIT, MsgBoxStyle.OKOnly)

                            Dim SIZE As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:SIZE").text

                            'MsgBox(SIZE, MsgBoxStyle.OKOnly)

                            Dim ACTIVE As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:ACTIVE").text

                            'MsgBox(ACTIVE, MsgBoxStyle.OKOnly)

                            Dim INCOMINGDATE As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Misc/my:INCOMINGDATE").text

     

                            Dim DISCREP As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:DISCREP").text

                            'MsgBox(DISCREP, MsgBoxStyle.Critical)

                            Dim PAPTYP As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Form_info/my:Shipping_Paper/my:PAPTYP").text

                            'MsgBox(PAPTYP, MsgBoxStyle.Critical)

                            Dim GENNO As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Form_info/my:Generator/my:GENNO").text

                            'MsgBox(GENNO, MsgBoxStyle.Critical)

                            Dim CUSTNO As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Form_info/my:Company/my:COMPNO").text

                            'MsgBox(CUSTNO, MsgBoxStyle.Critical)

                            Dim INBOUNDFORMNAME As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Misc/my:INBOUNDFORMNAME").text

                            'MsgBox(INBOUNDFORMNAME, MsgBoxStyle.Critical)

                            Dim DISCSTARTDATE As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Misc/my:StartDate").text

                            'MsgBox(DISCSTARTDATE, MsgBoxStyle.Critical)

                            Dim DISCENDDATE As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Misc/my:EndDate").text

                            'MsgBox(DISCENDDATE, MsgBoxStyle.Critical)

                            Dim WEIGHTTICKETNUM As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Misc/my:WeightTicketNum").text

                            'MsgBox(WEIGHTTICKETNUM, MsgBoxStyle.Critical)

                            Dim wYear As String = DateTime.Today.Year

                            'MsgBox(wYear, MsgBoxStyle.Critical)

                            Dim WEIGHTTICKETNUMBER As String = WEIGHTTICKETNUM + "_" + TRACKNUM

     

                            Dim REJECTED As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:REJECT").text

     

                            Dim ANALYSIS As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:Analysis/my:ANALYSIS").text

     

                            Dim TOTALADDCOST As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Misc/my:TotalAddCost").text

     

                            Dim SHORTNUMBER As String = thisXDocument.DOM.selectSingleNode("//my:myFields/my:Waste_Line_Items[" & i & "]/my:ShortNumber").text

     

                            'Post node values to sps

                            Dim incoming As New KINS.Lists

                            Dim cr As New System.Net.NetworkCredential("SPS", "kins", "KINSDOMAIN")

                            incoming.Credentials = cr

     

                            Dim doc As New XmlDocument

                            Dim updates As XmlElement = doc.CreateElement("Batch")

     

                            updates.InnerXml = "<Method ID='1' Cmd='New'><Field Name='TRACKNUM'>" + TRACKNUM + _

                                                         "</Field><Field Name='LINENUM'>" + LINENUM + _

                                                         "</Field><Field Name='PROFILENUM'>" + PROFILENUM + _

                                                         "</Field><Field Name='MATERIAL'>" + MATERIAL + _

                                                         "</Field><Field Name='WEIGHT'>" + WEIGHT + _

                                                         "</Field><Field Name='CONTTYP'>" + CONTTYP + _

                                                         "</Field><Field Name='ACTUALMAT'>" + ACTUAL + _

                                                         "</Field><Field Name='LOCUN'>" + LOCUNIT + _

                                                         "</Field><Field Name='SIZE'>" + SIZE + _

                                                         "</Field><Field Name='ACTIVE'>" + ACTIVE + _

                                                         "</Field><Field Name='INCOMINGDATE'>" + INCOMINGDATE + _

                                                         "</Field><Field Name='DISCREPANCY'>" + ˆISCREP + _

                                                         "</Field><Field Name='SHIPPINGPAPER'>" + PAPTYP + _

                                                         "</Field><Field Name='GENNO'>" + GENNO + _

                                                         "</Field><Field Name='CUSTNO'>" + CUSTNO + _

                                                         "</Field><Field Name='INBOUNDFORMNUM'>" + INBOUNDFORMNAME + _

                                                         "</Field><Field Name='WEIGHTTICKETNUMBER'>" + WEIGHTTICKETNUMBER + _

                                                         "</Field><Field Name='REJECTED'>" + REJECTED + _

                                                         "</Field><Field Name='ANALYSIS'>" + ANALYSIS + _

                                                         "</Field><Field Name='SHORTTRACKNUM'>" + SHORTNUMBER + _

                                                         "</Field></Method>"

                            incoming.UpdateListItems("{8464E540-A310-402C-8D94-EF69583C8B12}", updates)

     

                        Next

     

    Shaun Nieves
    Sharepoint Manager
  • 08-09-2007 01:28 PM In reply to

    Re: Passing dataset to a web service

    Just curious, why did you provide userid, pw and domain in establishing your credentials instead of System.Net.CredentialCache.DefaultCredentials
  • 08-13-2007 01:55 PM In reply to

    Re: Passing dataset to a web service

    The client wanted specific credentials for passing the data to the list. The client is always right (=

    Shaun Nieves
    Sharepoint Manager
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.