Author |
Message
|
stunned |
Posted: Tue Mar 06, 2012 3:51 pm Post subject: SOAP UI validated message failing in validation Node of WMB |
|
|
Newbie
Joined: 06 Mar 2012 Posts: 7
|
I am facing a problem in message broker where my message is failing in a validation node. Its giving me a exception saying
"cvc-complex-type.2.4.a: Expecting element with local name "Request" but saw "NS2:Request"."
My current flow architecture is like:-
SOAP INPUT Node --> SOAP Extract Node ---> Route to Label node ---> Label Node---> Subflow ---> SOAP Reply Node.
I am doing the validation against the message set at the very begining of the subflow.
When I have placed MQOutput Queue in order to see whats going inside the validation Node I can see below message is going inside the Validation Node
<NS1:Read xmlns:NS1="_htp://abc.com/Headers/G2">
<NS2:Request xmlns:NS2="_htp://abc.com/Document/G2">
--------
-----
---
</NS2:Request>
</NS1:Read>
After this I have changed the structure of message which I am sending to validation node
<NS1:Read xmlns:NS1="_htp://abc.com/Headers/G2">
<Request>
--------
-----
---
<Request>
</NS1:Read>
and now I started getting a exception saying
"cvc-complex-type.2.4.a: Expecting element with local name "Request" but saw "Request"."
Please help.
[/b] |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Mar 06, 2012 4:01 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So, you mean, you changed the syntactic and the semantic meaning of an XML element by removing the namespace, that indicates what logical element the actual tag represents.
And then you experienced a validation error, because the object that previously had a useful name now has a string of characters that has no meaning behind it as a name. |
|
Back to top |
|
 |
stunned |
Posted: Tue Mar 06, 2012 4:16 pm Post subject: |
|
|
Newbie
Joined: 06 Mar 2012 Posts: 7
|
The Original message which I am sending from SOAP UI looks like below
<soapenv:Envelope xmlns:docG2="http://abc.com/Document/G2"
xmlns:semaG2="http://abc.com/Headers/G2">
<soapenv:Body>
<abcG2:Read>
<pqrG2:Request>
-------
-------
---
</abcG2:Read>
</pqrG2:Request>
</soapenv:Body>
</soapenv:Envelope>
The transformation in which you are seeing the namespace defined at node level are done by Extract Node of message Broker. After passing from a Extract Node Message is looking like:-
<NS1:Read xmlns:NS1="http://abc.com/Headers/G2">
<NS2:Request xmlns:NS2="http://abc.com/Document/G2">
--------
-----
---
</NS2:Request>
</NS1:Read>
and this is also a valid XML as par XML standards.
I hope I have answered your question. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Mar 06, 2012 4:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
stunned wrote: |
and this is also a valid XML as par XML standards. |
No it's not - it's well formed. It's not valid unless it matches it's schema. What WMB is telling you is that it doesn't because the Request tag is in a namespace where the schema says it doesn't.
I'm inclined to agree with WMB given what you've posted. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqsiuser |
Posted: Tue Mar 06, 2012 8:06 pm Post subject: |
|
|
 Yatiri
Joined: 15 Apr 2008 Posts: 637 Location: Germany
|
Vitor wrote: |
I'm inclined to agree with WMB given what you've posted. |
Validation of XML against a (xsd) schema during development/error searching really works great (and it is actually a must). @stunned: You should also use a (standalone) XML-Editor (like Vitor does ) to do that. There actually/really is no difference by the result: It is either "valid" or "not valid". Unlike (the) broker (runtime) the tool likely helps you better with correcting your xml or xsd (you'll have to adjust one of them until the tool says "valid"). Then broker will (very very likely) also say "valid" then. _________________ Just use REFERENCEs |
|
Back to top |
|
 |
kimbert |
Posted: Wed Mar 07, 2012 2:21 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
@stunned: Your problem is with XML, not WMB. I recommend the W3Schools tutorial on XML and XML Schema. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 07, 2012 2:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
stunned wrote: |
<NS1:Read xmlns:NS1="http://abc.com/Headers/G2">
<NS2:Request xmlns:NS2="http://abc.com/Document/G2"> |
This is entirely not the same thing that you posted before.
stunned wrote: |
<NS1:Read xmlns:NS1="_htp://abc.com/Headers/G2">
<Request> |
|
|
Back to top |
|
 |
|