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
============================================================
============
==============
// Call operation
try
{
if (input != null && output != null)
{
// Request Response Operation
if (operation.executeRequestResponseOperation(in_msg,
out_msg, flt_msg))
{
Object obj;
obj =
out_msg.getObjectPart(get_part_name(_op_name, _port_name,
false));
xml_to_return = 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 = "";
itr = flt_msg.getParts();
while (itr.hasNext())
{
fault_string += itr.next().toString();
} // while (itr.hasNext())
log.debug(fault_string + "rn" +
flt_msg.toString());
throw new CwsException("Webservice call returned
unscuscusfully: " + fault_string);
} // else
} // if (input != null && output != null)
else if (input != null)
{
// Request only operation
try
{
operation.executeInputOnlyOperation(in_msg);
} // try
catch (NullPointerException ex)
{
log.warn("NullPointerException"/*,ex*/);
} // catch (NullPointerException ex)
} // else if (input != 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)
============================================================
============
==============
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:
MyDetails: failed
consoleNotification test Soap Fault
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaul
tBuilder.jav
a:135)
at
org.apache.axis.encoding.DeserializationContextImpl.endEleme
nt(Deseriali
zationContextImpl.java:942)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unkno
wn Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndEleme
nt(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme
ntContentDis
patcher.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo
cument(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(De
serializatio
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_Apac
heAxis.invok
eAXISMessaging(WSIFOperation_ApacheAxis.java:1841)
at
org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_Apac
heAxis.invok
eRequestResponseOperation(WSIFOperation_ApacheAxis.java:1460
)
at
org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_Apac
heAxis.execu
teRequestResponseOperation(WSIFOperation_ApacheAxis.java:103
5)
at
fums.ws.cm.consumer.CallWebService.invoke_method(CallWebServ
ice.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(fals
e)
14:38:03 DEBUG [main] EXIT
WSIFOperation_ApacheAxis.executeRequestResponseOperation(fal
se)
14:38:03 DEBUG [main] ENTRY
WSIFDefaultMessage.getParts<d6c16c>()
14:38:03 DEBUG [main] EXIT
WSIFDefaultMessage.getParts(java.util.HashMap$ValueIterator<
img src="/img/at.gif" align="middle" border="0"
alt="">d0af9b)
14:38:03 DEBUG [main]
org.apache.wsif.base.WSIFDefaultMessage d6c16c
name:null parts:size(0)
fums.ws.cm.consumer.exception.CwsException: Webservice call
returned
unscuscusfully:
at
fums.ws.cm.consumer.CallWebService.invoke_method(CallWebServ
ice.java:318
)
at
fums.ws.cm.test.WsifTestClient.main(WsifTestClient.java:88)
============================================================
============
==============
The SOAP fault details,
AxisFault
faultCode: {http://fums.ws/}Soap_Fault
faultString: consoleNotification test Soap Fault
faultActor:
{fums.ws}ConsoleNotificationService_PortTypeImpl
faultDetail:
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).
Any sugestions on the matter would be much appreciated.
Mike Hardman
GE
Aviation
Digital Systems
Information Systems (Southampton)
Software Engineer, R&TD
T: +44 (0)23 8024 2000
F: +44 (0)23 8024 2001
D: +44 (0)23 8024 2027
E: Michael.Hardman smiths-aerospace.com
www.ge.com/aviation
School Lane, Chandlers Ford
Eastleigh, Hampshire, SO53 4YG, UK
GE Aviation is the business name for Smiths Aerospace
Limited
************************************************
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.
************************************************
------------------------------------------------------------
---------
To unsubscribe, e-mail: wsif-user-unsubscribe ws.apache.org
For additional commands, e-mail: wsif-user-help ws.apache.org
|