473,581 Members | 3,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3230
"David R" <Da****@discuss ions.microsoft. comwrote in message
news:94******** *************** ***********@mic rosoft.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.externa l.xxx.xxxsystem s.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****@discuss ions.microsoft. comwrote in message
news:94******** *************** ***********@mic rosoft.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.externa l.xxx.xxxsystem s.com>.

The following was in the reference.cs file:

[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("" ,
RequestNamespac e="http://service.externa l.xxx.xxxsystem s.com",
ResponseNamespa ce="http://service.externa l.xxx.xxxsystem s.com",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
[return:
System.Xml.Seri alization.XmlEl ementAttribute( "getWorkRequest StatusReturn")]
public WorkRequestStat usTO getWorkRequestS tatus(long workRequestId) {
object[] results = this.Invoke("ge tWorkRequestSta tus", new
object[] {
workRequestId}) ;
return ((WorkRequestSt atusTO)(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.externa l.xxx.xxxsystem s.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****@discuss ions.microsoft. comwrote in message
news:94******** *************** ***********@mic rosoft.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****@discuss ions.microsoft. comwrote in message
news:45******** *************** ***********@mic rosoft.com...
>I found this, which might be helpful.

The SOAP request contains the following:
xmlns="http://service.externa l.xxx.xxxsystem s.com>.

The following was in the reference.cs file:

[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("" ,
RequestNamespac e="http://service.externa l.xxx.xxxsystem s.com",
ResponseNamespa ce="http://service.externa l.xxx.xxxsystem s.com",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
[return:
System.Xml.Seri alization.XmlEl ementAttribute( "getWorkRequest StatusReturn")]
public WorkRequestStat usTO getWorkRequestS tatus(long workRequestId)
{
object[] results = this.Invoke("ge tWorkRequestSta tus", new
object[] {
workRequestId}) ;
return ((WorkRequestSt atusTO)(results[0]));

The problem might be
System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped vs. .Bare. I can't
tell without seeing your response message. Is the
getWorkRequestS tatusReturn 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
getWorkRequestS tatus 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:definitio ns xmlns:apachesoa p="http://xml.apache.org/xml-soap"
xmlns:tns2="htt p://external.aaa.go v/axis/externalInterfa ce"
xmlns:tns1="htt p://service.externa l.xxx.xxxsystem s.com"
xmlns:wsdlsoap= "http://schemas.xmlsoap .org/wsdl/soap/"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:impl="htt p://s1fe034.ba.ad.a aa.gov:8100/axis/services/workRequestServ ice"
xmlns:intf="htt p://s1fe034.ba.ad.a aa.gov:8100/axis/services/workRequestServ ice"
targetNamespace ="http://s1fe034.ba.ad.a aa.gov:8100/axis/services/workRequestServ ice" xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/">
<wsdl:types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified"
targetNamespace ="http://service.externa l.xxx.xxxsystem s.com">
<xsd:import namespace="http ://external.aaa.go v/axis/externalInterfa ce"
/>
<xsd:element name="getDocume nt">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="documentO bjectId" type="xsd:long" />
</xsd:sequence>
</xsd:complexType >
</xsd:element>
<xsd:element name="getDocume ntResponse">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="getDocume ntReturn"
type="tns2:Docu mentDescriptor" />
</xsd:sequence>
</xsd:complexType >
</xsd:element>
<xsd:element name="getWorkRe questStatus">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="workReque stId" type="xsd:long" />
</xsd:sequence>
</xsd:complexType >
</xsd:element>
<xsd:element name="getWorkRe questStatusResp onse">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="getWorkRe questStatusRetu rn"
type="tns2:Work RequestStatusTO " />
</xsd:sequence>
</xsd:complexType >
</xsd:element>

ITEM TWO - From VS2005

[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("" ,
RequestNamespac e="http://service.externa l.xxx.xxxsystem s.com",
ResponseNamespa ce="http://service.externa l.xxx.xxxsystem s.com",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
[return:
System.Xml.Seri alization.XmlEl ementAttribute( "getWorkRequest StatusReturn")]
public WorkRequestStat usTO getWorkRequestS tatus(long workRequestId) {
object[] results = this.Invoke("ge tWorkRequestSta tus", new
object[] {
workRequestId}) ;
return ((WorkRequestSt atusTO)(results[0]));

ITEM THREE - SOAP envelope
<?xml.version=" 1.0".encoding=" utf-8"?><soapenv:En velope.xmlns:so apenv="http://schemas.xmlsoap .org/soap/envelope/".xmlns:xsd="ht tp://www.w3.org/2001/XMLSchema".xmln s:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap env:Body><getUS StatesResponse. xmlns="http://service.externa l.xxx.xxxsystem s.com"><getUSSt atesReturn>Alab ama</getUSStatesRetu rn><getUSStates Return>Alaska</getUSStatesRetu rn><getUSStates Return>Alaska.a nd.the.Pacific. Area</getUSStatesRetu rn><getUSStates Return>American .Samoa</getUSStatesRetu rn><getUSStates Return>Arizona</getUSStatesRetu rn><getUSStates Return>Arkansas </getUSStatesRetu rn><getUSStates Return>Californ ia</getUSStatesRetu rn>
xsi:nil="true"/><workRequestFo rmatCode>16</workRequestForm atCode><workReq uestId>1687</workRequestId>< workRequestNumb er>0608-0001687</workRequestNumb er><workRequest OwnerId>2868</workRequestOwne rId><workReques tOwnerName>OC-Controls</workRequestOwne rName><workRequ estPriorityCode >75</workRequestPrio rityCode><workR equestStatus></workRequestStat us>
xsi:nil="true"/><workRequestSt atusCode>79</workRequestStat usCode><workReq uestTitle>New
Work Request</workRequestTitl e><workRequestT ype></workRequestType >
xsi:nil="true"/><workRequestTy peCode>116</workRequestType Code><workReque stpriority></workRequestprio rity>
xsi:nil="true"/></createWorkReque stReturn></createWorkReque stResponse></soapenv:Body></soapenv:Envelop e>

ITEM FOUR WorkRequestStat usResponse

<?xml.version=" 1.0".encoding=" utf-8"?><soapenv:En velope.xmlns:so apenv="http://schemas.xmlsoap .org/soap/envelope/".xmlns:xsd="ht tp://www.w3.org/2001/XMLSchema".xmln s:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body >
<getWorkRequest StatusResponse. xmlns="http://service.externa l.xxx.xxxsystem s.com">
<getWorkRequest StatusReturn>
<closeOutDate ></closeOutDate>
<closeOutTxt> </closeOutTxt>
<createDate>0 8/17/2006</createDate>
<dueDate>07/17/2007</dueDate>
<principalConta ctGroupId>4939</principalContac tGroupId>
<principalConta ctGroupName>DCD ISP-OHA-Controls</principalContac tGroupName>
<principalConta ctId>4635</principalContac tId>
<principalConta ctName>Adolph.R amirez</principalContac tName>
<receivedDate>0 7/17/2006</receivedDate>
<restrictedSw>Y </restrictedSw>
<subjectCategor yCode>1</subjectCategory Code>
<subjectCategor yDesc>800.Numbe r</subjectCategory Desc>
<subjectIdentif ierCode>1</subjectIdentifi erCode>
<subjectIdentif ierDesc>General </subjectIdentifi erDesc>
<workRequestDes cription>This.i s.a.new.work.re quest</workRequestDesc ription>
<workRequestFor mat>E-ail</workRequestForm at>
<workRequestFor matCode>16</workRequestForm atCode>
<workRequestId> 992</workRequestId>
<workRequestNum ber>0608-000992</workRequestNumb er>
<workRequestOwn erId>4939</workRequestOwne rId>
<workRequestOwn erName>DCDISP-OHA-ontrols</workRequestOwne rName>
<workRequestPri orityCode>75</workRequestPrio rityCode>
<workRequestSta tus>Open</workRequestStat us>
<workRequestSta tusCode>79</workRequestStat usCode>
<workRequestTit le>New.Work.Req uest</workRequestTitl e>
<workRequestTyp e>Agreement</workRequestType >
<workRequestTyp eCode>116</workRequestType Code>
<workRequestpri ority>5-ay</workRequestprio rity>
</getWorkRequestS tatusReturn></getWorkRequestS tatusResponse>
</soapenv:Body></soapenv:Envelop e>

Aug 17 '06 #6
Try either changing the return:
XmlElementAttri bute("getWorkRe questStatusResp onse") 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 getWorkRequestS tatus, 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:
XmlElementAttri bute("getWorkRe questStatusResp onse") 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****@discuss ions.microsoft. comwrote in message
news:CF******** *************** ***********@mic rosoft.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 getWorkRequestS tatus, 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 [DebuggerStepThr ough] 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.go v/axis/externalInterfa ce:WorkRequestT O' 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="getWorkRe questStatusRetu rn"
type="tns2:Work RequestStatusTO " />
</xsd:sequence>

Thanks,

David

"John Saunders" wrote:
"David R" <Da****@discuss ions.microsoft. comwrote in message
news:CF******** *************** ***********@mic rosoft.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 getWorkRequestS tatus, 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 [DebuggerStepThr ough] attribute on that method?

John
Aug 18 '06 #10

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

Similar topics

1
3253
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 haven't found any. I have created the service in C#, here is the code: HttpSoapContext.RequestContext.Path.MustUnderstand = false;
1
10237
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 a simple service for testing purposes (1 string IN, 1 string OUT) and I've found where the exception occures but not why. But I've exhausted my...
1
2139
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 communicate with Axis without any problems. Now I want to use my Web Service on a windows CE pocket pc but the problem is that .Net don't create a...
0
1622
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#) for the same..For that I did the following thing I added a web reference for the service thru "Add Web Reference", It got added successfully, But...
2
4238
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 its web reference. It complains that datatype 'String' is undefined. Strangely, the WSDL returned by the WS to a browser is quite different to...
5
4148
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 session id received from the Service request on subsequent requests to the service. However the Axis Web service does not process the SOAP header...
3
3135
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 proxy class was auto-generated by Visual Studio from WSDL provided by people who provide the Axis service, and I have not modified it (except to add...
0
2367
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 provide webservices for access via SOAP. As I understand it (ie not very well!) Axis works to accept these SOAP messages from the client and transform...
0
2430
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 org/apache/axis The following is what i need to do but am unable to do ...
0
7886
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7809
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7920
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8183
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5685
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.