axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Amat <juan.a...@alcatel.com>
Subject Fault handling and misc questions
Date Fri, 29 Sep 2006 20:45:53 GMT
Hi all,

I have been playing (read evaluating) with AXIS C++ 1.6 and I have seen,
what seems to me, incorrect SOAP messages when  a  'user defined' 
exception is
thrown.
(I was first using the official 1.6b version but there was more issues 
so I took
a snapshot from 09/20/06. OS is Solaris 10)

Here is such a message:

<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>AxisC++ Faultcode</faultcode>
<faultstring>Custom Out of bound exception</faultstring>
<faultactor>server name:listen port</faultactor>
<detail><fault xmlns:ns1="AMSMib.xsd  "><ns1:code>2</ns1:code>
<ns1:reason>Obj Not found</ns1:reason>
</fault>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

In my wsdl file the fault message is defined as:

   <wsdl:message name="fault">
       <wsdl:part name="body" element="ams:Fault"/>
   </wsdl:message>

So for me this part of the SOAP message contains 3 errors:
<fault xmlns:ns1="AMSMib.xsd  ">
1) 'fault' should be 'Fault'
2) the namespace is missing, ie, it should be ns1:Fault (and maybe this
error is a consequence of the first one)
3) extra space characters are inserted in the name space.

What makes me say that this is incorrect, is that the same fault with 
AXIS Java is:
<soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring></faultstring>
<detail>
<ns1:Fault xmlns:ns1="AMSMib.xsd"><ns1:code>2</ns1:code>
<ns1:reason>Obj Not found</ns1:reason>
</ns1:Fault>
<ns2:exceptionName 
xmlns:ns2="http://xml.apache.org/axis/">ams.ws.Fault_T</ns2:exceptionName>
<ns3:hostname 
xmlns:ns3="http://xml.apache.org/axis/">sol-jamat</ns3:hostname>
</detail>
</soapenv:Fault>

Am I missing something ? Is is a known issue ? And if so, is there a 
workaround ?

This was the 'fault handling' part. Now the 'misc questions'.
- I have noticed that AXIS C++ (server side) is perfectly happy if all the
parameters needed to call my service can be retrieved from the SOAP 
message, even
if the SOAP message is not a valid XML message. To make it more clear, 
if I send
a SOAP message without the closing tags for the 'Body' or 'Envelope', I 
do get a
proper response from my service.
Is this behavior a 'feature' or a 'bug' ?
- Is there a way to have an 'handler' called when my service throws an 
error ?
I mean something similar to the responseFlow (my objectives is to log 
all the
requests/responses/fault).
- has anybody successfully used the SoapDeSerializer::getBodyAsChar() 
method ?
Same question with SoapDeSerializer::setNewSoapBody(). (i do have some 
doubts about
this one after looking at the code as the 'DeSerializerMemBufInputStream 
stream', that
is fed to the parser, is a local variable that will be destroyed when 
the method returns)

Thank you,
Juan

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Mime
View raw message