By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,743 Members | 1,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,743 IT Pros & Developers. It's quick & easy.

Returning Soap Fault to Axis

P: n/a
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 the SoapFault. The problem is
that the SoapFault is interpreted by Axis not as a SoapFaultException, but
as a more generic AxisFault exception with all the info we put in the soap
fault lost.

Has anyone manage to get this to work? Please advice.

Thank you,
Moshe.
Nov 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Moshe,

Oh I seen this. The problem is that ATL expects noncompliant SOAP faults, it
puts them in the wrong namespace. We were using Axis as the server with ATL
as the client, so the problem was in reverse. I hacked ATLSOAP.H to fix
this, I'll try to find a fix for you but (a) it was a couple of years ago
and (b) as I mentioned it's the other way round client/server wise, but
might give you a start.

"Moshe Kravchik" <mkravchik_AT_NO_SPAM_hotmail.com> wrote in message
news:eW*************@TK2MSFTNGP09.phx.gbl...
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 the SoapFault. The problem
is
that the SoapFault is interpreted by Axis not as a SoapFaultException, but
as a more generic AxisFault exception with all the info we put in the soap
fault lost.

Has anyone manage to get this to work? Please advice.

Thank you,
Moshe.

Nov 23 '05 #2

P: n/a
From an old email in my archive:

"it became apparent that AXIS is not sending SOAP faults in the manner
required by the spec
(http://www.w3.org/2000/xp/Group/1/08...ml#faultcodes). This
requires that the fault codes be named in the SOAP envelope namespace. AXIS
sends the fault codes in the namespace of the service that generates the
SOAP response, and ATL does not recognize this. While ATL recognizes the
fact that a SOAP fault has occured, this precludes processing of detailed
error information. I have relaxed the constraint by modifying one of
Microsoft's supplied header files, ATLSOAP.H. I attach a copy of the
modified version (it's a two-line change). It may be that my AXIS
configuration is incorrect and that I can make AXIS produce the correct SOAP
given a bit of help."

I worked around it like this in CSoapFault::SerErrorCode in ATLSOAP.H:

// make sure the namespace of the fault is the
// SOAPENV namespace
if ((cchSoapPrefix != (int)(wszLocalName-wsz)) ||
(wcsncmp(wsz, wszSoapPrefix, cchSoapPrefix)))
{
// ST 13-DEC-2002: The APACHE server defines fault codes that are in the
namespace defined by the
// service, rather than in the SOAPENV namespace. This causes the default
ATL CSoapFault behaviour
// to fail and thus give little information about the error. For this reason
we relax the constraint
// here so that SOAP faults in other namespaces are also accepted.
#ifndef __ATL_ALLOW_NONCOMPLIANT_SOAPFAULT
ATLTRACE( _T("ATLSOAP: CSoapFault::SetErrorCode -- fault namespace is
incorrect.\r\n" ) );
return E_FAIL;
#endif
}

As I say, this is with the client/server the opposite way round to how you
have it, but it might point you in the right direction.
You may be able to modify CSoapFault in a similar manner to send out the
fault strings that the client is expecting.

S.

"Moshe Kravchik" <mkravchik_AT_NO_SPAM_hotmail.com> wrote in message
news:eW*************@TK2MSFTNGP09.phx.gbl...
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 the SoapFault. The problem
is
that the SoapFault is interpreted by Axis not as a SoapFaultException, but
as a more generic AxisFault exception with all the info we put in the soap
fault lost.

Has anyone manage to get this to work? Please advice.

Thank you,
Moshe.

Nov 23 '05 #3

P: n/a
To be clear, actually it's Axis that expects the faults in the wrong
namespace, not ATL.
Nov 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.