Results 1 to 3 of 3

Thread: consuming web service: Value of 1-dimensionnal array of 1-dimensional array of MyObj

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    589

    consuming web service: Value of 1-dimensionnal array of 1-dimensional array of MyObj

    Hi I wanna consume a web service that returns this kind of data:

    The web method returns an array of another array of let's say:

    MyObject

    I want to use this:

    Dim xRoot As XmlElement
    Dim ws As New myWebService
    xRoot = ws.GetContractsByMyArgument(MyArgument) Dim nt As New NameTable
    Dim nsmgr As New XmlNamespaceManager(nt)

    But the probelem is that I can't even compile:

    I get is this in the VS 2005:

    Value of 1-dimensionnal array of 1-dimensional array of MyObject can not be converted to xmlelement.

    So I am not sure how I can fill the xroot variable from the returned value of the web method.

    Thanks a lot.
    Thanks a lot for your help.

  2. #2
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Re: consuming web service: Value of 1-dimensionnal array of 1-dimensional array of MyObj

    How is the sub/function that is in the webservice declared? Can you post that whole thing (as is unaltered)?

    Thanks,

    D
    Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP

    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

    Reserved Words in Access | Connection Strings

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    589

    Re: consuming web service: Value of 1-dimensionnal array of 1-dimensional array of MyObj

    If you re asking about the way I call that web method, here s the way I call it:

    dim myServ as New submitWS.submitMyObjectService

    private sub callWebMethod
    dim cntr as new submitWS.CtrDetailsByCtrNumber
    Cntr.ctrNumber = "number to look for"
    myServ.getCtrDetailsByctrNumber(cntr)
    End Sub

    If I try to inspect the method in reference.vb that VS2005 creates when I add the web service reference, I find this:

    <System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _


    Public Function getCtrDetailsByCtrNumber(<System.Xml.Serialization.XmlElementAttribute([Namespace]:="http://Company.ca/tmMy/submit")> ByVal CtrDetailsByCtrNumber As CtrDetailsByCtrNumber) As <System.Xml.Serialization.XmlArrayAttribute("MyOBJECTResponse", [Namespace]:="http://Company.ca/tmMy/submit"), System.Xml.Serialization.XmlArrayItemAttribute("MyResponseObject", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=false), System.Xml.Serialization.XmlArrayItemAttribute("MyResponseNV", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=false, NestingLevel:=1)> MyResponse()()

    Dim results() As Object = Me.Invoke("getCtrDetailsByCtrNumber", New Object() {CtrDetailsByCtrNumber})
    Return CType(results(0),MyResponse()())
    End Function






    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1433"), _
    System.SerializableAttribute(), _
    System.Diagnostics.DebuggerStepThroughAttribute(), _
    System.ComponentModel.DesignerCategoryAttribute("code"), _
    System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true, [Namespace]:="http://Company.ca/tmMy/submit")> _
    Partial Public Class CtrDetailsByCtrNumber

    Private CtrNumberField As String

    .....
    .....
    .....
    etc



    End Class


    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1433"), _
    System.SerializableAttribute(), _
    System.Diagnostics.DebuggerStepThroughAttribute(), _
    System.ComponentModel.DesignerCategoryAttribute("code"), _
    System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://Company.ca/tmMy/submit")> _
    Partial Public Class MyResponse

    .....
    .....
    .....
    etc

    End Class

    Pls let me know if u were asking about something else.

    Thanks a lot.
    Thanks a lot for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width