You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Upul Godage <up...@gmail.com> on 2008/02/01 02:46:16 UTC

Re: Getting FaultString from SOAP message on Client

You can get faultString etc. like in the catch block,

exception.getFaultString()

Upul

On Feb 1, 2008 3:38 AM, <Ju...@mincom.com> wrote:

> Hi,
>
> I am having some problems getting the FaultString out of the SOAP message
> returned to me from a service.
>
> I have generated my stubs using WSDL2Java from version 1.3 of Axis2.
>
> The following is the SOAP message returned :
>
>
> <soapenv:Envelope
>     xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <soapenv:Header/>
> <soapenv:Body>
>    <soapenv:Fault>
>       <faultcode  xmlns:p773="
> http://exception.enterpriseservice.mincom.com
> ">p773:EnterpriseServiceConnectionException</faultcode>
>      <faultstring><![CDATA[
> com.mincom.enterpriseservice.exception.EnterpriseServiceConnectionException:
> CTG9631E: Error occurred during interaction with CICS. Error
> Code=ECI_ERR_NO_CICS, error code: -3]]></faultstring>
>      <detail encodingStyle="">
>           <p773:EnterpriseServiceConnectionException xmlns:p773="
> http://exception.enterpriseservice.mincom.com">
>                 <p773:ellipseConnectionManagerLogonResultDTO
> xsi:nil="true"/>
>          </p773:EnterpriseServiceConnectionException>
>      </detail>
>     </soapenv:Fault>
> </soapenv:Body>
> </soapenv:Envelope>
>
> However, the stub throws an EnterpriseServiceConnectionException which
> contains a null ellipseConnectionManagerLogonResultDTO (which I guess makes
> sense from the result).
>
> I want to know if the faultstring is made available to the client stubs(as
> this is what holds the meaningful message in this case), and if so, how?
>
> Thanks
>
> Julie
>
> --
>
> This transmission is for the intended addressee only and is confidential
> information. If you have received this transmission in error, please notify
> the sender and delete the transmission. The contents of this e-mail are the
> opinion of the writer only and are not endorsed by the Mincom Group of
> companies unless expressly stated otherwise.
>
> --
>
>
>
>
>
>
>
>
>
>
>

JIRA solved for Axis2 1.4 release

Posted by Pär Malmqvist <pa...@hotmail.com>.
 
Hello!
 
In september 2007 I sent a JIRA about a problem with windows newline "\r\n" and unix/linux newline "\n".
https://issues.apache.org/jira/browse/WSCOMMONS-243
 
I was told to report to the WSCOMMONS project.
 
Does anyone here work with WSCOMMONS project and knows if the issue is about to be solved?
It would be nice if it is solved for the Axis2 1.4 release.
 
 
/Pär Malmqvist
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Re: Getting FaultString from SOAP message on Client

Posted by Ju...@mincom.com.
Hi Upul
Thanks very much for this.
It worked a treat.
You're right though, it does seem to be a complicated way to get the fault 
data
Regards
Julie





Sorry, You can get the last envelope like this. And traverse the 
OMElement. There should be better solutions.

org.apache.axiom.soap.SOAPEnvelope soap = 
stub._getServiceClient().getLastOperationContext().getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE 
).getEnvelope();

Upul


On Feb 1, 2008 7:42 AM, <Ju...@mincom.com> wrote:

Thanks for your feedback, however, the exception that is thrown is a 
EnterpriseServiceConnectionException Exception. This does not have a 
'getFaultString' method, it only has a 'getFaultMessage' which returns the 
null ellipseConnectionManagerLogonResultDTO. 

Does this mean that the EnterpriseServiceConnectionException has been 
defined incorrectly in the WSDL? 

Thanks 
Julie




You can get faultString etc. like in the catch block,

exception.getFaultString()

Upul

On Feb 1, 2008 3:38 AM, <Ju...@mincom.com> wrote: 
Hi, 
I am having some problems getting the FaultString out of the SOAP message 
returned to me from a service. 
I have generated my stubs using WSDL2Java from version 1.3 of Axis2. 
The following is the SOAP message returned : 

<soapenv:Envelope 
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
   xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soapenv:Header/> 
<soapenv:Body> 
  <soapenv:Fault> 
     <faultcode  xmlns:p773="http://exception.enterpriseservice.mincom.com
">p773:EnterpriseServiceConnectionException</faultcode> 
 
<faultstring><![CDATA[com.mincom.enterpriseservice.exception.EnterpriseServiceConnectionException: 
CTG9631E: Error occurred during interaction with CICS. Error 
Code=ECI_ERR_NO_CICS, error code: -3]]></faultstring> 
    <detail encodingStyle=""> 
         <p773:EnterpriseServiceConnectionException xmlns:p773="
http://exception.enterpriseservice.mincom.com"> 
               <p773:ellipseConnectionManagerLogonResultDTO 
xsi:nil="true"/> 
        </p773:EnterpriseServiceConnectionException> 
    </detail> 
   </soapenv:Fault> 
</soapenv:Body> 
</soapenv:Envelope> 
However, the stub throws an EnterpriseServiceConnectionException which 
contains a null ellipseConnectionManagerLogonResultDTO (which I guess 
makes sense from the result). 
I want to know if the faultstring is made available to the client stubs(as 
this is what holds the meaningful message in this case), and if so, how? 
Thanks 
Julie 
-- 
This transmission is for the intended addressee only and is confidential 
information. If you have received this transmission in error, please 
notify the sender and delete the transmission. The contents of this e-mail 
are the opinion of the writer only and are not endorsed by the Mincom 
Group of companies unless expressly stated otherwise. 
-- 
  
  
  
  
  


Re: Getting FaultString from SOAP message on Client

Posted by Upul Godage <up...@gmail.com>.
Sorry, You can get the last envelope like this. And traverse the OMElement.
There should be better solutions.

org.apache.axiom.soap.SOAPEnvelope soap =
stub._getServiceClient().getLastOperationContext().getMessageContext(
org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE ).getEnvelope();

Upul


On Feb 1, 2008 7:42 AM, <Ju...@mincom.com> wrote:

>
> Thanks for your feedback, however, the exception that is thrown is a
> EnterpriseServiceConnectionException Exception. This does not have a
> 'getFaultString' method, it only has a 'getFaultMessage' which returns the
> null ellipseConnectionManagerLogonResultDTO.
>
> Does this mean that the EnterpriseServiceConnectionException has been
> defined incorrectly in the WSDL?
>
> Thanks
> Julie
>
>
>
>
>
> You can get faultString etc. like in the catch block,
>
> exception.getFaultString()
>
> Upul
>
> On Feb 1, 2008 3:38 AM, <*J...@mincom.com>>
> wrote:
> Hi,
>
> I am having some problems getting the FaultString out of the SOAP message
> returned to me from a service.
>
> I have generated my stubs using WSDL2Java from version 1.3 of Axis2.
>
> The following is the SOAP message returned :
>
>
> <soapenv:Envelope
>    xmlns:soapenv="*http://schemas.xmlsoap.org/soap/envelope/*<http://schemas.xmlsoap.org/soap/envelope/>"
>
>    xmlns:soapenc="*http://schemas.xmlsoap.org/soap/encoding/*<http://schemas.xmlsoap.org/soap/encoding/>"
>
>    xmlns:xsd="*http://www.w3.org/2001/XMLSchema*<http://www.w3.org/2001/XMLSchema>"
>
>    xmlns:xsi="*http://www.w3.org/2001/XMLSchema-instance*<http://www.w3.org/2001/XMLSchema-instance>
> ">
> <soapenv:Header/>
> <soapenv:Body>
>   <soapenv:Fault>
>      <faultcode  xmlns:p773="*
> http://exception.enterpriseservice.mincom.com*<http://exception.enterpriseservice.mincom.com/>
> ">p773:EnterpriseServiceConnectionException</faultcode>
>     <faultstring><![CDATA[
> com.mincom.enterpriseservice.exception.EnterpriseServiceConnectionException:
> CTG9631E: Error occurred during interaction with CICS. Error
> Code=ECI_ERR_NO_CICS, error code: -3]]></faultstring>
>     <detail encodingStyle="">
>          <p773:EnterpriseServiceConnectionException xmlns:p773="*
> http://exception.enterpriseservice.mincom.com*<http://exception.enterpriseservice.mincom.com/>
> ">
>                <p773:ellipseConnectionManagerLogonResultDTO
> xsi:nil="true"/>
>         </p773:EnterpriseServiceConnectionException>
>     </detail>
>    </soapenv:Fault>
> </soapenv:Body>
> </soapenv:Envelope>
>
> However, the stub throws an EnterpriseServiceConnectionException which
> contains a null ellipseConnectionManagerLogonResultDTO (which I guess makes
> sense from the result).
>
> I want to know if the faultstring is made available to the client stubs(as
> this is what holds the meaningful message in this case), and if so, how?
>
> Thanks
>
> Julie
>
> --
>
> This transmission is for the intended addressee only and is confidential
> information. If you have received this transmission in error, please notify
> the sender and delete the transmission. The contents of this e-mail are the
> opinion of the writer only and are not endorsed by the Mincom Group of
> companies unless expressly stated otherwise.
>
> --
>
>
>
>
>
>
>
>
>
>
>
>

Re: Getting FaultString from SOAP message on Client

Posted by Ju...@mincom.com.
Thanks for your feedback, however, the exception that is thrown is a 
EnterpriseServiceConnectionException Exception. This does not have a 
'getFaultString' method, it only has a 'getFaultMessage' which returns the 
null ellipseConnectionManagerLogonResultDTO.

Does this mean that the EnterpriseServiceConnectionException has been 
defined incorrectly in the WSDL?

Thanks
Julie





You can get faultString etc. like in the catch block,

exception.getFaultString()

Upul

On Feb 1, 2008 3:38 AM, <Ju...@mincom.com> wrote:
Hi, 
I am having some problems getting the FaultString out of the SOAP message 
returned to me from a service. 
I have generated my stubs using WSDL2Java from version 1.3 of Axis2. 
The following is the SOAP message returned : 

<soapenv:Envelope 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soapenv:Header/> 
<soapenv:Body> 
   <soapenv:Fault> 
      <faultcode  xmlns:p773="
http://exception.enterpriseservice.mincom.com
">p773:EnterpriseServiceConnectionException</faultcode> 
 
<faultstring><![CDATA[com.mincom.enterpriseservice.exception.EnterpriseServiceConnectionException: 
CTG9631E: Error occurred during interaction with CICS. Error 
Code=ECI_ERR_NO_CICS, error code: -3]]></faultstring> 
     <detail encodingStyle=""> 
          <p773:EnterpriseServiceConnectionException xmlns:p773="
http://exception.enterpriseservice.mincom.com"> 
                <p773:ellipseConnectionManagerLogonResultDTO 
xsi:nil="true"/> 
         </p773:EnterpriseServiceConnectionException> 
     </detail> 
    </soapenv:Fault> 
</soapenv:Body> 
</soapenv:Envelope> 
However, the stub throws an EnterpriseServiceConnectionException which 
contains a null ellipseConnectionManagerLogonResultDTO (which I guess 
makes sense from the result). 
I want to know if the faultstring is made available to the client stubs(as 
this is what holds the meaningful message in this case), and if so, how? 
Thanks 
Julie 
-- 
This transmission is for the intended addressee only and is confidential 
information. If you have received this transmission in error, please 
notify the sender and delete the transmission. The contents of this e-mail 
are the opinion of the writer only and are not endorsed by the Mincom 
Group of companies unless expressly stated otherwise.
--