Unable to deserialize SOAP response

Discussion in 'ASP .Net Web Services' started by Fredy Villa, Nov 4, 2003.

  1. Fredy Villa

    Fredy Villa Guest

    I have read the .net documentation about custom soap messages and
    using xml and soap attributes to deal with this problem, but after
    almost 2 days I find myself staring at code that should work, but
    doesn't.

    The following is the SOAP response I get (which btw is correct)

    <?xml version="1.0" encoding="UTF-8" ?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns0:getVendorListResponse xmlns:ns0="urn:local"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <ns0:return xsi:type="SOAP-ENC:Array" xmlns:bean="java:com.ggt.core"
    SOAP-ENC:arrayType="bean:VendorHeader[1]">
    <item xsi:type="bean:VendorHeader"
    xmlns:bean="java:com.ggt.core">
    <shortName xsi:type="xsd:string">Westin Stonebriar Resort,
    North Dallas</shortName>
    <vendorId xsi:type="xsd:int">13526</vendorId>
    <name xsi:type="xsd:string">The Westin Stonebriar
    Resort</name>
    <contactId xsi:type="xsd:int">593922</contactId>
    </item>
    </ns0:return>
    </ns0:getVendorListResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>


    This is the method from my proxy class:

    <System.Web.Services.Protocols.SoapdocumentMethodAttribute("getVendorList",
    ResponseNamespace:="urn:local",
    ResponseElementName:="getVendorListResponse",Use:=SoapBindingUse.Literal,
    ParameterStyle:=SoapParameterStyle.Wrapped)> _
    Public Function getVendorList(ByVal arg0 As Session) As
    VendorHeader()
    Dim results() As Object = Me.Invoke("getVendorList", New
    Object() {arg0})
    Return CType(results(0),VendorHeader())
    End Function


    My VendorHeader class definition:

    <System.Xml.Serialization.SoapTypeAttribute("item",
    "java:com.ggt.core")> _
    Public Class VendorHeader

    Public shortName As String
    Public vendorId As Integer
    Public name As String
    Public contactId As Integer

    end class


    I get a response and when I serialized to a file I get:

    <?xml version="1.0" encoding="utf-8" ?>
    <ArrayOfVendorHeader xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />


    Notice that it doesn't return null, but the array has no items!


    What Xml or SOAP Attributes do I need to get the result to correctly
    populate
    my array of VendorHeaders? I got a soap response but I can't get it to
    deserialize into an array of my class VendorHeader.


    I will apprecitate any help,

    Fredy
     
    Fredy Villa, Nov 4, 2003
    #1
    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. Assaf
    Replies:
    1
    Views:
    522
    Justin Rogers
    Feb 7, 2004
  2. Sidney Pecul

    How to "deserialize" session contents??

    Sidney Pecul, May 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    973
    William F. Robertson, Jr.
    May 8, 2004
  3. Replies:
    3
    Views:
    667
  4. comp.text.xml
    Replies:
    0
    Views:
    543
    comp.text.xml
    Sep 20, 2006
  5. Ivan S
    Replies:
    0
    Views:
    557
    Ivan S
    Aug 13, 2008
Loading...

Share This Page