ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAP Fault from SOAPInut node for invalid SOAP Message

Post new topic  Reply to topic
 SOAP Fault from SOAPInut node for invalid SOAP Message « View previous topic :: View next topic » 
Author Message
saurabh867
PostPosted: Wed Jun 21, 2017 5:14 am    Post subject: SOAP Fault from SOAPInut node for invalid SOAP Message Reply with quote

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.&lt;init>(StAXSOAPModelBuilder.java:154)
   at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.&lt;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
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 21, 2017 5:22 am    Post subject: Re: SOAP Fault from SOAPInut node for invalid SOAP Message Reply with quote

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
View user's profile Send private message
saurabh867
PostPosted: Wed Jun 21, 2017 5:31 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 21, 2017 5:40 am    Post subject: Reply with quote

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
View user's profile Send private message
saurabh867
PostPosted: Wed Jun 21, 2017 7:06 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 21, 2017 8:42 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
saurabh867
PostPosted: Wed Jun 21, 2017 11:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
saurabh867
PostPosted: Thu Jun 22, 2017 1:00 am    Post subject: Reply with quote

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
View user's profile Send private message
saurabh867
PostPosted: Fri Jun 23, 2017 3:05 am    Post subject: Reply with quote

Voyager

Joined: 13 Jun 2010
Posts: 78

Raised a PMR with IBM as looks like a bug in SOAPInput node. The error is somewhat related to APAR http://www-01.ibm.com/support/docview.wss?uid=swg1IT13662 that is targeted on 10.0.0.4 and we are using higher than that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAP Fault from SOAPInut node for invalid SOAP Message
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.