Deriving Web Method Signature from WSDL file

Discussion in 'ASP .Net Web Services' started by Jay Pondy, Dec 15, 2005.

  1. Jay Pondy

    Jay Pondy Guest

    What would the VB.Net method signature look like in a web service ASMX
    file for following WSDL excerpt?

    <s:element name="submitFile">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="mailboxID"
    type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="fileName"
    type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="fileContents"
    type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="submitFileResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="submitFileResult"
    type="s:boolean" />
    <s:element minOccurs="1" maxOccurs="1" name="batchID"
    type="s:int" />
    <s:element minOccurs="0" maxOccurs="1" name="resultXML"
    type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>

    I can not figure out how to declare the method to get the
    submitFileResponse variables as listed.

    If I do something like:
    Public Sub submitFile(ByVal mailboxID As String, ByVal fileName As
    String, ByVal fileContents As String)
    that will match the submitFile specification but the
    submitFileResponse section will be empty.

    If I then add the variables listed in the submitFileResponse as ByRef
    parameters to the submitFile method then they show up in the
    submitFile declaration as well.

    We are trying to create a simulation web service to test against but
    all we have from the 3rd party is the WSDL file - their web service is
    not up and running yet. Ultimately we need to make this web service
    call from VB6 using the SOAP toolkit so we are trying to simulate as
    much as possible for testing purposes.

    Any help would be most appreciated.
     
    Jay Pondy, Dec 15, 2005
    #1
    1. Advertising

  2. Jay Pondy

    GCR Guest

    I'm not the VB guru, but in your code samople you declare a Sub, while you
    should declare a Function and specify the return type as submitFileResponse,
    something like: Public Function submitFile(ByVal requestData As submitFile)
    as submitFileResponse. The two types "submitFile" and "submitFileResponse"
    are XML serializable objects and you should always define your web methods
    with a single input parameter and a return type that are XML documents - this
    way you can handle a lot of problems (like versioning for example) much
    easier.




    "Jay Pondy" wrote:

    > What would the VB.Net method signature look like in a web service ASMX
    > file for following WSDL excerpt?
    >
    > <s:element name="submitFile">
    > <s:complexType>
    > <s:sequence>
    > <s:element minOccurs="0" maxOccurs="1" name="mailboxID"
    > type="s:string" />
    > <s:element minOccurs="0" maxOccurs="1" name="fileName"
    > type="s:string" />
    > <s:element minOccurs="0" maxOccurs="1" name="fileContents"
    > type="s:string" />
    > </s:sequence>
    > </s:complexType>
    > </s:element>
    > <s:element name="submitFileResponse">
    > <s:complexType>
    > <s:sequence>
    > <s:element minOccurs="1" maxOccurs="1" name="submitFileResult"
    > type="s:boolean" />
    > <s:element minOccurs="1" maxOccurs="1" name="batchID"
    > type="s:int" />
    > <s:element minOccurs="0" maxOccurs="1" name="resultXML"
    > type="s:string" />
    > </s:sequence>
    > </s:complexType>
    > </s:element>
    >
    > I can not figure out how to declare the method to get the
    > submitFileResponse variables as listed.
    >
    > If I do something like:
    > Public Sub submitFile(ByVal mailboxID As String, ByVal fileName As
    > String, ByVal fileContents As String)
    > that will match the submitFile specification but the
    > submitFileResponse section will be empty.
    >
    > If I then add the variables listed in the submitFileResponse as ByRef
    > parameters to the submitFile method then they show up in the
    > submitFile declaration as well.
    >
    > We are trying to create a simulation web service to test against but
    > all we have from the 3rd party is the WSDL file - their web service is
    > not up and running yet. Ultimately we need to make this web service
    > call from VB6 using the SOAP toolkit so we are trying to simulate as
    > much as possible for testing purposes.
    >
    > Any help would be most appreciated.
    >
    >
    >
    >
     
    GCR, Dec 19, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JJBW
    Replies:
    1
    Views:
    10,243
    Joerg Jooss
    Apr 24, 2004
  2. lyallex
    Replies:
    6
    Views:
    547
    lyallex
    Sep 29, 2007
  3. Gustavo Narea
    Replies:
    14
    Views:
    871
    Gustavo Narea
    Feb 16, 2009
  4. RH
    Replies:
    1
    Views:
    268
    Dino Chiesa [Microsoft]
    May 27, 2004
  5. mrnu

    wsdl.exe fails with WebMethods generated wsdl file

    mrnu, Jun 7, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    214
Loading...

Share This Page