Author |
Message
|
sandman147 |
Posted: Thu Jan 23, 2014 6:39 am Post subject: Accomadating XML messages in SOAP Input |
|
|
Apprentice
Joined: 01 Sep 2013 Posts: 42
|
I am working on a project that removes the soap envelope from the input soap message and puts the message body to a queue. However the application is unable to process XML messages. What changes should be made to the wsdl (I'm assuming) so it can handle the same or is there any other way. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jan 23, 2014 6:43 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I don't understand this sentence:
Quote: |
However the application is unable to process XML messages. |
Which application? In what way is it 'unable to process XML messages'? _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
sandman147 |
Posted: Thu Jan 23, 2014 6:59 am Post subject: |
|
|
Apprentice
Joined: 01 Sep 2013 Posts: 42
|
Sorry for the confusion. The application meaning my project is able to process a simple message. Example
-------------------------------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="http://www.pnc.com/TestService/">
<soapenv:Header/>
<soapenv:Body>
<tes:TestOperation>
<Request>
This is a test message
ABCDE12345*#%@$
</Request>
</tes:TestOperation>
</soapenv:Body>
</soapenv:Envelope>
But is throwing a user specified error when trying to process an XML message. Example of an XML message it is unable to process
---------------------------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="http://www.pnc.com/TestService/">
<soapenv:Header/>
<soapenv:Body>
<tes:TestOperation>
<Request>
<codes>
<condition>
<code>395</code>
<description>Moderate or heavy snow in area with thunder</description>
<day_icon>wsymbol_0012_heavy_snow_showers</day_icon>
<night_icon>wsymbol_0028_heavy_snow_showers_night</night_icon>
</condition>
</codes>
</Request>
</tes:TestOperation>
</soapenv:Body>
</soapenv:Envelope>
It cannot process any XML message and is throwing an exception
---------------------------------------------------------------------------------
<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS1:Body>
<NS1:Fault>
<faultactor>WebSphere Message Broker</faultactor>
<faultcode>-100</faultcode>
<faultstring>
<RecoverableException>
<File>F:\build\S700_P\src\DataFlowEngine\ImbComputeNode.cpp</File>
<Line>489</Line>
<Function>ImbComputeNode::evaluate</Function>
<Type>ComIbmComputeNode</Type>
<Name>pmt_WS_MsgFlow#FCMComposite_1_3</Name>
<Label>pmt_WS_MsgFlow.sendSuccessResponse</Label>
<Catalog>BIPmsgs</Catalog>
<Severity>3</Severity>
<Number>2230</Number>
<Text>Caught exception and rethrowing</Text>
<RecoverableException>
<File>F:\build\S700_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp</File>
<Line>641</Line>
<Function>SqlStatementGroup::execute</Function>
<Type>ComIbmComputeNode</Type>
<Name>pmt_WS_MsgFlow#FCMComposite_1_3</Name>
<Label>pmt_WS_MsgFlow.sendSuccessResponse</Label>
<Catalog>BIPmsgs</Catalog>
<Severity>3</Severity>
<Number>2488</Number>
<Text>Error detected, rethrowing</Text>
<Insert>
<Type>5</Type>
<Text>.pmt_WS_MsgFlow_Compute_sendSuccessResponse.Main</Text>
</Insert>
<Insert>
<Type>5</Type>
<Text>4.3</Text>
</Insert>
<Insert>
<Type>5</Type>
<Text>SET OutputRoot.SOAP.Body.ns:TestOperationResponse.Response = InputRoot.SOAP.Body.ns:TestOperation.Request;</Text>
</Insert>
<RecoverableException>
<File>F:\build\S700_P\src\DataFlowEngine\ImbRdl\ImbRdlFieldRef.cpp</File>
<Line>2482</Line>
<Function>SqlFieldReference::evaluate</Function>
<Type>ComIbmComputeNode</Type>
<Name>pmt_WS_MsgFlow#FCMComposite_1_3</Name>
<Label>pmt_WS_MsgFlow.sendSuccessResponse</Label>
<Catalog>BIPmsgs</Catalog>
<Severity>3</Severity>
<Number>2498</Number>
<Text>Navigation error</Text>
<Insert>
<Type>5</Type>
<Text>.pmt_WS_MsgFlow_Compute_sendSuccessResponse.Main</Text>
</Insert>
<Insert>
<Type>5</Type>
<Text>4.64</Text>
</Insert>
<Insert>
<Type>2</Type>
<Text>3</Text>
</Insert>
<ParserException>
<File>F:\build\S700_P\src\WebServices\WSLibrary\ImbSOAPParser.cpp</File>
<Line>2061</Line>
<Function>ImbSOAPParser::createSoapShapedTree</Function>
<Type/>
<Name/>
<Label/>
<Catalog>BIPmsgs</Catalog>
<Severity>3</Severity>
<Number>3614</Number>
<Text>problem creating SOAP tree from bitstream</Text>
<ParserException>
<File>F:\build\S700_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCParser.cpp</File>
<Line>954</Line>
<Function>ImbXMLNSCParser::parseRightSibling</Function>
<Type/>
<Name/>
<Label/>
<Catalog>BIPmsgs</Catalog>
<Severity>3</Severity>
<Number>5009</Number>
<Text>XML Parsing Errors have occurred</Text>
<ParserException>
<File>F:\build\S700_P\src\MTI\MTIforBroker\GenXmlParser4\ImbXMLNSCDocHandler.cpp</File>
<Line>634</Line>
<Function>ImbXMLNSCDocHandler::handleParseErrors</Function>
<Type>ComIbmSOAPInputNode</Type>
<Name>pmt_WS_MsgFlow#FCMComposite_1_1</Name>
<Label>pmt_WS_MsgFlow.SOAP Input</Label>
<Catalog>BIPmsgs</Catalog>
<Severity>3</Severity>
<Number>5025</Number>
<Text>A schema validation error has occurred while parsing the XML document</Text>
<Insert>
<Type>2</Type>
<Text>5007</Text>
</Insert>
<Insert>
<Type>2</Type>
<Text>2</Text>
</Insert>
<Insert>
<Type>2</Type>
<Text>6</Text>
</Insert>
<Insert>
<Type>2</Type>
<Text>20</Text>
</Insert>
<Insert>
<Type>5</Type>
<Text>cvc-complex-type.2.4.d: Expecting an end tag. Invalid content was found starting with element "codes". No child element is expected at this point.</Text>
</Insert>
<Insert>
<Type>5</Type>
<Text>/XMLNSC/http://schemas.xmlsoap.org/soap/envelope/:Envelope/http://schemas.xmlsoap.org/soap/envelope/:Body/http://www.pnc.com/TestService/:TestOperation/Request</Text>
</Insert>
</ParserException>
</ParserException>
</ParserException>
</RecoverableException>
</RecoverableException>
</RecoverableException>
</faultstring>
</NS1:Fault>
</NS1:Body>
</NS1:Envelope>
---------------------------------------------------------------------------
In my mxsd, the Response and Request accept only SimpleType. I think I need to change that so it can take XML messages as well. Is that right ? |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Jan 23, 2014 7:48 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
The final stanza of the ExceptionList tells you everything you need to know.
Have you tried an external tool to validate the failing message against the WSDL?
What is your flow supposed to do when it encounters invalid (as defined in the WSDL) XML?
I do wonder if you should learn to think about this horrid subject called 'Defensive Programming'. It will really help you developing reliabel and (hopefully) unbreakable code. _________________ 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 |
|
 |
dogorsy |
Posted: Thu Jan 23, 2014 7:48 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
so, you are asking for someone to do your work ?
it is a very simple task, maybe you could read the documentation ?! |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jan 23, 2014 7:51 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Sounds as if your SOAP request does not match the service definition in the WSDL. This fairly basic stuff - please check that the message you are sending conforms to the service specification. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 23, 2014 7:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sandman147 wrote: |
In my mxsd, the Response and Request accept only SimpleType. I think I need to change that so it can take XML messages as well. Is that right ? |
No, you need to change it so that it accepts the specific XML document being passed.
You might want to read up on how web services are intended to work, and how a WSDL defines a fixed contract for a service. You sound like you're trying to define a generic interface which accepts any old XML and parses it.
You need a different design for that. As a minimum you need to be thinking about the WMB gateway mode for web services. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
sandman147 |
Posted: Thu Jan 23, 2014 9:36 am Post subject: |
|
|
Apprentice
Joined: 01 Sep 2013 Posts: 42
|
My bad.. I should have done a little more research before posting.. Thanks all |
|
Back to top |
|
 |
|