473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

problems deserializing response from web service

Hi...

I'm trying to write a web service client and am running into a problem with
getting a response back from the server. I know that a full xml message is
being returned (thanks to a tcp/ip sniffer) but in VS.NET all I get is a null
reference.

The server is a java program running on websphere. The provider of the web
service has gotten a websphere client and an apache axis client to work
correctly, so I don't think it's a problem with the server.

Any suggestions? I can attach the wsdl and the xml that is being returned
if that will help diagnose.

Thanks
Nov 23 '05 #1
7 5925
Hello Railinc,
This is probably because the namespaces are not matching in the xml messages

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi...

I'm trying to write a web service client and am running into a problem
with getting a response back from the server. I know that a full xml
message is being returned (thanks to a tcp/ip sniffer) but in VS.NET
all I get is a null reference.

The server is a java program running on websphere. The provider of
the web service has gotten a websphere client and an apache axis
client to work correctly, so I don't think it's a problem with the
server.

Any suggestions? I can attach the wsdl and the xml that is being
returned if that will help diagnose.

Thanks

Nov 23 '05 #2
Dilip,

I'm having what appears to be the same issue but it seems to me that the
namespaces match. I'm using document/literal to invoke an axis web service
from a c# client. I have included the definition from within the web
reference along with the response message. I would really appreciate any
pointers you might have.

Thanks,

Carson
Definition from the web reference:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)]

[return: System.Xml.Serialization.XmlElementAttribute("gene rateReturn",
Namespace="http://ws.eaf.cynergysystems.com")]

public Response
generate([System.Xml.Serialization.XmlElementAttribute(Names pace="http://ws.eaf.cynergysystems.com")] Request in0) {
object[] results = this.Invoke("generate", new object[] {
in0});
return ((Response)(results[0]));
}

Response Message:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<generateReturn xmlns="http://ws.eaf.cynergysystems.com">
<returnCode>0</returnCode>
<messages>blah blah</messages>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
</generateReturn>
</soapenv:Body>
</soapenv:Envelope>


"Dilip Krishnan" wrote:
Hello Railinc,
This is probably because the namespaces are not matching in the xml messages

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi...

I'm trying to write a web service client and am running into a problem
with getting a response back from the server. I know that a full xml
message is being returned (thanks to a tcp/ip sniffer) but in VS.NET
all I get is a null reference.

The server is a java program running on websphere. The provider of
the web service has gotten a websphere client and an apache axis
client to work correctly, so I don't think it's a problem with the
server.

Any suggestions? I can attach the wsdl and the xml that is being
returned if that will help diagnose.

Thanks


Nov 23 '05 #3
Dilip,

After searching forever trying to find a discrepancy and finding nothing, I
opted to redeploy the axis service as wrapped/literal and it worked
perfectly. Any idea why that would be? Any drawbacks to this approach?
There are none that I can see at least in my limited environment.
Thanks,

Carson
"Carson Hager" wrote:
Dilip,

I'm having what appears to be the same issue but it seems to me that the
namespaces match. I'm using document/literal to invoke an axis web service
from a c# client. I have included the definition from within the web
reference along with the response message. I would really appreciate any
pointers you might have.

Thanks,

Carson
Definition from the web reference:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)]

[return: System.Xml.Serialization.XmlElementAttribute("gene rateReturn",
Namespace="http://ws.eaf.cynergysystems.com")]

public Response
generate([System.Xml.Serialization.XmlElementAttribute(Names pace="http://ws.eaf.cynergysystems.com")] Request in0) {
object[] results = this.Invoke("generate", new object[] {
in0});
return ((Response)(results[0]));
}

Response Message:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<generateReturn xmlns="http://ws.eaf.cynergysystems.com">
<returnCode>0</returnCode>
<messages>blah blah</messages>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
</generateReturn>
</soapenv:Body>
</soapenv:Envelope>


"Dilip Krishnan" wrote:
Hello Railinc,
This is probably because the namespaces are not matching in the xml messages

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi...

I'm trying to write a web service client and am running into a problem
with getting a response back from the server. I know that a full xml
message is being returned (thanks to a tcp/ip sniffer) but in VS.NET
all I get is a null reference.

The server is a java program running on websphere. The provider of
the web service has gotten a websphere client and an apache axis
client to work correctly, so I don't think it's a problem with the
server.

Any suggestions? I can attach the wsdl and the xml that is being
returned if that will help diagnose.

Thanks


Nov 23 '05 #4
Hello Carson,
if you are looking for interop, document/literal is the way to go. No
drawbacks whatsoever :)

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Dilip,

After searching forever trying to find a discrepancy and finding
nothing, I opted to redeploy the axis service as wrapped/literal and
it worked perfectly. Any idea why that would be? Any drawbacks to
this approach? There are none that I can see at least in my limited
environment.

Thanks,

Carson

"Carson Hager" wrote:
Dilip,

I'm having what appears to be the same issue but it seems to me that
the namespaces match. I'm using document/literal to invoke an axis
web service from a c# client. I have included the definition from
within the web reference along with the response message. I would
really appreciate any pointers you might have.

Thanks,

Carson

Definition from the web reference:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)
]

[return:
System.Xml.Serialization.XmlElementAttribute("gene rateReturn",
Namespace="http://ws.eaf.cynergysystems.com")]

public Response

generate([System.Xml.Serialization.XmlElementAttribute(Names pace="htt
p://ws.eaf.cynergysystems.com")] Request in0) {

object[] results = this.Invoke("generate", new object[] {

in0});

return ((Response)(results[0]));

}

Response Message:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<generateReturn xmlns="http://ws.eaf.cynergysystems.com">
<returnCode>0</returnCode>
<messages>blah blah</messages>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
</generateReturn>
</soapenv:Body>
</soapenv:Envelope>
"Dilip Krishnan" wrote:
Hello Railinc,
This is probably because the namespaces are not matching in the xml
messages
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi...

I'm trying to write a web service client and am running into a
problem with getting a response back from the server. I know that
a full xml message is being returned (thanks to a tcp/ip sniffer)
but in VS.NET all I get is a null reference.

The server is a java program running on websphere. The provider of
the web service has gotten a websphere client and an apache axis
client to work correctly, so I don't think it's a problem with the
server.

Any suggestions? I can attach the wsdl and the xml that is being
returned if that will help diagnose.

Thanks

Nov 23 '05 #5
Thanks for getting back to me. I realize that document/literal is the
generally prescribed way to do things but I've seen way too many posts
pointing to unresolved problems with it, at least with Java based web
services and .NET clients. I am fairly certain that there are no namespace
issues. I've traversed the WSDL thoroughly and validated the response from
Axis. It appears to be spot on. The only thing I've seen is that there is a
slight difference in the way .NET and Axis send messages. Within the elements
of the response message, the .NET client includes an empty namespace
attribute, xmlns="". The axis response does not include this. The only
other thing is that axis uses soapenv and .NET uses soap but that's clearly
not the issue. They both point to the same soap namespace. I have no idea
whether not including that attribute would cause the .NET deserialized to
choke. All I can tell you is that it's the only noticeable difference in the
messages.

Thanks again for your feedback. I'd be interested in hearing if anyone has
any additional input here and also if there are any drawbacks to using
wrapped instead of document.
Carson


"Dilip Krishnan" wrote:
Hello Carson,
if you are looking for interop, document/literal is the way to go. No
drawbacks whatsoever :)

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Dilip,

After searching forever trying to find a discrepancy and finding
nothing, I opted to redeploy the axis service as wrapped/literal and
it worked perfectly. Any idea why that would be? Any drawbacks to
this approach? There are none that I can see at least in my limited
environment.

Thanks,

Carson

"Carson Hager" wrote:
Dilip,

I'm having what appears to be the same issue but it seems to me that
the namespaces match. I'm using document/literal to invoke an axis
web service from a c# client. I have included the definition from
within the web reference along with the response message. I would
really appreciate any pointers you might have.

Thanks,

Carson

Definition from the web reference:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)
]

[return:
System.Xml.Serialization.XmlElementAttribute("gene rateReturn",
Namespace="http://ws.eaf.cynergysystems.com")]

public Response

generate([System.Xml.Serialization.XmlElementAttribute(Names pace="htt
p://ws.eaf.cynergysystems.com")] Request in0) {

object[] results = this.Invoke("generate", new object[] {

in0});

return ((Response)(results[0]));

}

Response Message:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<generateReturn xmlns="http://ws.eaf.cynergysystems.com">
<returnCode>0</returnCode>
<messages>blah blah</messages>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
</generateReturn>
</soapenv:Body>
</soapenv:Envelope>
"Dilip Krishnan" wrote:

Hello Railinc,
This is probably because the namespaces are not matching in the xml
messages
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
> Hi...
>
> I'm trying to write a web service client and am running into a
> problem with getting a response back from the server. I know that
> a full xml message is being returned (thanks to a tcp/ip sniffer)
> but in VS.NET all I get is a null reference.
>
> The server is a java program running on websphere. The provider of
> the web service has gotten a websphere client and an apache axis
> client to work correctly, so I don't think it's a problem with the
> server.
>
> Any suggestions? I can attach the wsdl and the xml that is being
> returned if that will help diagnose.
>
> Thanks
>


Nov 23 '05 #6
More information on the Wrapped implementation within Axis. It is evidently
directed at .NET integration.

http://marc.theaimsgroup.com/?l=axis...4879902571&w=2
Carson


"Dilip Krishnan" wrote:
Hello Carson,
if you are looking for interop, document/literal is the way to go. No
drawbacks whatsoever :)

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Dilip,

After searching forever trying to find a discrepancy and finding
nothing, I opted to redeploy the axis service as wrapped/literal and
it worked perfectly. Any idea why that would be? Any drawbacks to
this approach? There are none that I can see at least in my limited
environment.

Thanks,

Carson

"Carson Hager" wrote:
Dilip,

I'm having what appears to be the same issue but it seems to me that
the namespaces match. I'm using document/literal to invoke an axis
web service from a c# client. I have included the definition from
within the web reference along with the response message. I would
really appreciate any pointers you might have.

Thanks,

Carson

Definition from the web reference:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)
]

[return:
System.Xml.Serialization.XmlElementAttribute("gene rateReturn",
Namespace="http://ws.eaf.cynergysystems.com")]

public Response

generate([System.Xml.Serialization.XmlElementAttribute(Names pace="htt
p://ws.eaf.cynergysystems.com")] Request in0) {

object[] results = this.Invoke("generate", new object[] {

in0});

return ((Response)(results[0]));

}

Response Message:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<generateReturn xmlns="http://ws.eaf.cynergysystems.com">
<returnCode>0</returnCode>
<messages>blah blah</messages>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
<datasets>
<name>customerlist</name>
<data></data>
<arguments></arguments>
<messages>blah blah</messages>
<mimeType>text/html</mimeType>
<isBinary>false</isBinary>
</datasets>
</generateReturn>
</soapenv:Body>
</soapenv:Envelope>
"Dilip Krishnan" wrote:

Hello Railinc,
This is probably because the namespaces are not matching in the xml
messages
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
> Hi...
>
> I'm trying to write a web service client and am running into a
> problem with getting a response back from the server. I know that
> a full xml message is being returned (thanks to a tcp/ip sniffer)
> but in VS.NET all I get is a null reference.
>
> The server is a java program running on websphere. The provider of
> the web service has gotten a websphere client and an apache axis
> client to work correctly, so I don't think it's a problem with the
> server.
>
> Any suggestions? I can attach the wsdl and the xml that is being
> returned if that will help diagnose.
>
> Thanks
>


Nov 23 '05 #7
I'm working with a third-party service (they're using Axis and I'm
using .Net for the client) and they switched to literal/wrapped in an
attempt to allow me to consume the service. It solved several
problems, but I'm still experiencing the symptom originally described
in this post - namely that when .Net deserializes the response I end up
with an empty result even though I'm getting a real Soap response.

I'm desperate for any help or suggestions. Here are appropriate
snippets of wsdl, the function call and the soap response the server is
returning. If anyone's willing and able to help I can post more
info/code.

Thanks,

Jennifer

==== Response ====
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<messageFileResponse xmlns="https://mydomain.org/MyService">
<messageFileReturn>
<pending>1</pending>
<recalled>0</recalled>
</messageFileReturn>
</messageFileResponse>
</soapenv:Body>
</soapenv:Envelope>

The function call generated by wsdl.exe is (in VB.Net)

<System.Web.Services.Protocols.SoapDocumentMethodA ttribute("",
RequestNamespace:="https://https://mydomain.org/MyService",
ResponseNamespace:="https://https://mydomain.org/MyService",
Use:=System.Web.Services.Description.SoapBindingUs e.Literal,
ParameterStyle:=System.Web.Services.Protocols.Soap ParameterStyle.Wrapped)>
_
Public Function messageFile() As
<System.Xml.Serialization.XmlElementAttribute("mes sageFileReturn")>
MessageFileResult

WSDL (just a couple snippets that seem likely to be the issue - didn't
want to drown this topic more than I already am)

---
<element name="messageFileResponse">
<complexType>
<sequence>
<element name="messageFileReturn" type="impl:MessageFileResult"/>
</sequence>
</complexType>
</element>
<complexType name="MessageFileResult">
<sequence>
<element name="pending" type="xsd:int"/>
<element name="recalled" type="xsd:int"/>
</sequence>
</complexType>

.......

<wsdl:message name="messageFileResponse">
<wsdl:part element="impl:messageFileResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="MyService">
<wsdl:operation name="messageFile">
<wsdl:input message="impl:messageFileRequest"
name="messageFileRequest"/>
<wsdl:output message="impl:messageFileResponse"
name="messageFileResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MyServiceSoapBinding" type="impl:MyService">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="messageFile">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="messageFileRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="messageFileResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

Nov 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Artur Niesporek | last post by:
Hi guys, when receiving a soap response posted back from a server i get the following error when deserializing the soap message. The problem seems to be with the item-collection of the...
2
by: Steve Bugden | last post by:
Hi, I am using the XmlSerializer class to deserialize a file, please see attached code. This works fine from a windows form, but fails when called from an asp.net web service. Unfortuantely I...
4
by: JLJ | last post by:
I have a very simple webservice written in Java/Axis. It takes in a complexType with 2 string elements, userid and password. The response is a complexType containing two complexTypes each having...
0
by: leslie_tighe | last post by:
Hello, I have a web service that is running in a java server using axis that I want to use from .net. In VS.net 2003 I setup a project with a web reference. Using generated code I am able to...
2
by: voipdealer | last post by:
I think this XML response sucks, but it's being sent to us from a third-party, so I can't do anything about it except work with it. I am receiving the following return code elements inside a...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
0
by: Sivajee Akula | last post by:
Hello All, I am trying to consume a .NET Service from Adobe LiveCycle Workflow. The service deals with complex objects. I am getting the following exception at the time of invocation of the...
5
by: Simon | last post by:
I have problem with namespaces. I have a program that consumes the web service and has for instance names space nsProgram. In this program I have defined several classes that I use for storing and...
0
by: William LaMartin | last post by:
I have created a web service that simply uses WebClient to retrieve the text of a web page. If I access the asmx page with my browser and put in a URL, it retrieves the text of that page with no...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.