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 » Can broker build SOAP response according to schema in WSDL ?

Post new topic  Reply to topic
 Can broker build SOAP response according to schema in WSDL ? « View previous topic :: View next topic » 
Author Message
WBI_user
PostPosted: Sun Aug 12, 2012 10:04 pm    Post subject: Can broker build SOAP response according to schema in WSDL ? Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

I am using broker 7003.
I have a test flow using SOAP Inut compute and SOAP Reply

My SOAP response message looks like this
Quote:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<NS1:MyWSResponse xmlns:NS1="mydomain.data.com">
<NS1:MyMsg AA="1234" BB="5678" CC="0000" DD="Good">
</NS1:MyMsg>
</NS1:MyWSResponse>
</soapenv:Body>
</soapenv:Envelope>


where fields AA, BB, CC, DD are XML attributes.

The message definition for MyWSResponse was created by importing the WSDL and has AA BB CC DD as attributes

I can create the SOAP response using
SET OutputRoot.XMLNSC.ns:MyWSResponse.ns:MyMsg.(XMLNSC.Attribute)AA='1234'; and similar for BB CC and DD.

I was told that if I use the SOAP parser
SET OutputRoot.SOAP.Body.ns:MyWSResponse.ns:MyMsg.AA='1234'; and similar for BB CC and DD.
I do not have to use .(XMLNSC.Attribute) because the SOAP parser will build the message using the schema which is included in the WSDL and has AA BB CC DD defined as attributes.

I changed the ESQL to use SOAP parser. But I was not able to get the fields AA BB CC DD show up as attribute. They will show up as XML element if I remove (XMLNSC.Attribute).

Can some one confirm that I do not need .(XMLNSC.Attribute) to create attribute when using SOAP parser instead of XMLNSC parser ?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Aug 13, 2012 4:55 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

kimbert is the expert on this topic.

Locally, we always use OutputRoot.SOAP.Body.xxx construct for SOAP reply messages. We do not use XMLAttribute construct usually (there is one exception).
_________________
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
WBI_user
PostPosted: Mon Aug 13, 2012 5:48 am    Post subject: Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

Hi lancelotlinc, thanks for the response. It means that it is working for you i.e.When use SOAP parser you will get xml attribute instead of element without having to specify .(XMLNSC.Attribute) in ESQL (if the message set syas that it is an attribute). I'll start the diagnostic work to see why it is not working for me.
Back to top
View user's profile Send private message
WBI_user
PostPosted: Mon Aug 13, 2012 8:01 am    Post subject: Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

I put a trace node in front of the SOAP Reply and run the user trace

When using the (XMLNSC.Attribute),
SET OutputRoot.SOAP.Body.ns:MyWSResponse.ns:MyMsg.(XMLNSC.Attribute)AA = '1234';

the fields are set as Attribute
Quote:

(0x01000000:Folder):SOAP = ( ['SOAP' : 0xac7430]
(0x01000000:Folder):Body = (
(0x01000000:Folder)mydomain.data.com:MyWSResponse = (
(0x01000000:Folder)mydomain.data.com:MyMsg = (
(0x03000100:Attribute):AA = '1234' (CHARACTER)
(0x03000100:Attribute):BB = '5678' (CHARACTER)
(0x03000100:Attribute):CC = '0000' (CHARACTER)
(0x03000100:Attribute)D = 'Good' (CHARACTER)


If not
SET OutputRoot.SOAP.Body.ns:MyWSResponse.ns:MyMsg.AA = '1234';
the fields are set as PCDataField
Quote:

(0x01000000:Folder):SOAP = ( ['SOAP' : 0xac8428]
(0x01000000:Folder):Body = (
(0x01000000:Folder)mydomain.data.com:MyWSResponse = (
(0x01000000:Folder)mydomain.data.com:MyMsg = (
(0x03000000:PCDataField):AA = '1234' (CHARACTER)
(0x03000000:PCDataField):BB = '5678' (CHARACTER)
(0x03000000:PCDataField):CC = '0000' (CHARACTER)
(0x03000000:PCDataField)D = 'Good' (CHARACTER)


There is not much in the user trace after that (i.e. not much on what the SOAP Reply node does).

I just have the mset information copied to output in the compute node so that it can see the mset name. Perhaps I need to do more ?
Quote:

SET OutputRoot.Properties.MessageSet = InputRoot.Properties.MessageSet;
SET OutputRoot.Properties.MessageType = InputRoot.Properties.MessageType;
SET OutputRoot.Properties.MessageFormat = InputRoot.Properties.MessageFormat;

SET OutputRoot.SOAP.Body.ns:MyWSResponse.ns:MyMsg.AA = '1234'
:




Just looking at the trace node output , I can not see any different between the XMLNSC parser and SOAP Parser. Unless the SOAP output node can magically change the fields from PCData to Attribute when it is actually writing the message, I can't understand how it can work without using (XMLNSC.Attribute) in the ESQL.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 13, 2012 8:06 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Are you sure that these fields should be character data types, and not integer data types?

You need to make sure that the logical message tree matches the actual definition of the wsdl. I suspect that if you enabled validation on content and value on the compute node that builds the soap message, you'd see errors when using the SOAP domain.
Back to top
View user's profile Send private message
WBI_user
PostPosted: Mon Aug 13, 2012 10:09 am    Post subject: Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

These fields are fix length string fields. The nodes are using defaults.
SOAP Inputhas validation = content and value
SOAP Reply has validation = inherit
Compute node has validation = none.

I changed the compute nodes validation into Content and value. That makes no difference and there is no exception taken.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Mon Aug 13, 2012 12:55 pm    Post subject: Re: Can broker build SOAP response according to schema in WS Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

WBI_user wrote:
I was told that if I use the SOAP parser ... I do not have to use .(XMLNSC.Attribute) because the SOAP parser will build the message using the schema which is included in the WSDL and has AA BB CC DD defined as attributes.

I changed the ESQL to use SOAP parser. But I was not able to get the fields AA BB CC DD show up as attribute. They will show up as XML element if I remove (XMLNSC.Attribute).

Can some one confirm that I do not need .(XMLNSC.Attribute) to create attribute when using SOAP parser instead of XMLNSC parser ?

If removing the (XMLNSC.Attribute) changes the attributes to elements, then that's a fairly clear indication that that the (XMLNSC.Attribute) needs to be there. The SOAP parser uses the XMLNSC parser to parse/write the message body. The XMLNSC parser only uses the schema to validate messages; it does not use the schema to change the fieldtype of a message tree element, when writing an output message.
Back to top
View user's profile Send private message
WBI_user
PostPosted: Mon Aug 13, 2012 3:14 pm    Post subject: Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

We like to see minimum change to ESQL when Schema changes. We know that if there is a field/tag name change the ESQL must be changed. But a minor change like moving a tag from elelemnt to attribute , we were hoping that we don't have to change the ESQL and I was told that the SOAP parser will build the message according to the Schema and so we do not have to add the (XMLNSC.Attribute). But so far it does not seem that way.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Can broker build SOAP response according to schema in WSDL ?
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.