Author |
Message
|
cvag |
Posted: Wed Jun 22, 2011 4:24 am Post subject: Validation Failed |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hi,
I have a webservice scenario, of request response type.
HttpInput --> Compute( Construct Reponse) --> HttpReply
Created the messagedefinition file using wsdl (having Request and Response in the same).
Am parsing the SOAP message with XMLNSC domain and enabled the strict validation (Parse timing to 'Immediate' and Validation to 'Content and Value').
When i pass the Request messages (with valid and invalid) through nettool, the message is getting validated against the defintion and getting response back to the client successfully. But when i push the empty request message, still the message is flowing to the downstream nodes crossing HttpInput and getting the response back with empty values.
Could you please let me know, why the validation is not working in this case and correct me if i missed anything.
Thanks, |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 22, 2011 7:01 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
But when i push the empty request message, still the message is flowing to the downstream nodes crossing HttpInput and getting the response back with empty values. |
It may be possible to fix this by tightening up the rules in the xsd, but I need to see what the 'empty request message' looks like. Please can you quote the actual XML ( ideally using [c o d e] tags to keep it readable ). |
|
Back to top |
|
 |
cvag |
Posted: Wed Jun 22, 2011 12:16 pm Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Thanks Kimbert for your response,
Here "empty request message", what i mean is: am not sending any kind of xml message, just am hitting the service url [ SEND ] button on nettool using POST method.
There is no XML message sending, its a dummy.
In debug mode can able to view only the properties and Http Headers generating with no messageBody crossing the HttpInput, without generating any SOAP fault though validation enabled strictly at HttpInput.
Validation is getting overruled here for me,
Please suggest
Thanks. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 23, 2011 12:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
There is no XML message sending |
Well, SOAP is an XML-based protocol, so there should be *some* XML being sent - otherwise it is not a valid SOAP message.
It seems to me that you should be using the SOAPInput node, not the HttpInput node. Then you would probably get an error telling you that the request was not a valid SOAP message. |
|
Back to top |
|
 |
cvag |
Posted: Thu Jun 23, 2011 1:06 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Thanks Kimbert,
This works fine, when i replace HttpInput node with SOAPInput.
SOAPInput is looking for the structure, so when i put the null message(just click the url), its generating SOAP fault
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode></faultcode><faultstring>Invalid Content-Type HTTP Header. Content-Type was missing, malformed or null.</faultstring><detail><Exception>org.apache.axis2.AxisFault: Invalid Content-Type HTTP Header. Content-Type was missing, malformed or null.
 at com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1838)
 at com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1807)
 at com.ibm.broker.axis2.Axis2Invoker.processInboundRequest(Axis2Invoker.java:2230)
 at com.ibm.broker.axis2.Axis2Invoker.invokeAxis2OverHTTP(Axis2Invoker.java:1969)
 at com.ibm.broker.axis2.TomcatNodeRegistrationUtil.invokeAXIS2(TomcatNodeRegistrationUtil.java:302)
</Exception></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
If the same case with HttpInput, handling null message will fail in validating with WSDL definition.
Can you please suggest, is there any way to handle this scenario with HttpInput OR surely opt for SOAPInput?
Thanks, |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 23, 2011 1:12 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I'm just wondering why you want to use HttpInput, when SOAPInput is the natural choice, and seems to work better...? |
|
Back to top |
|
 |
cvag |
Posted: Thu Jun 23, 2011 1:13 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Could you please confirm, if that is the case i would change my requirement using SOAP nodes instead of Http, as Http fails in validating null requests with the message definition.
Thanks. |
|
Back to top |
|
 |
cvag |
Posted: Thu Jun 23, 2011 1:17 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
No Kimbert,
This is a project requirement, i can't change on of a sudden without having any analysis or doing any tests.
So according i can move ahead and suggest the alternate
Thanks for your valuable inputs. |
|
Back to top |
|
 |
bielesibub |
Posted: Thu Jun 23, 2011 4:56 am Post subject: |
|
|
 Apprentice
Joined: 02 Jul 2008 Posts: 40 Location: Hampshire, UK
|
Sorry to gatecrash... it's possibly relevant.. I'm using SOAPInput nodes with v7.0.0.2 with validation set to "content and value" and can't get the nodes to raise an exception when I pass in malformed messages..
For example I'm able to send in something like;
<ns:messageRequest>
<someDuffElement>blah<someDuffElement> <!-- Note the lack of slash -->
<ns:expectedElement>blah</ns:expectedElement>
</ns:messageRequest>
This pops into the message flow with a null SOAP element.. ? I'm pretty sure exceptions were being raised previously? Am I being a numpty? |
|
Back to top |
|
 |
cvag |
Posted: Thu Jun 23, 2011 5:54 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hi bielesibub,
Exception will not raise as null SOAP element, it raises Parser Exception: saying end tag not closed properly somewat like that.., and if would like to throw an exception at the Input node itself.. configure the Parse Timing option to either Immediate or Complete and validation as Content and Value.
Thanks |
|
Back to top |
|
 |
bielesibub |
Posted: Thu Jun 23, 2011 7:41 am Post subject: |
|
|
 Apprentice
Joined: 02 Jul 2008 Posts: 40 Location: Hampshire, UK
|
Hi cvag and all,
Think I've discovered what was causing my issue...
The SOAPInput node is configured with event monitoring enabled on the Out terminal, if monitoring is active the SOAPInput node lets an invalid message through, if monitoring is inactive the SOAPInput node correctly raises an exception saying that an unexpected element was discovered.
I think I need to raise this as an issue in a PMR.
Cheers all |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 23, 2011 8:41 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I think I need to raise this as an issue in a PMR. |
I agree - please do. |
|
Back to top |
|
 |
bielesibub |
Posted: Fri Jun 24, 2011 1:14 am Post subject: |
|
|
 Apprentice
Joined: 02 Jul 2008 Posts: 40 Location: Hampshire, UK
|
Cheers kimbert, PMR should be raised shortly. |
|
Back to top |
|
 |
cvag |
Posted: Wed Jun 29, 2011 1:12 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Quote: |
This pops into the message flow with a null SOAP element.. ? I'm pretty sure exceptions were being raised previously? Am I being a numpty? |
Hi bielesibub,
Can you please clarify me once again, bcoz as you said i have tested the scenario having SOAPInput node with Invalid SOAP message removing '/' for one of the element.
But i could able to have the relevant exception[SOAP fault] throwing at SOAPInput node itself.
Can you please try with different parsing options, i think you are configuring OnDemand option so you are able to cross SOAPInput.
Please try with Immediate or Complete options and let me know.
Thanks[/code] |
|
Back to top |
|
 |
|