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 » How to add namespaces using Java Compute Node to soap messag

Post new topic  Reply to topic
 How to add namespaces using Java Compute Node to soap messag « View previous topic :: View next topic » 
Author Message
intisam
PostPosted: Tue Nov 25, 2008 11:41 pm    Post subject: How to add namespaces using Java Compute Node to soap messag Reply with quote

Novice

Joined: 18 Mar 2008
Posts: 21

We are using WBIMB6.1 with MQ6.0;

The following is the MsgFlow diagram:-

MQInput --> SOAP-EVELOP --> JAVA Compute Node --> HTTP Request

We are pushing a simple message to MQInput node and then generating a SOAP message using SOAP-ENVELOP. SOAP-ENVELOP by default a data like follwoing:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<sampledata> some text </sampledata>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Now our requirement is to add an additional SOAP-Header with custom namespace and value like follwoing :


<SOAP-ENV:Header>
<siebel-header:SessionToken xmlns:siebel-header="http://abcd.com">
sessiontokenvalye
</siebel-header:SessionToken>
<SessionType xmlns="http://siebel.com/webservices">Stateless</SessionType>
</SOAP-ENV:Header>


Using normal ESQL we can achieve it like following :-

SET OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Header.myNS2.(XML.NamespaceDecl)xmlns:"Siebel-header" = 'http://abcd.com' ;
SET OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Header.myNS2:SessionToken = Environment.Variables.SessionToken;

SET OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Header.myNS2:SessionType.(XML.NamespaceDecl)xmlns = 'http://abcd.com';
SET OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Header.myNS2:SessionType = 'Stateless';


How do we do the same using JAVA Compute node.

COuld anybody please help me out with this. Thanks in advance

rgds,
Intisam
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Wed Nov 26, 2008 1:32 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

If you are on v6.1 you could use XMLNSC instead of XMLNS.

This should be a good starting point for your Java question: http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/as07394_.htm

Remember that XML.NamespaceDecl is a field type. So you will need to use
Code:
myElement.setSpecificType(XML.NamespaceDecl)
or, if you decide to switch to XMLNSC:
Code:
myElement.setSpecificType(XMLNSC.NamespaceDecl)
Back to top
View user's profile Send private message
intisam
PostPosted: Wed Nov 26, 2008 4:42 am    Post subject: Reply with quote

Novice

Joined: 18 Mar 2008
Posts: 21

Thanks a lot for your reply.
I have done the same using the below step;

"outMessage.getRootElement().getLastChild().getFirstChild().createElementAsFirstChild(MbXMLNSC.ATTRIBUTE,"xmlns:tns","http://abcde.com);"

Please let me know if you have any opinion on this.

Regards,
Intisam
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Wed Nov 26, 2008 6:47 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Looks good to me. I forgot that createElementAsFirstChild() takes the field type as a parameter.

I presume you decided to switch the flow over to XMLNSC - otherwise your code would not be working!
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 » How to add namespaces using Java Compute Node to soap messag
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.