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 » Input Message Parsing panel in SOAPInput Node

Post new topic  Reply to topic
 Input Message Parsing panel in SOAPInput Node « View previous topic :: View next topic » 
Author Message
xzhou
PostPosted: Fri Oct 12, 2012 12:02 pm    Post subject: Input Message Parsing panel in SOAPInput Node Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Fri Oct 12, 2012 12:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
xzhou
PostPosted: Fri Oct 12, 2012 12:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Fri Oct 12, 2012 12:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
xzhou
PostPosted: Fri Oct 12, 2012 1:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Fri Oct 12, 2012 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
xzhou
PostPosted: Fri Oct 12, 2012 3:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Oct 12, 2012 5:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqsiuser
PostPosted: Fri Oct 12, 2012 10:49 pm    Post subject: Re: Input Message Parsing panel in SOAPInput Node Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Fri Oct 12, 2012 11:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqsiuser
PostPosted: Sat Oct 13, 2012 12:40 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Here mqjeff describes something like this.

I can remember when I started broker, I also thought / expected that I could just create all out-elements (in some order) and then the parser and msg-set might adjust that... but that is not the case (for performance reason).

I also thought that providing an xsd might/could increase the parser-performance because it (the parser) could/might benefit from this (additional) information. When using XML then XSDs (and mxsds created there of) seem to be used rather for validation rather than for supporting the writing out / reading in of XML (faster / or making corrections).
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
kimbert
PostPosted: Sat Oct 13, 2012 10:38 am    Post subject: Reply with quote

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
View user's profile Send private message
lancelotlinc
PostPosted: Mon Oct 15, 2012 5:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Input Message Parsing panel in SOAPInput Node
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.