HighTechTalks DotNet Forums  

Serious problem with NET client and Axis web service

Dotnet XML microsoft.public.dotnet.xml


Discuss Serious problem with NET client and Axis web service in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
David R
 
Posts: n/a

Default Serious problem with NET client and Axis web service - 08-16-2006 , 12:33 PM






This is a repost, with additional information. I have a Net 2.0 client (C#
Winform) calling an Axis web service. The .NET client can authenticate,
create requested objects, serialize the objects and send. These are received
without issue on the Axis server. The .NET client can also receive responses
from the Axis web service when the response is a single value type (long,
string, etc), or an array of value types.

However if an object is returned, it always appears empty. Looking at
NetMon, the response values appear in the SOAP message, but it seems that
..Net has trouble
deserializing the SOAP message into an object. Any ideas?

Thanks,


Reply With Quote
  #2  
Old   
John Saunders
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-16-2006 , 12:53 PM






"David R" <DavidR (AT) discussions (DOT) microsoft.com> wrote

Quote:
This is a repost, with additional information. I have a Net 2.0 client
(C#
Winform) calling an Axis web service. The .NET client can authenticate,
create requested objects, serialize the objects and send. These are
received
without issue on the Axis server. The .NET client can also receive
responses
from the Axis web service when the response is a single value type (long,
string, etc), or an array of value types.

However if an object is returned, it always appears empty. Looking at
NetMon, the response values appear in the SOAP message, but it seems that
.Net has trouble
deserializing the SOAP message into an object. Any ideas?
I've had this happen when there is a namespace mismatch. .NET is expecting
namespace "B", but namespace "A" arrives instead. Since it didn't receive
anything from namespace "B", it returns you what it got from namespace "B" -
nothing!

John




Reply With Quote
  #3  
Old   
David R
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-16-2006 , 01:26 PM



John,

Thanks for the quick response. So the object I am creating, with the
definition of:
public class WorkRequestTO Member of WSClass.s307a68
isn't filled because what comes in on the SOAP message is
xmlns="http://service.external.xxx.xxxsystems.com:>. I this correct? How
can I fix this without adapting the namespace of the Axis service?

Thanks,

David

"John Saunders" wrote:

Quote:
"David R" <DavidR (AT) discussions (DOT) microsoft.com> wrote in message
news:944CA9B3-9F9B-4DEE-90F4-DBC8705D97CB (AT) microsoft (DOT) com...
This is a repost, with additional information. I have a Net 2.0 client
(C#
Winform) calling an Axis web service. The .NET client can authenticate,
create requested objects, serialize the objects and send. These are
received
without issue on the Axis server. The .NET client can also receive
responses
from the Axis web service when the response is a single value type (long,
string, etc), or an array of value types.

However if an object is returned, it always appears empty. Looking at
NetMon, the response values appear in the SOAP message, but it seems that
.Net has trouble
deserializing the SOAP message into an object. Any ideas?

I've had this happen when there is a namespace mismatch. .NET is expecting
namespace "B", but namespace "A" arrives instead. Since it didn't receive
anything from namespace "B", it returns you what it got from namespace "B" -
nothing!

John




Reply With Quote
  #4  
Old   
David R
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-16-2006 , 01:59 PM



I found this, which might be helpful.

The SOAP request contains the following:
xmlns="http://service.external.xxx.xxxsystems.com>.

The following was in the reference.cs file:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
RequestNamespace="http://service.external.xxx.xxxsystems.com",
ResponseNamespace="http://service.external.xxx.xxxsystems.com",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
[return:
System.Xml.Serialization.XmlElementAttribute("getW orkRequestStatusReturn")]
public WorkRequestStatusTO getWorkRequestStatus(long workRequestId) {
object[] results = this.Invoke("getWorkRequestStatus", new
object[] {
workRequestId});
return ((WorkRequestStatusTO)(results[0]));

"David R" wrote:

Quote:
John,

Thanks for the quick response. So the object I am creating, with the
definition of:
public class WorkRequestTO Member of WSClass.s307a68
isn't filled because what comes in on the SOAP message is
xmlns="http://service.external.xxx.xxxsystems.com:>. I this correct? How
can I fix this without adapting the namespace of the Axis service?

Thanks,

David

"John Saunders" wrote:

"David R" <DavidR (AT) discussions (DOT) microsoft.com> wrote in message
news:944CA9B3-9F9B-4DEE-90F4-DBC8705D97CB (AT) microsoft (DOT) com...
This is a repost, with additional information. I have a Net 2.0 client
(C#
Winform) calling an Axis web service. The .NET client can authenticate,
create requested objects, serialize the objects and send. These are
received
without issue on the Axis server. The .NET client can also receive
responses
from the Axis web service when the response is a single value type (long,
string, etc), or an array of value types.

However if an object is returned, it always appears empty. Looking at
NetMon, the response values appear in the SOAP message, but it seems that
.Net has trouble
deserializing the SOAP message into an object. Any ideas?

I've had this happen when there is a namespace mismatch. .NET is expecting
namespace "B", but namespace "A" arrives instead. Since it didn't receive
anything from namespace "B", it returns you what it got from namespace "B" -
nothing!

John




Reply With Quote
  #5  
Old   
John Saunders
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-16-2006 , 10:23 PM



"David R" <DavidR (AT) discussions (DOT) microsoft.com> wrote

Quote:
I found this, which might be helpful.

The SOAP request contains the following:
xmlns="http://service.external.xxx.xxxsystems.com>.

The following was in the reference.cs file:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
RequestNamespace="http://service.external.xxx.xxxsystems.com",
ResponseNamespace="http://service.external.xxx.xxxsystems.com",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
[return:
System.Xml.Serialization.XmlElementAttribute("getW orkRequestStatusReturn")]
public WorkRequestStatusTO getWorkRequestStatus(long workRequestId)
{
object[] results = this.Invoke("getWorkRequestStatus", new
object[] {
workRequestId});
return ((WorkRequestStatusTO)(results[0]));

The problem might be
System.Web.Services.Protocols.SoapParameterStyle.W rapped vs. .Bare. I can't
tell without seeing your response message. Is the
getWorkRequestStatusReturn element immediately within the SOAP:Body element,
or is there something else around (wrapping) it?

John




Reply With Quote
  #6  
Old   
David R
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-17-2006 , 12:05 PM



Every reference I have in the .NET application indicates wrapped.

Here are four items. The first is the first part of the WDSL down to the
getWorkRequestStatus method. The second is the VS2005-generated code that
represents this method (showing that wrapped is used). The third item is the
first part of a successfully returned and read message (an array of strings
of US state names), and the fourth is the SOAP message that I cannot see.

Thanks,

David


ITEM ONE

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:tns2="http://external.aaa.gov/axis/externalInterface"
xmlns:tns1="http://service.external.xxx.xxxsystems.com"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:impl="http://s1fe034.ba.ad.aaa.gov:8100/axis/services/workRequestService"
xmlns:intf="http://s1fe034.ba.ad.aaa.gov:8100/axis/services/workRequestService"
targetNamespace="http://s1fe034.ba.ad.aaa.gov:8100/axis/services/workRequestService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://service.external.xxx.xxxsystems.com">
<xsd:import namespace="http://external.aaa.gov/axis/externalInterface"
/>
<xsd:element name="getDocument">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="documentObjectId" type="xsd:long" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getDocumentResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="getDocumentReturn"
type="tns2ocumentDescriptor" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getWorkRequestStatus">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="workRequestId" type="xsd:long" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getWorkRequestStatusResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="getWorkRequestStatusReturn"
type="tns2:WorkRequestStatusTO" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

ITEM TWO - From VS2005

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
RequestNamespace="http://service.external.xxx.xxxsystems.com",
ResponseNamespace="http://service.external.xxx.xxxsystems.com",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
[return:
System.Xml.Serialization.XmlElementAttribute("getW orkRequestStatusReturn")]
public WorkRequestStatusTO getWorkRequestStatus(long workRequestId) {
object[] results = this.Invoke("getWorkRequestStatus", new
object[] {
workRequestId});
return ((WorkRequestStatusTO)(results[0]));

ITEM THREE - SOAP envelope


<?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><getUSStatesResponse.xmlns ="http://service.external.xxx.xxxsystems.com"><getUSStatesR eturn>Alabama</getUSStatesReturn><getUSStatesReturn>Alaska</getUSStatesReturn><getUSStatesReturn>Alaska.and.th e.Pacific.Area</getUSStatesReturn><getUSStatesReturn>American.Samo a</getUSStatesReturn><getUSStatesReturn>Arizona</getUSStatesReturn><getUSStatesReturn>Arkansas</getUSStatesReturn><getUSStatesReturn>California</getUSStatesReturn>
xsi:nil="true"/><workRequestFormatCode>16</workRequestFormatCode><workRequestId>1687</workRequestId><workRequestNumber>0608-0001687</workRequestNumber><workRequestOwnerId>2868</workRequestOwnerId><workRequestOwnerName>OC-Controls</workRequestOwnerName><workRequestPriorityCode>75</workRequestPriorityCode><workRequestStatus></workRequestStatus>
xsi:nil="true"/><workRequestStatusCode>79</workRequestStatusCode><workRequestTitle>New
Work Request</workRequestTitle><workRequestType></workRequestType>
xsi:nil="true"/><workRequestTypeCode>116</workRequestTypeCode><workRequestpriority></workRequestpriority>
xsi:nil="true"/></createWorkRequestReturn></createWorkRequestResponse></soapenv:Body></soapenv:Envelope>

ITEM FOUR WorkRequestStatusResponse

<?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>
<getWorkRequestStatusResponse.xmlns="http://service.external.xxx.xxxsystems.com">
<getWorkRequestStatusReturn>
<closeOutDate></closeOutDate>
<closeOutTxt></closeOutTxt>
<createDate>08/17/2006</createDate>
<dueDate>07/17/2007</dueDate>
<principalContactGroupId>4939</principalContactGroupId>
<principalContactGroupName>DCDISP-OHA-Controls</principalContactGroupName>
<principalContactId>4635</principalContactId>
<principalContactName>Adolph.Ramirez</principalContactName>
<receivedDate>07/17/2006</receivedDate>
<restrictedSw>Y</restrictedSw>
<subjectCategoryCode>1</subjectCategoryCode>
<subjectCategoryDesc>800.Number</subjectCategoryDesc>
<subjectIdentifierCode>1</subjectIdentifierCode>
<subjectIdentifierDesc>General</subjectIdentifierDesc>
<workRequestDescription>This.is.a.new.work.request </workRequestDescription>
<workRequestFormat>E-ail</workRequestFormat>
<workRequestFormatCode>16</workRequestFormatCode>
<workRequestId>992</workRequestId>
<workRequestNumber>0608-000992</workRequestNumber>
<workRequestOwnerId>4939</workRequestOwnerId>
<workRequestOwnerName>DCDISP-OHA-ontrols</workRequestOwnerName>
<workRequestPriorityCode>75</workRequestPriorityCode>
<workRequestStatus>Open</workRequestStatus>
<workRequestStatusCode>79</workRequestStatusCode>
<workRequestTitle>New.Work.Request</workRequestTitle>
<workRequestType>Agreement</workRequestType>
<workRequestTypeCode>116</workRequestTypeCode>
<workRequestpriority>5-ay</workRequestpriority>
</getWorkRequestStatusReturn></getWorkRequestStatusResponse>
</soapenv:Body></soapenv:Envelope>




Reply With Quote
  #7  
Old   
John Saunders
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-17-2006 , 01:05 PM



Try either changing the return:
XmlElementAttribute("getWorkRequestStatusResponse" ) or else changing th
style to Bare.

It seems to me that Wrapped is more for the case where you're returning more
than one element and need something to wrap them in. That's just a personal
preference, though.

John



Reply With Quote
  #8  
Old   
David R
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-17-2006 , 04:26 PM



Thanks for the ideas. I tried both, but generated the same results.

One strange thing I noticed. I tried setting a breakpoint on the
auto-generated method getWorkRequestStatus, which is based upon the WSDL.
This method is in the Reference.cs file. The breakpoint was ignored when
debugging. Any idea why this might be?

David


"John Saunders" wrote:

Quote:
Try either changing the return:
XmlElementAttribute("getWorkRequestStatusResponse" ) or else changing th
style to Bare.

It seems to me that Wrapped is more for the case where you're returning more
than one element and need something to wrap them in. That's just a personal
preference, though.

John




Reply With Quote
  #9  
Old   
John Saunders
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-17-2006 , 05:43 PM



"David R" <DavidR (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanks for the ideas. I tried both, but generated the same results.

One strange thing I noticed. I tried setting a breakpoint on the
auto-generated method getWorkRequestStatus, which is based upon the WSDL.
This method is in the Reference.cs file. The breakpoint was ignored when
debugging. Any idea why this might be?
Is there a [DebuggerStepThrough] attribute on that method?

John




Reply With Quote
  #10  
Old   
David R
 
Posts: n/a

Default Re: Serious problem with NET client and Axis web service - 08-18-2006 , 08:06 AM



John,

Yes there was. A handy feature, now that I know about it. I commented it
out, and was able to look at the Invoke method, which returns an object.
Sure enough, the object was created, as before, but all the properties were
null.

I also saw a problem I had not noticed before, since it did not throw an
error. On the WDSL, VS2005 is warning on xsd:element (shown below) that
'http://external.aaa.gov/axis/externalInterface:WorkRequestTO' is not
declared. Could this be the cause, and if so, can I declare this, or does it
need to be done on the server side.?

<xsd:sequence>
<xsd:element name="getWorkRequestStatusReturn"
type="tns2:WorkRequestStatusTO" />
</xsd:sequence>

Thanks,

David

"John Saunders" wrote:

Quote:
"David R" <DavidR (AT) discussions (DOT) microsoft.com> wrote in message
news:CF48AA62-267B-4547-9E4C-7F984671983B (AT) microsoft (DOT) com...
Thanks for the ideas. I tried both, but generated the same results.

One strange thing I noticed. I tried setting a breakpoint on the
auto-generated method getWorkRequestStatus, which is based upon the WSDL.
This method is in the Reference.cs file. The breakpoint was ignored when
debugging. Any idea why this might be?

Is there a [DebuggerStepThrough] attribute on that method?

John




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.