Author |
Message
|
mqxplorer |
Posted: Wed Aug 04, 2010 7:04 am Post subject: When does a message go to SOAPInput Failure terminal? |
|
|
 Master
Joined: 22 Jun 2009 Posts: 206
|
"When does a message go to SOAPInput Failure terminal? " ----
Send failures during inbound SOAP processing to Failure terminal. This property type is Boolean. If this property is selected, in a situation during inbound SOAP processing that results in a SOAP fault, instead of immediately sending the SOAP fault back to the client, the fault is sent to the Failure terminal instead, to allow logging and recovery processing. In this situation, an exception list is sent to the Failure terminal with the inbound message as a BLOB. By default, this check box is cleared.
Inbound processing failure - I have not understood the exact meaning of this sentence. Does it mean any validation failures..??? If so..if SOAPInput nodes recieves any invalid message, it propagates the message to Failure terminal provided that the "Send failures during inbound SOAP processing to Failure terminal" property is selected on the Error Handling tab of the SOAPInput node. I am testing this scenario with a simple demo flow. When I am sending the below invalid SOAP message and I am expecting it to be propgated to Failure terminal, however, it is propagated to the 'Out' terminal and createing the SOAP parsing exceptions..saying that "problem creating SOAP tree from bitstream" I am losing the original request message..
This is the message I am sending..
Quote: |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dem="http://verify.wsrr.ibm.com/DemoCustomerSchemaV1">
<soapenv:Header/>
<soapenv:Body>
<dem:updateCustomer>
<str>Momoko</str>
</dem:updateCustomer
</soapenv:Body>
</soapenv:Envelope> |
Can someone clarify me when does a SOAPInput node propagate the message to its Failure terminal...? How to make sure that the orginal request message is not lost in case of validation failure and the message is still propagated to the 'Out' terminal with "problem creating SOAP tree from bitstream" error message?
Thanks in advance... |
|
Back to top |
|
 |
mqxplorer |
Posted: Wed Aug 11, 2010 10:04 am Post subject: |
|
|
 Master
Joined: 22 Jun 2009 Posts: 206
|
No one has answered my question.. Is my question itself wrong? Please help me in understanding this concept.
Thanks
mqxplorer |
|
Back to top |
|
 |
mgk |
Posted: Wed Aug 11, 2010 1:37 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
There are two reasons a message goes to the Failure terminal.
1: it fails SOAP Processing (WS-A, Must-Understand Header not understood, WS-Addressing problems, etc) and the "Send failures during inbound SOAP processing to Failure terminal" option is checked. This option allows you to intercept and process (log, etc) to SOAPFault that would otherwise be sent back immediately before the message even amkes the flow
2: it fails xml schema validation. This is only done after the message has passed 1: and the options to validate on teh node are selected.
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
mqxplorer |
Posted: Thu Aug 12, 2010 10:22 am Post subject: |
|
|
 Master
Joined: 22 Jun 2009 Posts: 206
|
Quote: |
1: it fails SOAP Processing (WS-A, Must-Understand Header not understood, WS-Addressing problems, etc) and the "Send failures during inbound SOAP processing to Failure terminal" option is checked.
2: it fails xml schema validation. This is only done after the message has passed 1: and the options to validate on teh node are selected.
|
Below is the message I am using to create the scenario to propagate the message to Failure terminal:
Code: |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dem="http://verify.wsrr.ibm.com/DemoCustomerSchemaV1">
<soapenv:Header/>
<soapenv:Body>
<dem:updateCustomer>
<str>Momoko</str>
</dem:updateCustomer
</soapenv:Body>
</soapenv:Envelope> |
It does not contain a soap header and I have selected the "Send failures during inbound SOAP processing to Failure terminal" check box.
This means that the message satisfies the first condition. Now it should check for the second condition. As the message is an invaild message it should go to Failure terminal as validation is set to "Content and value" on the node. However, the message is not going to failure terminal. It is propagated to 'Out' terminal and createing the SOAP parsing exceptions..saying that "problem creating SOAP tree from bitstream" I am losing the original request message.. I do not understand why it is not propagated to Failure terminal....
Any help will be appreciated..
Thanks in advance... |
|
Back to top |
|
 |
mgk |
Posted: Thu Aug 12, 2010 12:52 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Is validation set to immediate? _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Aug 12, 2010 1:19 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
mgk said:
Quote: |
Is validation set to immediate? |
Just to avoid any confusion, the property name is 'Parse Timing', and it defaults to 'On demand' . In previous versions it was indeed called 'Validation timing' or something like that ( I can't remember when it changed ).
If you don't change it to 'Immediate' and your message flow does not reference anything under InputRoot.XMLNSC, then no parsing will occur and no schema validation will occur either. |
|
Back to top |
|
 |
mgk |
Posted: Thu Aug 12, 2010 2:16 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Or InputRoot.SOAP in this case as it is a SOAP node...
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
mqxplorer |
Posted: Fri Aug 13, 2010 5:10 am Post subject: |
|
|
 Master
Joined: 22 Jun 2009 Posts: 206
|
Kimbert and mgk,
Thanks for the info. Let me try with that option set and see how it goes..
Thanks
mqxplorer |
|
Back to top |
|
 |
mqxplorer |
Posted: Fri Aug 13, 2010 6:05 am Post subject: |
|
|
 Master
Joined: 22 Jun 2009 Posts: 206
|
When I set the 'Parse Timing' to Immediate and sent an invalid message, it is propagated to Failure terminal. However, I ran into other problems..
As per the documentation the below mention thing should happen:
Code: |
[b]Send failures during inbound SOAP processing to Failure terminal[/b]: This property type is Boolean. If this property is selected, in a situation during inbound SOAP processing that results in a SOAP fault, instead of immediately sending the SOAP fault back to the client, the fault is sent to the Failure terminal instead, to allow logging and recovery processing. In this situation, an exception list is sent to the Failure terminal with the inbound message as a BLOB. By default, this check box is cleared.
|
The exception list does not have the inbound message ...
Below is the exception list created after the message is propagated to Failure terminal.
Code: |
ExceptionList
ParserException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRootParser.cpp
Line:INTEGER:600
Function:CHARACTER:ImbRootParser::parseNextItem
Type:CHARACTER:ComIbmSOAPInputNode
Name:CHARACTER:DemoUpdateStudentFlow#FCMComposite_1_1
Label:CHARACTER:DemoUpdateStudentFlow.SOAP Input
Catalog:CHARACTER:BIPv610
Severity:INTEGER:2
Number:INTEGER:5902
Text:CHARACTER:Exception whilst parsing
Insert
Type:INTEGER:5
Text:CHARACTER:Root
Insert
Type:INTEGER:5
Text:CHARACTER:SOAP
Insert
Type:INTEGER:5
Text:CHARACTER:346c2100
ParserException
File:CHARACTER:F:\build\S610_P\src\WebServices\WSLibrary\ImbSOAPParser.cpp
Line:INTEGER:2000
Function:CHARACTER:ImbSOAPParser::createSoapShapedTree
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:3614
Text:CHARACTER:problem creating SOAP tree from bitstream
ParserException
File:CHARACTER:F:\build\S610_EP\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCParser.cpp
Line:INTEGER:980
Function:CHARACTER:ImbXMLNSCParser::parseLastChild
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:5009
Text:CHARACTER:XML Parsing Errors have occurred
ParserException
File:CHARACTER:F:\build\S610_EP\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCDocHandler.cpp
Line:INTEGER:629
Function:CHARACTER:ImbXMLNSCDocHandler::handleParseErrors
Type:CHARACTER:ComIbmSOAPInputNode
Name:CHARACTER:DemoUpdateStudentFlow#FCMComposite_1_1
Label:CHARACTER:DemoUpdateStudentFlow.SOAP Input
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:5025
Text:CHARACTER:A schema validation error has occurred while parsing the XML document
Insert
Type:INTEGER:2
Text:CHARACTER:5003
Insert
Type:INTEGER:2
Text:CHARACTER:2
Insert
Type:INTEGER:2
Text:CHARACTER:5
Insert
Type:INTEGER:2
Text:CHARACTER:4
Insert
Type:INTEGER:5
Text:CHARACTER:cvc-complex-type.2.3: The complex type of element "soapenv:Body" has a content type of 'element-only'. The element must not have a value.
Insert
Type:INTEGER:5
Text:CHARACTER:/XMLNSC/http://schemas.xmlsoap.org/soap/envelope/:Envelope/http://schemas.xmlsoap.org/soap/envelope/:Body |
It does not contain the inbound message as BLOB. This is actually the first problem..I have got another issue as well..
After the message is propagated to the Failure terminal, the logical structure created is in the order "Properties" and "SOAP" but it does not have a anything under 'SOAP'. I connected the Failure termianl to the SOAPReply node and SOAPReply node is thrwoing an exception as below:
Code: |
ExceptionList
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbDataFlowNode.cpp
Line:INTEGER:957
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmSOAPInputNode
Name:CHARACTER:DemoUpdateStudentFlow#FCMComposite_1_1
Label:CHARACTER:DemoUpdateStudentFlow.SOAP Input
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
RecoverableException
File:CHARACTER:F:\build\S610_P\src\WebServices\WSLibrary\ImbSOAPReplyNode.cpp
Line:INTEGER:921
Function:CHARACTER:ImbSOAPReplyNode::evaluate
Type:CHARACTER:ComIbmSOAPReplyNode
Name:CHARACTER:DemoUpdateStudentFlow#FCMComposite_1_3
Label:CHARACTER:DemoUpdateStudentFlow.SOAP Reply
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
ParserException
File:CHARACTER:F:\build\S610_P\src\WebServices\WSLibrary\ImbSOAPParser.cpp
Line:INTEGER:1231
Function:CHARACTER:ImbSOAPParser::refreshBitStreamFromElements
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:3605
Text:CHARACTER:SOAP tree cannot be serialized
ParserException
File:CHARACTER:F:\build\S610_P\src\WebServices\WSLibrary\ImbSOAPParser.cpp
Line:INTEGER:609
Function:CHARACTER:ImbSOAPParser::refreshBitStreamFromElements
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:3603
Text:CHARACTER:no SOAP.Body
Insert
Type:INTEGER:5
Text:CHARACTER:SOAP.Body |
Is there any other property I need to change so that the SOAPInput node behaves as expected..?
Thanks in advance..
Thanks
mqxplorer |
|
Back to top |
|
 |
mgk |
Posted: Fri Aug 13, 2010 8:04 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
The docs could be clearer here. There are two types of message that can go to the failure terminal, and these correspond to the two reasons I mentioned before. The first type of message (with the body as a blob) is generated if the message fails soap processing, and you are not seeing this here (because your message is a valid SOAP message) so the "Send failures during inbound SOAP processing to Failure terminal" does not apply and is not actually affecting the message going to the failure terminal. The second (a regular validation failure message) is generated if the message fails validation which is the type you are seeing. There is no way that I know of at present to get the inbound message as a BLOB in this case, so raise an enhancement request if you need this.
Also, with the validation exception, I believe you will have to build your own SOAP Fault reply message to send back to the original client.
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
mqxplorer |
Posted: Fri Aug 13, 2010 2:36 pm Post subject: |
|
|
 Master
Joined: 22 Jun 2009 Posts: 206
|
Quote: |
The docs could be clearer here
|
A lot of IBM docs/redbooks give high level picture not an in detail concept..I feel some of the docs as 'Author centered docs' rather than 'User Centered docs'.
Quote: |
The second (a regular validation failure message) is generated if the message fails validation which is the type you are seeing. There is no way that I know of at present to get the inbound message as a BLOB in this case, so raise an enhancement request if you need this. |
I would prefer to have the inbound message as BLOB. I will raise an enhancement requirement.
Quote: |
Also, with the validation exception, I believe you will have to build your own SOAP Fault reply message to send back to the original client.
|
Creating the SOAP Fault reply message: I can create it manually and send it back to the client, however, if the message fails due to the first condition you specified (1: it fails SOAP Processing (WS-A, Must-Understand Header not understood, WS-Addressing problems, etc) and the "Send failures during inbound SOAP processing to Failure terminal" option is checked. This option allows you to intercept and process (log, etc) to SOAPFault that would otherwise be sent back immediately before the message even amkes the flow), it is going to create the SOAP Fault automatically as below:
Code: |
(0x01000000:Folder):SOAP = ( ['SOAP' : 0xf005860]
(0x01000000:Folder):Context = ( ['xmlnsc' : 0xec2ddf0]
(0x03000100:Attribute ):operation = '' (CHARACTER)
(0x03000100:Attribute ):operationType = 'UNKNOWN' (CHARACTER)
(0x03000100:Attribute ):portType = 'DemoCustomerV1_0' (CHARACTER)
(0x03000100:Attribute ):portTypeNamespace = 'http://verify.wsrr.ibm.com/DemoCustomerV1' (CHARACTER)
(0x03000100:Attribute ):port = 'DemoCustomerServiceV1_0_DevPort' (CHARACTER)
(0x03000100:Attribute ):service = 'DemoCustomerServiceV1_0' (CHARACTER)
(0x03000100:Attribute ):fileName = 'C:\Documents and Settings\All Users\Application Data\IBM\MQSI/components/WBRK61_DEFAULT_BROKER/fb0c0e13-2901-0000-0080-b87363fa0d13/config/XSD/DemoCustomerMessageSet/com/ibm/wsrr/verify/democustomerv1/DemoCustomerServiceDevV1_0.wsdl' (CHARACTER)
(0x03000000:PCDataField):SOAP_Version = '1.1' (CHARACTER)
(0x01000000:Folder ):Namespace = (
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/' (CHARACTER)
)
(0x01000000:Folder ):_XmlDeclaration = (
(0x03000100:Attribute):Version = '1.0' (CHARACTER)
(0x03000100:Attribute):Encoding = 'UTF-8' (CHARACTER)
)
)
(0x01000000:Folder):Header =
(0x01000000:Folder):Body = ( ['xmlnsc' : 0xec2ddf0]
(0x01000000:Folder)http://schemas.xmlsoap.org/soap/envelope/:Fault = (
(0x03000000:PCDataField):faultcode = 'soapenv:Server' (CHARACTER)
(0x03000000:PCDataField):faultstring = 'javax.xml.stream.XMLStreamException: The namespace prefix "dem" was not declared.' (CHARACTER)
(0x01000000:Folder ):detail = (
(0x03000000:PCDataField):Exception = 'org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: The namespace prefix "dem" was not declared.
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.buildNext(SOAPBodyImpl.java:171)
at org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:141)
at org.apache.axiom.om.impl.llom.OMElementImpl.getFirstElement(OMElementImpl.java:972)
at com.ibm.broker.axis2.Axis2Invoker.invokeAxis2OverHTTP(Axis2Invoker.java:1999)
at com.ibm.broker.axis2.TomcatNodeRegistrationUtil.invokeAXIS2(TomcatNodeRegistrationUtil.java:421)
Caused by: javax.xml.stream.XMLStreamException: The namespace prefix "dem" was not declared.
at com.ibm.xml.xlxp.api.stax.msg.StAXMessageProvider.throwXMLStreamException(StAXMessageProvider.java:68)
at com.ibm.xml.xlxp.api.stax.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:535)
at com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl$XMLStreamReaderProxy.next(XMLInputFactoryImpl.java:173)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:506)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:161)
... 5 more
' (CHARACTER)
)
)
)
)
) |
In one case the SOAPFault message is automatically generated and in the other case, I have to generate it manually. Should I have to write the code in such a way that if the SOAP Fault message exists (automatically created), do not create it manually..and if it does not..create it manually...??
I wish the product handles both scenarios in a more efficient way.....
Thanks
mqxplorer |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Aug 13, 2010 11:22 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Quote: |
I wish the product handles both scenarios in a more efficient way..... |
Hmmm.
How about you put the whole lot inside a subflow that all SOAP flows could call.
Maybe, you could even wire it to the Catch Terminal, check the ExceptionList and send the SOAP fault back to the sender with some appropriate GIGO text.
Sorta like a common error handling scenario isn't it?
Hands up (those who read this post) who work on sites with this setup (or something very similar)? My guess is, the majority.
We use SOAP almost exclusively in my current job. Flow Coders never have to explicitly code a soap fault. Never. For a start if they did, they'd never get the code through the [my] Peer review process. Subflows are provided that do this very nicely thank you.
This way we can be sure that the structure of ALL SOAP messages are consistent. Some sending apps are very particular about the structure & content of the SOAP messages they receive (it does not stop a few from sending us badly formatted messages in the first place though).
My advice (or Vitor will come and give you a dose of his sharpend trout ) is to take a step back and think how this (admittedly awkwardness) could be simplified in the wider scheme of things. Do some more experimentation and look for commonality in the error conditions etc. A little time spent now wil save you a huge amount later on.
That said, my main gripe with the SOAP nodes is that they differ from the MQ nodes in their handing of 'stuff' on the failure terminal. We have a PMR open on this difference at the moment. MQ nodes (in a request reply) don't complian if the reply has already been sent when processing on the Catch terminal and then you throw again so that the failure terminal can handle the rollback. SOAP nodes do complain about the Identified already been used! _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqxplorer |
Posted: Mon Aug 16, 2010 6:05 am Post subject: |
|
|
 Master
Joined: 22 Jun 2009 Posts: 206
|
I am not sure if you have gone through all my post..I am experiencing a situation where the SOAP fault is created automatically when the SOAP processing exceptions occur which we are sending to the client and handing the exception list in the subflow attached. However, when message validation fails..I do not see an automatic SOAP Fault creation..My question is about this..why an automatic SOAPFaut creation in one scenario and why not in another scenario...?
Quote: |
Subflows are provided that do this very nicely thank you. |
I am talking about the sub flow only..not the main flow.. |
|
Back to top |
|
 |
mgk |
Posted: Mon Aug 16, 2010 6:27 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
You have not said why you are trying to do this, so it is worth pointing out that the broker by default will always send back the correct Fault to the client out of the box.
Therefore, depending on what you are trying to achieve you may have a few of options. One option is just to let the broker send back the faults automatically for you. In this case if you do not check the "Send failures during inbound SOAP processing to Failure terminal" and do not wire the Failure terminal on the Input node then all Faults will automatically be sent back to the client for you.
Another option is to split this and let the broker send back the fault generated if there is a SOAP processing problem by not checking the "Send failures during inbound SOAP processing to Failure terminal" box but handle the creating of a custom validation fault yourself down the Failure terminal and in this case you only have one type of message sent to the failure terminal. This is a good option if you are not actually going to do anything with the auto generated fault.
However, if you need to always create a custom Fault then today you will have to create the validation Fault yourself down the failure terminal, taking into account any auto-generated Fault that may be present...
I hope this helps,
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
mqxplorer |
Posted: Mon Aug 16, 2010 6:36 am Post subject: |
|
|
 Master
Joined: 22 Jun 2009 Posts: 206
|
Thanks mgk for the update and clarification...
I will go by your suggestion and see how it goes...
Thanks
mqxplorer |
|
Back to top |
|
 |
|