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 » Transforming a HTTPInput node message to SOAP Domain

Post new topic  Reply to topic
 Transforming a HTTPInput node message to SOAP Domain « View previous topic :: View next topic » 
Author Message
ccrandall
PostPosted: Tue Jul 06, 2010 10:05 am    Post subject: Transforming a HTTPInput node message to SOAP Domain Reply with quote

Acolyte

Joined: 23 Oct 2008
Posts: 52

In order to scale, we decided to go back to using HTTP Input nodes instead of the SOAP Input node. So, I created a Compute node to take the incoming SOAP message and convert it from XMLNSC to the SOAP domain. The incoming message (sans headers for brevity) look like this:

(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0x1691d0d0]
(0x01000400:NamespaceDecl):XmlDeclaration = (
(0x03000100:Attribute):Version = '1.0' (CHARACTER)
(0x03000100:Attribute):Encoding = 'UTF-8' (CHARACTER)
)
(0x01000000:Folder )http://schemas.xmlsoap.org/soap/envelope/:Envelope = (
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:q0 = 'http://nm.broker.service.GetPeopleWhoMakeMoreMoneyOperation' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:xsd = 'http://www.w3.org/2001/XMLSchema' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:xsi = 'http://www.w3.org/2001/XMLSchema-instance' (CHARACTER)
(0x01000000:Folder )http://schemas.xmlsoap.org/soap/envelope/:Body = (
(0x01000000:Folder)http://nm.broker.service.GetPeopleWhoMakeMoreMoneyOperation:GetPeopleWhoMakeMoreMoneyOperation = (
(0x01000000:Folder):request = (
(0x03000000:PCDataField):MsgProtocol = 'SCIP' (CHARACTER)
(0x03000000:PCDataField):MsgProtocolVersionNum = '001' (CHARACTER)
(0x03000000:PCDataField):MsgTypeCde = 'N' (CHARACTER)
(0x01000000:Folder ):MsgClientOperId =
(0x01000000:Folder ):MsgSenderApplId =
(0x03000000:PCDataField):MsgName = 'GetPeopleWhoMakeMoreMoney' (CHARACTER)
(0x03000000:PCDataField):MsgVersionNum = '001' (CHARACTER)
(0x03000000:PCDataField):Salary = '80000' (CHARACTER)
)
)
)
)

To convert this to the SOAP domain, the function I use looks like this:

CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE MsgName CHAR;
DECLARE Operation CHAR;
DECLARE NameSpace CHAR;

-- Copy Headers
SET OutputRoot.Properties = InputRoot.Properties;
-- SET OutputRoot.Properties.ReplyProtocol = 'SOAP-AXIS2';

SET OutputRoot.HTTPInputHeader = InputRoot.HTTPInputHeader;

SET MsgName = InputRoot.XMLNSC.(XMLNSC.Folder)[1].(XMLNSC.Folder)[1].(XMLNSC.Folder)[1].(XMLNSC.Folder)[1].MsgName;
SET Operation = MsgName || 'Operation';
SET NameSpace = 'http://nm.broker.service.' || Operation;

-- Create SOAP Context
SET OutputRoot.SOAP.Context.(XMLNSC.Attribute)operation = Operation;
SET OutputRoot.SOAP.Context.(XMLNSC.Attribute)operationType = 'REQUEST_RESPONSE';
SET OutputRoot.SOAP.Context.(XMLNSC.Attribute)portType = MsgName;
SET OutputRoot.SOAP.Context.(XMLNSC.Attribute)port = MsgName;
SET OutputRoot.SOAP.Context.(XMLNSC.Attribute)service = MsgName || 'Service';
SET OutputRoot.SOAP.Context.(XMLNSC.Attribute)SOAP_Version = '1.2';

SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:xsd = 'http://www.w3.org/2001/XMLSchema';
SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:N1 = NameSpace;

-- Create XML Declaration
CREATE LASTCHILD OF OutputRoot.SOAP.Context TYPE XMLNSC.XmlDeclaration;
SET OutputRoot.SOAP.Context.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version = 1.0;
SET OutputRoot.SOAP.Context.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = 'UTF-8';
SET OutputRoot.SOAP.Context.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Standalone = 'yes';

-- Create SOAP Body
SET OutputRoot.SOAP.Body = InputBody.(XMLNSC.Folder)[1].(XMLNSC.Folder)[1];

END;

Even though the code I'm using to create the XML declaration came directly from the Info Center, in the OuputRoot it is just a plain NamespaceDecl:

(0x01000000:Folder):SOAP = ( ['SOAP' : 0xc73f0d8]
(0x01000000:Folder):Context = (
(0x03000100:Attribute ):operation = 'GetPeopleWhoMakeMoreMoneyOperation' (CHARACTER)
(0x03000100:Attribute ):operationType = 'REQUEST_RESPONSE' (CHARACTER)
(0x03000100:Attribute ):portType = 'GetPeopleWhoMakeMoreMoney' (CHARACTER)
(0x03000100:Attribute ):port = 'GetPeopleWhoMakeMoreMoney' (CHARACTER)
(0x03000100:Attribute ):service = 'GetPeopleWhoMakeMoreMoneyService' (CHARACTER)
(0x03000100:Attribute ):SOAP_Version = '1.2' (CHARACTER)
(0x01000000:Folder ):Namespace = (
(0x03000102:NamespaceDecl)xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/' (CHARACTER)
(0x03000102:NamespaceDecl)xmlns:xsd = 'http://www.w3.org/2001/XMLSchema' (CHARACTER)
(0x03000102:NamespaceDecl)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance' (CHARACTER)
(0x03000102:NamespaceDecl)xmlns:N1 = 'http://nm.broker.service.GetPeopleWhoMakeMoreMoneyOperation' (CHARACTER)
)
(0x01000400:NamespaceDecl): = (
(0x03000100:Attribute):Version = 1.0 (DECIMAL)
(0x03000100:Attribute):Encoding = 'UTF-8' (CHARACTER)
(0x03000100:Attribute):Standalone = 'yes' (CHARACTER)
)
)
(0x01000000:Folder):Body = (
(0x01000000:Folder)http://nm.broker.service.GetPeopleWhoMakeMoreMoneyOperation:GetPeopleWhoMakeMoreMoneyOperation = (
(0x01000000:Folder):request = (
(0x03000000:PCDataField):MsgProtocol = 'SCIP' (CHARACTER)
(0x03000000:PCDataField):MsgProtocolVersionNum = '001' (CHARACTER)
(0x03000000:PCDataField):MsgTypeCde = 'N' (CHARACTER)
(0x01000000:Folder ):MsgClientOperId =
(0x01000000:Folder ):MsgSenderApplId =
(0x03000000:PCDataField):MsgName = 'GetPeopleWhoMakeMoreMoney' (CHARACTER)
(0x03000000:PCDataField):MsgVersionNum = '001' (CHARACTER)
(0x03000000:PCDataField):Salary = '80000' (CHARACTER)
)
)
)
)

Does anyone know what it is I'm doing wrong?

As a side note, I'm also trying to change set the OutputRoot.Properties.ReplyProtocol to 'SOAP-AXIS2'. However, it remains as 'SOAP_HTTP' as it was on the InputRoot. I need to distinguish between regular HTTP and SOAP messages and keying off the ReplyProtocol is how we did it when using SOAP Input nodes. Any ideas why I cannot set the ReplyProtocol here?

Thanks!!!
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jul 06, 2010 10:47 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
In order to scale, we decided to go back to using HTTP Input nodes instead of the SOAP Input node.
OK, I'll bite...
What doesn't scale about the SOAPInput node?

Quote:
Even though the code I'm using to create the XML declaration came directly from the Info Center, in the OuputRoot it is just a plain NamespaceDecl:
Well spotted. This is a defect in the decoding of the XMLNSC.NamespaceDecl field type. Nothing to worry about.
Back to top
View user's profile Send private message
ccrandall
PostPosted: Tue Jul 06, 2010 10:57 am    Post subject: Reply with quote

Acolyte

Joined: 23 Oct 2008
Posts: 52

We have some service owners that will be using a broker flow to provide a SOAP front-end for legacy services. Some of these groups have 50-100 or more services they may eventually front. Each service will need a SOAP Input node and a corresponding Message Set/WSDL. So, having a single flow handling all that will get messy.

We also have DataPower which is performing the security and message validation. So, there isn't much to be gained for us using the the SOAP Input node. After consulting with IBM, we decided it would be best to handle everything with a HTTP Input node.

Thank you for the info on that defect. While the XmlDecl looked incorrect, it wasn't causing an error in the flow. But I figured it might be something that could bite me later on.

I'm also seeing something similar elsewhere in my code where it really is a problem. But this is a case where I'm upgrading from the XML to the XMLNSC parser. In a certain scenario, the replies coming back are in "chunks" and they need to be "repackaged" into a single reply. In this situation, we are using the Environment to copy the first chunk to and then loop thru the rest of the chunks and add them to that copy. Even though I set the domain to XMLNSC on that part of the Environment tree, after the copy all/many of the fields have the incorrect type on them... this includes the XmlDecl which turned into a Folder and ended up with the "packet count" field in it (this field holds the number of chunks that make up the reply). But that is another issue that I'm working through...
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 06, 2010 11:36 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

kimbert wrote:

What doesn't scale about the SOAPInput node?


I agree with Kimbert here. Earlier this week, I did some tests (to satisfy my curiosity...) to see how fast passing messages between two Flows with SOAP was.
I took the Sample SOAP Flows and modified the caller to calculate the time taken to do the round trip to the service and back.

The flows were deployed into separate Execution Groups and testing began.
The first time the service was called, it was very slow. 1.13seconds to be precise. Ouch.

Then it was fast. I did 48 further tests (yeah, I can't count) an the acerage excluding the first time was 13ms with the fastest 3msecs.
Then I stopped Notes and the AV scanner.... Yeah this was done on my XP(groan) Lenovo T500 Laptop.
I ran 20 more tests and the average dropped to 8msecs for the round trip with the fastest 2msec.
I was pleasantly surprised to see the results. We are seeing much higher times when we call a Broker SOAP Service from Portal. The problem is that Portal seems to take an age to create the SOAP request, and not for Broker to respond.

Right back on Topic.
To the OP
Was your concern that SOAP & Scaling was that it was too slow or was it some other reason? I'm sure that with the increasing popularity of SOAP others who read this fourm would be interested in understanding your concerns.
_________________
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
mqjeff
PostPosted: Tue Jul 06, 2010 11:50 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I believe the issue that OP has is that they want a single flow to act as a proxy for multiple independent webservices.

If they use a SOAPInput node to start this flow, it is of necessity tied to a specific WSDL, which means it is tied to a specific webservice.

So in order to have one flow act as a proxy for multiple webservices, they either need to use a generic HTTPInput node or use a *lot* of SOAPInput nodes in the one flow.
Back to top
View user's profile Send private message
ccrandall
PostPosted: Tue Jul 06, 2010 12:19 pm    Post subject: Reply with quote

Acolyte

Joined: 23 Oct 2008
Posts: 52

mqjeff was correct. It's more about not wanting to handle X number of SOAP Input nodes + Message Sets, esp when DataPower is already doing security/validation for us.

There is also a small performance gain by using HTTP Input instead of SOAP Input, but that's didn't really factor into our decision here.

I should've been more precise with my use of the word "scale" as I can see where people would think I was talking about performance.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jul 06, 2010 1:13 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I'm also seeing something similar elsewhere in my code where it really is a problem...
Ah, this sounds familiar! I've already discussed your problem with a colleague in IBM, and a reply will be winging its way to you shortly.
Back to top
View user's profile Send private message
mgk
PostPosted: Tue Jul 06, 2010 1:38 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hello. I understand why you are using HTTP nodes here and your definition of scale. However, I would like to know why you are then converting the message to the SOAP Domain? Is it to send the message onto a SOAP Request node? If so you should know that you do not need to set up all the context folder yourself if you so not really need to. The node will use it if provided, but in your code the only essential piece is the line to set up the body:

SET OutputRoot.SOAP.Body = InputBody.(XMLNSC.Folder)[1].(XMLNSC.Folder)[1];


Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
ccrandall
PostPosted: Tue Jul 06, 2010 2:12 pm    Post subject: Reply with quote

Acolyte

Joined: 23 Oct 2008
Posts: 52

@kimbert - I'm very much looking forward to your reply. I know I'm making a mistake in the copy, but I'm just not seeing it.

@mgk - Since we started with a SOAP Input node, the rest of the flow is keying off of fields in the SOAP tree... including under the Context. If I do not convert the incoming message to the SOAP domain, the flow fails. However, with the conversion code I wrote, the rest of the flow is fine. I know I'm being a bit lazy here, but I'm crunched for time and this seemed to be the easiest route for me.

Thanks!
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 » Transforming a HTTPInput node message to SOAP Domain
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.