473,387 Members | 1,493 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,387 software developers and data experts.

Serious problem with NET client and Axis web service

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,

Aug 16 '06 #1
11 3208
"David R" <Da****@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.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
Aug 16 '06 #2
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" <Da****@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.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
Aug 16 '06 #3
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:
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" <Da****@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.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

Aug 16 '06 #4
"David R" <Da****@discussions.microsoft.comwrote in message
news:45**********************************@microsof t.com...
>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
Aug 17 '06 #5
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="tns2:DocumentDescriptor" />
</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>

Aug 17 '06 #6
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
Aug 17 '06 #7
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:
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
Aug 17 '06 #8
"David R" <Da****@discussions.microsoft.comwrote in message
news:CF**********************************@microsof t.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
Aug 17 '06 #9
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:
"David R" <Da****@discussions.microsoft.comwrote in message
news:CF**********************************@microsof t.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
Aug 18 '06 #10
John,

Found the problem, which was, as you initially suggested, a namespace
problem. Thanks for all your help!

David

"John Saunders" wrote:
"David R" <Da****@discussions.microsoft.comwrote in message
news:CF**********************************@microsof t.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
Aug 18 '06 #11
I'm glad my help helped!

John

"David R" <Da****@discussions.microsoft.comwrote in message
news:A6**********************************@microsof t.com...
John,

Found the problem, which was, as you initially suggested, a namespace
problem. Thanks for all your help!

David

"John Saunders" wrote:
>"David R" <Da****@discussions.microsoft.comwrote in message
news:CF**********************************@microso ft.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

Aug 20 '06 #12

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

Similar topics

1
by: Espen Sletteng | last post by:
Hello all, I want to create a .NET-based web service that can accept dime-based attachments from a java (Axis)-based client. I have searched for examples that look like this scenario, but...
1
by: Dave Keays | last post by:
I am setting-up an experimental web service using Apache Axis but I'm having problems. AXIS can't find a library that I've verified exists on my computer and that CLASSPATH points to it. I'm using...
1
by: Thomas | last post by:
Hi, I have written a Web Service using Axis C++ Server and a .Net Windows client. I considered every interoperability issue between Axis and .Net( Doc/Literal ...) The .Net Windows client can...
0
by: Dhananjayan | last post by:
Hi, I have a webservice(eg.IStringServicePort) running on Axis, iam able to create a java client for the same and invoke the service and obtain the result. I wanted to create a .Net client(C#)...
2
by: Jarmo | last post by:
I have a Java-based (Axis) Web Service and am trying to write a .NET client in C#. I run into two different problems. 1. if the WSDL was generated using the Axis defaults then .NET cannot update...
5
by: vthakur | last post by:
Hello: I have a Axis Web Service that sets the sessionid in the SOAP header for persisting the session. The client is a .Net client that processes the header as an Unknown Header. It sets the...
3
by: GT | last post by:
I have a .NET client that consumes an Axis web service. A change was made recently to the AXIS web service, and ever since then my .NET proxy class has been throwing an InvalidCastException. The...
0
by: TraceyAnnison | last post by:
I wonder if you can help me - I'm new to this, and working in a project that has already been configured to work with Axis. We have a Java project built with the Spring framework, in order to...
0
by: Siyodia | last post by:
This is a java program which i need to run facing compilation error Its consuming a third party web service method I have the supported files(folder) which contain necessary class files...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.