Author |
Message
|
saurabh867 |
Posted: Wed Jun 21, 2017 5:14 am Post subject: SOAP Fault from SOAPInut node for invalid SOAP Message |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Hi,
We are using SOAP Input node to receive web-service requests within IIB. I observed a case where incoming request is not well formed ( The name of Envelope is changed to Envelop), SOAPInput node throws a fault message but it does not populate right value under -
Code: |
<faultcode>soapenv:</faultcode>
|
This results in validation failure at SOAP-UI as the message is not complaint.
Request -
Code: |
<soapenv:Envelope1 xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:grid="http://www.thecoventry.co.uk/cbs/ns/grid">
<soapenv:Heade1r/>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelop1e> |
Response -
Code: |
soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:</faultcode>
<faultstring>First Element must contain the local name, Envelope , but found Envelope1</faultstring>
<detail>
<Exception>org.apache.axis2.AxisFault: Exception during creation of SOAP envelope
at com.ibm.broker.axis2.Axis2Invoker.invokeAxis2(Axis2Invoker.java:3000)
at com.ibm.broker.axis2.TomcatNodeRegistrationUtil.invokeAxis2(TomcatNodeRegistrationUtil.java:667)
at com.ibm.broker.axis2.TomcatNodeRegistrationUtil.invokeAxis2(TomcatNodeRegistrationUtil.java:613)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found Envelope1
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:305)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:252)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
at com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:2259)
at com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1959)
at com.ibm.broker.axis2.Axis2Invoker.invokeAxis2(Axis2Invoker.java:2996)
... 2 more</Exception>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope> |
Is this behavior expected ? Can we intercept the message before it is posted and update the value ? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 21, 2017 5:22 am Post subject: Re: SOAP Fault from SOAPInut node for invalid SOAP Message |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
saurabh867 wrote: |
Is this behavior expected ? |
For the soap node to throw an error when ti receives a bad soap message? Yes.
For the soap node to throw an error that doesn't look like the error returned from some other soap engine? Yes.
For the soap node to throw an error that doesn't contain information about a message it couldn't parse fully? yes.
saurabh867 wrote: |
Can we intercept the message before it is posted and update the value ? |
Sure.
But don't.
It's the job of the sender to produce a valid message. It's not your job - and it's a job of increasing trouble to even try, much less let applications get away with. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
saurabh867 |
Posted: Wed Jun 21, 2017 5:31 am Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
SOAP specification for 1.2 says the value of <soapenv:Value> must be from one of these values -
Code: |
<xs:simpleType name="faultcodeEnum">
<xs:restriction base="xs:QName">
<xs:enumeration value="tns:DataEncodingUnknown"/>
<xs:enumeration value="tns:MustUnderstand"/>
<xs:enumeration value="tns:Receiver"/>
<xs:enumeration value="tns:Sender"/>
<xs:enumeration value="tns:VersionMismatch"/>
</xs:restriction>
</xs:simpleType> |
but the value returned by SOAPInput node is -
Code: |
<soapenv:Value>Sender</soapenv:Value>
|
which fails validation in SOAPUI. It does not look right |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 21, 2017 5:40 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Are you sure you are asking IIB to use SOAP 1.2? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
saurabh867 |
Posted: Wed Jun 21, 2017 7:06 am Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
I thought the node supports both 1.1 and 1.2 as it does throw exceptions in 1.1 and 1.2 formats.
The only problem is the value of <faultcode> in 1.1 and <soapenv:Value> for 1.2 is not valid. Rest is fine. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 21, 2017 8:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
saurabh867 wrote: |
SOAP specification for 1.2 says the value of <soapenv:Value> must be from one of these values -
Code: |
<xs:simpleType name="faultcodeEnum">
<xs:restriction base="xs:QName">
<xs:enumeration value="tns:DataEncodingUnknown"/>
<xs:enumeration value="tns:MustUnderstand"/>
<xs:enumeration value="tns:Receiver"/>
<xs:enumeration value="tns:Sender"/>
<xs:enumeration value="tns:VersionMismatch"/>
</xs:restriction>
</xs:simpleType> |
but the value returned by SOAPInput node is -
Code: |
<soapenv:Value>Sender</soapenv:Value>
|
which fails validation in SOAPUI. It does not look right |
Is the sender missing to set the relevant namespace?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
saurabh867 |
Posted: Wed Jun 21, 2017 11:48 pm Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
Sender is sending an incorrect SOAP message ( Name of Envelope not correct). I have to wire the Failure terminal of SOAPInput Node at the moment and set the value so that the SOAP-Fault returned by Broker is valid.
However , I expected Broker to return a valid SOAP-Fault without any manual code. |
|
Back to top |
|
 |
saurabh867 |
Posted: Thu Jun 22, 2017 1:00 am Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
It seems SOAPInput node is throwing all sort of different behavior. One of the tests that we ran was to pass a message without any Body element and SOAPInput node threw null pointer exception and control never came out of any terminal -
Test message
Code: |
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
<soap:Header/>
</soap:Envelope> |
User Trace tells a null pointer exception
Code: |
2017-06-22 09:55:06.975173 10124 Error BIP2628W: Exception condition detected on input node 'test/*'.
The message flow node 'test/*' detected an error whilst processing a message. The message flow was rolled back and, if the message was being processed in a unit of work, it will remain on the input queue to be processed again. Following messages will indicate the cause of this exception.
Check the error messages which follow to determine why the exception was generated, and take action as described by those messages.
2017-06-22 09:55:06.975196 10124 RecoverableException BIP3748E: The SOAP Input node 'test/*' encountered an error while processing the inbound SOAP message.
An error occurred during inbound message processing.
See previous error messages to determine the cause of the error.
2017-06-22 09:55:06.975203 10124 RecoverableException BIP3701E: A Java exception was thrown whilst calling the Java JNI method ''TomcatNodeRegistrationUtil_invokeAxis2''. The Java exception was ''java.lang.NullPointerException''. The Java stack trace was ''Frame : 0 java.lang.NullPointerException: null
@: com.ibm.broker.axis2.Axis2Invoker.invokeAxis2(Axis2Invoker.java:3009)
@: com.ibm.broker.axis2.TomcatNodeRegistrationUtil.invokeAxis2(TomcatNodeRegistrationUtil.java:667)
@: com.ibm.broker.axis2.TomcatNodeRegistrationUtil.invokeAxis2(TomcatNodeRegistrationUtil.java:613)
''.
Correct the error, and if necessary redeploy the flow.
2017-06-22 09:55:06.975217 10124 UserTrace BIP11512E: Failed to read input data
Data arriving at the input node has caused a failure. If the flow is processing a message group, that group will be rolled back. Otherwise, this request will fail, but previous work in the batch will be committed.
2017-06-22 09:55:06.975229 10124 UserTrace BIP11302I: There are ''2'' parsers cached on this thread.
2017-06-22 09:55:06.975248 10124 UserTrace BIP11507W: Rolled back a local transaction. |
has someone experienced it before ? |
|
Back to top |
|
 |
saurabh867 |
Posted: Fri Jun 23, 2017 3:05 am Post subject: |
|
|
Voyager
Joined: 13 Jun 2010 Posts: 78
|
|
Back to top |
|
 |
|