on 08-04-2009 2:36 PM
Hi Experts,</br>
here's a PI 7.1 Adapter Module Development issue I hope you can help me to resolve. It's about identifying SOAP fault messages.</br>
</br>
Scenario at a glance:</br>
Adapter Modules placed in the modules chain at request and response time in a synchronous Scenario:</br>
- Request: SOAP Axis to RFC </br>
- Response and Fault Response: RFC to SOAP Axis</br>
</br>
The issue is how to identify SOAP fault message in SOAP Axis Adapter Module in the response message:</br>
The client gets SOAP fault messages like the follwong one:</br>
<SOAP:Body>
<SOAP:Fault>
<faultcode>SOAP:Server</faultcode>
<faultstring>Server Error</faultstring>
<detail>
<ns1:exception xmlns:ns1="http://typen.geschaeftsstelle.pab.barmer.de">
<ns1:errortext>bla bla bla ...</ns1:errortext>
</ns1:exception>
</detail>
</SOAP:Fault>
</SOAP:Body>
</br>
</br>
But when trying to access the tags faultcode and/or faultstring in the adapter module via xPath expressions I do not get them. Obviously the SOAP Fault tags are built AFTER the adapter module has been passed. So my question is:</br>
How can I clearly/uniquely detect a SOAP fault response message (and distinguish it from a "normal" response message) in my SOAP Axis Adapter Module?</br>
</br>
I tried it the following way:</br>
</br>
// -
</br>
// Check Message Payload for SOAP Fault Message via xPath expressions</br>
...</br>
// SOAP Fault Code</br>
zv_xPression = zc_constXPattern.replaceFirst("&", "faultcode");</br>
zv_soapFaultCode = XPathAPI.eval(zv_doc, (String) zv_xPression).toString();</br>
// SOAP Fault String</br>
zv_xPression = zc_constXPattern.replaceFirst("&", "faultstring");</br>
zv_soapFaultString = XPathAPI.eval(zv_doc, (String) zv_xPression).toString();</br>
// check for SOAP Fault Message</br>
if (zv_soapFaultCode.equals("") && zv_soapFaultString.equals("")) {</br>
// Create Audit Log entry - NOT a SOAP Fault Message</br>
zv_msgText = zc_constModuleName + " 0190: xPath - OK! This message is NOT a SOAP Fault Message";</br>
zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.SUCCESS, zv_msgText);</br>
zv_faultCheck = false;</br>
}</br>
else {</br>
...</br>
// Create Audit Log entry - SOAP Fault Message</br>
zv_msgText = zc_constModuleName </br>
+ " 0200: xPath - this message is a SOAP Fault Message. " </br>
+ " - Faultcode is: " + zv_soapFaultCode </br>
+ " - Faultstring is: " + zv_soapFaultString; </br>
zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.ERROR, zv_msgText);</br>
...</br>
}</br>
...</br>
</br></br>
But zv_soapFaultCode and zv_soapFaultString are always empty (with other payload tags this coding works fine).</br>
</br>
Any ideas? </br></br>
Thanx very much in advance!</br></br>
Regards,</br>
Volker
In the end I diid with MessageClass.
Regards,
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Volker,
I need to do a very similar thing. Would you mind sharing your solution with a rough copy-paste here in this thread or in the wiki/code gallery?
I'd really appreciate that.
No suprise noboby helped you: it's realy a cuttin'-edge topic. Any XI/PI guy seems to be quite scared by the SOAP Fault monster!
Anyway, I'm dealing with Axis, trying to build an axis handler to hijack the soap fault into a soap response (for which reason I am rewriting the HTTPSender in order to bypass the HTTP 500, and having it not throwing an exception, but handling it as if it was a non-faulty situation), but I have a problem (see last post).
Any help/suggestion is much appreciated.
Cheers,
Alex
Hi Alex!
Like already mentioned I solved my problem by identifying the SOAP exception with the messageClass attribute of the PI message header. Acess code:
try {
String zv_msgClass = zv_piMsg.getMessageClass().toString();
} catch (Exception e) {
zv_msgText = zc_constModuleName
+ " E0110: Message processing terminated."
+ " Reason: Error while getting MessageClass "
+ zv_dataSource
+ e;
// create trace and audit log entry (severity ERROR) for exception
zv_location.errorT(ZV_SIGNATURE, zv_msgText);
zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.ERROR, zv_msgText);
ModuleException me = new ModuleException(e);
zv_location.throwing(ZV_SIGNATURE, me);
e.printStackTrace();
throw me;
} // end of try-catch-block
But I do not think this will solve your problem. I am almost sure, that something in your Axis configuration is wrong/missing. If a handler cannot be instatiated then it really may be missing. Have a look at defaultTrace.trc. Maybe you will find more suitable information about the root cause of your problem. Also have a look at NWA under software components and/or application modules if you can find/see your modules.
But there is a general issue when trying to catch PI fault messages. If e.g. the requestor tries to login with wrong userid/pasword, then you will have no chance to catch this kind of error - at least as far as I know. Because in this very early stage of PI message processing no module is called.
One last question: Did you develop your own Adapter or just an adapter module? In the first case: Is your adapter started and healthy? Have a look at RWB -> communication channel monitoring.
Regards,
Volker
Hi!
In the meantime I tried to access MessageClass attrribute. At first sight it looks good: When MessageClass is "ApplicationError" it seems to be a fault message.
Question now is: Does this always come true and what is the difference to MessageClass "SystemError"?
Answers to this as well as other recommendations are still very welcome.
Thanx!
Regards,
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.