Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Unable to deserialize SOAP response

Reply
Thread Tools

Unable to deserialize SOAP response

 
 
Fredy Villa
Guest
Posts: n/a
 
      11-04-2003
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/"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xmlnssd="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.SoapdocumentMethodA ttribute("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 xmlnssd="http://www.w3.org/2001/XMLSchema"
xmlnssi="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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make soap request and receive soap response from php soapservice Ivan S ASP .Net 0 08-13-2008 03:35 PM
SOAP Request is repeated in the SOAP response. comp.text.xml XML 0 09-20-2006 08:41 AM
Why does viewstate deserialize object as hashtable? jw56578@gmail.com ASP .Net 3 04-09-2005 07:43 PM
How to "deserialize" session contents?? Sidney Pecul ASP .Net 1 05-07-2004 11:02 PM
Calling BinaryFormatter:Deserialize(Stream); Asynchronously Assaf ASP .Net 1 02-07-2004 11:20 PM



Advertisments