SOAP Faults
"Hardman, Michael (AELE)" <Michael.Hardman-2Fe89vIlZKfypK0nipIKp1aTQe2KTcn/@public.gmane.org> Tue, 7 Aug 2007 08:01:33 -0600
| Newsgroups | gmane.comp.apache.webservices.wsif.user |
|---|---|
| Message-ID | <7E926DB0A5268842956DBDB68C343B41D2D4F8@cossmgmbx08.EMAIL.CORP.TLD> |
I am having an issue with my WSIF Invoker. I am currently trying to test
the handling of SOAP faults. I have setup a WS that returns a SOAP fault
when fed with specific arguments. The call to the WS returns
unsucesfully (as expected) but no data is populated in the Fault Message
returned.
I am using WSIF 2.1 rc 2, and Axis 1.0, I populate the outgoing message
with XML fragments, and then extract the XML return message.
The following is the code used to perform the actual call=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Call operation
try
{
if (input !=3D null && output !=3D null)
{
// Request Response Operation
if (operation.executeRequestResponseOperation(in_msg,
out_msg, flt_msg))
{
Object obj;
obj =3D
out_msg.getObjectPart(get_part_name(_op_name, _port_name, false));
xml_to_return =3D Xml.get_xml_string((Element)
obj);
} // if
(operation.executeRequestResponseOperation(in_msg, out_msg, flt_msg))
else
{
// fault message should be populated with error
String fault_string;
Iterator<?> itr;
fault_string =3D "";
itr =3D flt_msg.getParts();
while (itr.hasNext())
{
fault_string +=3D itr.next().toString();
} // while (itr.hasNext())
log.debug(fault_string + "\r\n" +
flt_msg.toString());
throw new CwsException("Webservice call returned
unscuscusfully: " + fault_string);
} // else
} // if (input !=3D null && output !=3D null)=20
else if (input !=3D null)
{
// Request only operation
try
{
operation.executeInputOnlyOperation(in_msg);
} // try
catch (NullPointerException ex)
{
log.warn("NullPointerException"/*,ex*/);
} // catch (NullPointerException ex)
} // else if (input !=3D null)
} // try
catch (WSIFException ex)
{
log.error("public String
invoke_method(String,String,cwsProtocol,String)");
throw new CwsException("Webservice call encountered an
excpetion", ex);
} // catch (RuntimeException ex)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This produces the following log:
14:38:03 DEBUG [main] EVENT
WSIFOperation_ApacheAxis.invokeAXISMessaging<d80be3> Invoking AXIS
callorg.apache.axis.client.Call@6ac461[Lja
va.lang.Object;@128f6ee
14:38:03 DEBUG [main] EXCEPTION
AxisFault
faultCode: {http://fums.ws/}Soap_Fault
faultString: consoleNotification test Soap Fault
faultActor: {fums.ws}ConsoleNotificationService_PortTypeImpl
faultDetail:=20
MyDetails: failed
consoleNotification test Soap Fault
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
a:135)
at
org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseriali
zationContextImpl.java:942)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at
org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializatio
nContextImpl.java:232)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:546)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:377)
at org.apache.axis.client.Call.invokeEngine(Call.java:2132)
at org.apache.axis.client.Call.invoke(Call.java:2102)
at org.apache.axis.client.Call.invoke(Call.java:1296)
at
org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.invok
eAXISMessaging(WSIFOperation_ApacheAxis.java:1841)
at
org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.invok
eRequestResponseOperation(WSIFOperation_ApacheAxis.java:1460)
at
org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.execu
teRequestResponseOperation(WSIFOperation_ApacheAxis.java:1035)
at
fums.ws.cm.consumer.CallWebService.invoke_method(CallWebService.java:299
)
at fums.ws.cm.test.WsifTestClient.main(WsifTestClient.java:88)
14:38:03 DEBUG [main] EVENT
WSIFOperation_ApacheAxis.invokeAXISMessaging<d80be3> Returned from AXIS
invoke, response: consoleNotification
test Soap Fault
14:38:03 DEBUG [main] EXIT
WSIFOperation_ApacheAxis.invokeRequestResponseOperation(false)
14:38:03 DEBUG [main] EXIT
WSIFOperation_ApacheAxis.executeRequestResponseOperation(false)
14:38:03 DEBUG [main] ENTRY WSIFDefaultMessage.getParts<d6c16c>()
14:38:03 DEBUG [main] EXIT
WSIFDefaultMessage.getParts(java.util.HashMap$ValueIterator@d0af9b)
14:38:03 DEBUG [main]=20
org.apache.wsif.base.WSIFDefaultMessage@d6c16c name:null parts:size(0)
fums.ws.cm.consumer.exception.CwsException: Webservice call returned
unscuscusfully:=20
at
fums.ws.cm.consumer.CallWebService.invoke_method(CallWebService.java:318
)
at fums.ws.cm.test.WsifTestClient.main(WsifTestClient.java:88)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
The SOAP fault details,
AxisFault
faultCode: {http://fums.ws/}Soap_Fault
faultString: consoleNotification test Soap Fault
faultActor: {fums.ws}ConsoleNotificationService_PortTypeImpl
faultDetail:=20
MyDetails: failed
are correct for what my WS is sending but this info is not getting back
to the calller.
I have seen some reports of problems due to AxisFault being unable to
deserialize, but have not been able to figure a workaround to this (if
that is the problem).=20
Any sugestions on the matter would be much appreciated.
Mike Hardman
GE
Aviation
Digital Systems
Information Systems (Southampton)
Software Engineer, R&TD
=20
T: +44 (0)23 8024 2000
F: +44 (0)23 8024 2001
D: +44 (0)23 8024 2027
E: Michael.Hardman-2Fe89vIlZKfypK0nipIKp1aTQe2KTcn/@public.gmane.org
www.ge.com/aviation
=20
School Lane, Chandlers Ford
Eastleigh, Hampshire, SO53 4YG, UK
GE Aviation is the business name for Smiths Aerospace Limited=20
=20
************************************************
The information contained in, or attached to, this e-mail, may contain=
confidential information and is intended solely for the use of the=
individual or entity to whom they are addressed and may be subject to=
legal privilege. If you have received this e-mail in error you should=
notify the sender immediately by reply e-mail, delete the message from=
your system and notify your system manager. Please do not copy it for any=
purpose, or disclose its contents to any other person. The views or=
opinions presented in this e-mail are solely those of the author and do=
not necessarily represent those of the company. The recipient should=
check this e-mail and any attachments for the presence of viruses. The=
company accepts no liability for any damage caused, directly or=
indirectly, by any virus transmitted in this email.
************************************************