Author |
Message
|
xzhou |
Posted: Fri Oct 12, 2012 12:02 pm Post subject: Input Message Parsing panel in SOAPInput Node |
|
|
Apprentice
Joined: 11 Apr 2008 Posts: 32
|
Hi
According to infocenter, it contains "Message Domain" ,"Message set", "Message type" and "Message format". the value of "Message set" is set automatically to the message set that contains the WSDLfile when the WSDL is associated with the node.
SOAP is an operation mode on this node.
In Toolkit V8.0.0.1, it contains "Message Domain", "Message model", "message" and physical format". "Message model" is empty.
Although it seems working fine, but it looks the sequence of elements in SOAP reply is not based on a xsd defined in a wsdl.
for instance. <a/><b/><c/> is defined in a xsd.
but <b/><a/><c/> is returned, It seems to me it is sequence of elements set/populated in a flow.
Any advices is appreciated.
Thanks, XZ |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 12, 2012 12:36 pm Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
b-a-c is acceptable as long as you have Content And Value validation turned off.
If you turn on Content and Value validation, b-a-c would throw an error because it does not match the prescribed order of the XSD which you said to be A-B-C. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
xzhou |
Posted: Fri Oct 12, 2012 12:48 pm Post subject: |
|
|
Apprentice
Joined: 11 Apr 2008 Posts: 32
|
Hi lancelotlinc,
Could you please advise me how to make it work? if I turned on Content And Value validation.
Thanks, XZ |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 12, 2012 12:51 pm Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
If you turn on validation, the SOAP sender must comply with the XML being sent to you in the SOAP Request message according to the XSDs. You must also send back a reply that conforms to the format of the SOAP Response message.
If it is not possible for the sender to modify their incoming Request format, then you must set validation off. Everything will work well with validation off and no changes to your ESQL code is needed, since the ESQL SET statements can select the proper value from the message tree even if the input is not in the right order. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
xzhou |
Posted: Fri Oct 12, 2012 1:36 pm Post subject: |
|
|
Apprentice
Joined: 11 Apr 2008 Posts: 32
|
Hi lancelotlinc,
I had a problem with a reply message. the data are set/populated by "databaseRetrieve" nodes. I did some testing with "Content And Value validation" turned on in reply.
It is fine if data is populated by databaseRetrieve based on the sequence in xsd. otherwise an exception is thrown.
It seems to me that a SOAP reply doesn't marshall message tree into xml using xsd, instead it only validates an XML bitstream using xsd in the end.
I hope my understanding is wrong. Could you please shed me some light on it?
Thanks, Xiaoming |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 12, 2012 2:45 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
It is fine if data is populated by databaseRetrieve based on the sequence in xsd. otherwise an exception is thrown. |
This is as-designed. Message broker lets you build the message tree in whatever order you want. If you need to enforce the constraints in an XML schema then you can choose to do that by setting Validation to 'Content and Value'.
Quote: |
It seems to me that a SOAP reply doesn't marshall message tree into xml using xsd, instead it only validates an XML bitstream using xsd in the end.
I hope my understanding is wrong. |
This seems a perfectly reasonable way for WMB to work. You only pay the CPU cost of matching the message against the xsd if that is what you need. Some products have what I call a 'model-backed tree' that does not allow you to construct any tree unless it is backed by an xsd. That does offer certain advantages at design time, but there is usually a price to pay when it comes to runtime performance. Message broker prefers to let you construct any tree you want ( or multiple trees, if you like ) and gives you the tools to validate any tree at any point in the message flow. |
|
Back to top |
|
 |
xzhou |
Posted: Fri Oct 12, 2012 3:27 pm Post subject: |
|
|
Apprentice
Joined: 11 Apr 2008 Posts: 32
|
Hi kimbert, Thanks for your reply.
What can I do ? if a SOAP reply message needs to be a schema valid one.
I don't think it is nice to ask a flow to populate data in the sequence of a schema in order to generated a schema valid reply.
I understood esql can help to rearrange data in this case, but esql code will be clumsy if a schema is "complex" in a production, I think.
Thanks, XZ |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 12, 2012 5:03 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
xzhou wrote: |
I don't think it is nice to ask a flow to populate data in the sequence of a schema in order to generated a schema valid reply. |
IMHO that's a perfectly reasonable thing to ask. The WSDL and the XSD it contains are a contract between client and provider; the provider is saying "if you send a request in the form I specify for this operation, I will send you a response in this form". If that XSD contains a sequence then you should honour that in the same way you don't put in both elements of a choice. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqsiuser |
Posted: Fri Oct 12, 2012 10:49 pm Post subject: Re: Input Message Parsing panel in SOAPInput Node |
|
|
 Yatiri
Joined: 15 Apr 2008 Posts: 637 Location: Germany
|
xzhou wrote: |
Although it seems working fine, but it looks the sequence of elements in SOAP reply is not based on a xsd defined in a wsdl.
[...]
It seems to me it is sequence of elements set/populated in a flow. |
yes, always (as others said): ESQL (or other nodes) sets the sequence of elements. The out-parsing wont fix (not adjust) it (base on a msg set) for you (for performance reasons).
xzhou wrote: |
for instance. <a/><b/><c/> is defined in a xsd.
but <b/><a/><c/> is returned |
Note that the xsd can allow "any order" (choice) or "fixed order" (sequence).... so in one case only "abc" is valid, in the other "abc" and any mixture of it is valid.
Use proper XML-Tools to validate your xml. SOAP-UI is a great tool for testing web services. _________________ Just use REFERENCEs |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Oct 12, 2012 11:45 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I guess what the Op would like is something like this
1) create a tree somewhere that has a structure like that defined in the XSD
2) then populate all the fields as required in any order.
sort of like when I create an MQMD in 'C', I get the basic structure and I can fill in the bits as I please in any order.
That is all fine and dandy but how do you handle a 'choice'.
It just won't work on anything but the most simple xsd's. (AFAIK, IMHO) _________________ 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 |
|
 |
mqsiuser |
Posted: Sat Oct 13, 2012 12:40 am Post subject: |
|
|
 Yatiri
Joined: 15 Apr 2008 Posts: 637 Location: Germany
|
|
Back to top |
|
 |
kimbert |
Posted: Sat Oct 13, 2012 10:38 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
smdavies99 is on the right track. The simple cases look easy, but there are significant complexities when more complex message models ( xsds ) are used. The easy way out is to offer only one way of building a message tree -a schema-aware XML document-building API. That would be a lot less flexible than the current facilities.
WMB could offer some type of 're-order' node that would bring a randomly-ordered message tree into line with a message model. However, it is not a trivial feature to implement and it will only get done if enough users ask for it. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Oct 15, 2012 5:06 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
xzhou wrote: |
Hi kimbert, Thanks for your reply.
What can I do ? if a SOAP reply message needs to be a schema valid one.
I don't think it is nice to ask a flow to populate data in the sequence of a schema in order to generated a schema valid reply.
I understood esql can help to rearrange data in this case, but esql code will be clumsy if a schema is "complex" in a production, I think.
Thanks, XZ |
Order of elements is important, and its easy to do. Just write your SET statements in the order of the XSD and it will match the schema. Complex XSDs are not clumsy in production, and in my experience they operate just fine. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|