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

How to retrieve soap fault messages returned by AXIS server in .Net client

Hi,

I have a web service application that uses AXIS at the server side and
C# at the client side. the C# client code was generated using wsdl.exe.
When AXIS raised an exception, it sends the soap exception back to
client with HTTP 500 internal server error:

HTTP/1.1 500 Internal Server Error

Date: Wed, 14 Dec 2005 00:18:16 GMT

Content-Type: text/xml; charset=utf-8

Transfer-Encoding: chunked

01de
<?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>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>

<faultstring>com.foo.command.exception.DuplicateDa taException: License
is already in use</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>0000
When C# client code reads the reasponse, it raises a WebException and
stops reading the saop body, I wonder if there is anyway for me to read
the faultCode and faultString when such exception is raised.

Thanks

Paul

Dec 15 '05 #1
1 9824

You can use the WebException.Response property to get a stream and then read
from that. But that's not really a nice way to do it. Most likely there is a
smarter way!

If you skip the HTTP level classes and use SoapClient instead I think you
will get a proper exception with .FaultString properties etc.

rgrds,
martin

"Paul" wrote:
I have a web service application that uses AXIS at the server side and
C# at the client side. the C# client code was generated using wsdl.exe.
When AXIS raised an exception, it sends the soap exception back to
client with HTTP 500 internal server error:

HTTP/1.1 500 Internal Server Error

Date: Wed, 14 Dec 2005 00:18:16 GMT

Content-Type: text/xml; charset=utf-8

Transfer-Encoding: chunked

01de
<?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>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>

<faultstring>com.foo.command.exception.DuplicateDa taException: License
is already in use</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>0000
When C# client code reads the reasponse, it raises a WebException and
stops reading the saop body, I wonder if there is anyway for me to read
the faultCode and faultString when such exception is raised.

Thanks

Paul

Feb 14 '06 #2

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

Similar topics

2
by: Artur | last post by:
Hi Newsgroup, im currently working on programming a asp.net application consuming an Webservice hosted on Apache/Axis. I have generated WSDL and Proxy classes from VisualStudio.net. But when...
15
by: MR | last post by:
i need to develop a SOAP client, Since I have never personally done one I would like to make sure that I am going about it correctly. The client is a Windows (probably 2k3) application that...
3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
3
by: Moshe Kravchik | last post by:
Hi! We have a Web Service written in ATL Server and a client written in Java using Axis. When something goes wrong on the server side, it returns an HRESULT of the error which is translated into...
3
by: JRey | last post by:
Does .Net generate the classes for Faults when they are specified in the WSDL. I tried defining them and then generating a proxy, and it did not appear to do it. On the Java side it did generate...
0
by: GAURAV KRISHNA | last post by:
Hello, I'm trying to build a C# client to consume an AXIS Web Service (running SOAP over HTTP). The Web Service encodes full server-side exception traces in the Soap Fault > Detail element using...
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...
0
by: info | last post by:
Dear all, is the first time that I use SOAP, and i must say that i'm having several problems. this is SOAP message that expects the server =================XML EXPECTED FROM THE...
0
by: Default User | last post by:
I work on creating test cases for a SOAP-based set of servers, using soapUI. I received and updated set of WSDL and schema files, and when I made new tests and mock server operations, all of the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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,...

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.