Author |
Message
|
broker_new |
Posted: Wed Jul 02, 2008 7:08 pm Post subject: Strange Problem using XML.Attr |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
<Information xmlns="http://www.ibm.com">
<userId>34566775</userId>
</Information>
Iam trying to create the above message using
SET OutputRoot.XMLNSC.Information.(XMLNSC.Attribute)xmlns = 'http://www.ibm.com';
SET OutputRoot.XMLNSC.Information.userId = '34566775';
iam getting the output as
<Information xmlns="" xmlns="http://www.ibm.com">
<userId>34566775</userId>
</Information >
Iam i doing anything wrong.
Last edited by broker_new on Wed Jul 02, 2008 7:55 pm; edited 2 times in total |
|
Back to top |
|
 |
broker_new |
Posted: Wed Jul 02, 2008 7:50 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
i have done some more research on this and changed xmlns to xmlns1 its working good.
<Information xmlns1="http://www.ibm.com">
<userId>34566775</userId>
</Information >
Why it is not taking xmlns as attribute or might be a bug in Broker.
Last edited by broker_new on Wed Jul 02, 2008 7:56 pm; edited 2 times in total |
|
Back to top |
|
 |
sami.stormrage |
Posted: Wed Jul 02, 2008 7:51 pm Post subject: |
|
|
 Disciple
Joined: 25 Jun 2008 Posts: 186 Location: Bangalore/Singapore
|
yeah your tags are incorrect  _________________ *forgetting everything * |
|
Back to top |
|
 |
broker_new |
Posted: Wed Jul 02, 2008 7:53 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
I got you.
<Information xmlns="http://www.ibm.com">
<userId>34566775</userId>
</Information>
I copied it wrong |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 02, 2008 7:57 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
broker_new wrote: |
i have done some more research on this and changed xmlns to xmlns1 its working good.
<Information xmlns1="http://www.ibm.com">
<userId>34566775</License>
</Information >
Why it is not taking xmlns as attribute or might be a bug in Broker. |
Quite obviously you did not disclose the full tree.
Correct placing of tags would show something like:
<Information xmlns1="http://www.ibm.com">
<userId>34566775</userId>
<License></License>
</Information >
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
broker_new |
Posted: Wed Jul 02, 2008 8:17 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
Iam posting you the exact ESQL and the output message
DECLARE mySoapNS NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE xsd NAMESPACE 'http://staples.com/xsd';
DECLARE soap NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE cert NAMESPACE 'http://staples.com/certify';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.(XMLNSC.NamespaceDecl)xmlns:"soap" = 'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.(XMLNSC.NamespaceDecl)xmlns:"cert" = 'http://staples.com/certify';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.(XMLNSC.NamespaceDecl)xmlns:"xsd" = 'http://ibm.com/xsd';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.soap:Body.Information.(XMLNSC.attr)xmlns = 'http://staples.com/certify/UserAdmin';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.soap:Body.Information.UserId = '34566775';
The result is
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cert="http://staples.com/certify"
xmlns:xsd="http://staples.com/xsd">
<soap:Body>
<Information xmlns="" xmlns="http://staples.com/certify/UserAdmin">
<UserId>34566775</UserId>
</Information>
</soap:Body>
</soap:Envelope> |
|
Back to top |
|
 |
dcjs |
Posted: Thu Jul 03, 2008 3:37 am Post subject: |
|
|
Acolyte
Joined: 10 Nov 2006 Posts: 53 Location: IBM Bangalore
|
I tried the same as you have done.
MQInput-->Compute---->MQOutput
ComputeNode ESQL is
DECLARE mySoapNS NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE xsd NAMESPACE 'http://staples.com/xsd';
DECLARE soap NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE cert NAMESPACE 'http://staples.com/certify';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.(XMLNSC.NamespaceDecl)xmlns:"soap" = 'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.(XMLNSC.NamespaceDecl)xmlns:"cert" = 'http://staples.com/certify';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.(XMLNSC.NamespaceDecl)xmlns:"xsd" = 'http://ibm.com/xsd';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.soap:Body.Information.(XMLNSC.attr)xmlns = 'http://staples.com/certify/UserAdmin';
SET OutputRoot.XMLNSC.mySoapNS:Envelope.soap:Body.Information.UserId = '34566775';
getting the same output
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cert="http://staples.com/certify"
xmlns:xsd="http://staples.com/xsd">
<soap:Body>
<Information xmlns="" xmlns="http://staples.com/certify/UserAdmin">
<UserId>34566775</UserId>
</Information>
</soap:Body>
</soap:Envelope>
What could be the reason...may be xmlns cannot be used as an attribute,has to be used only for namespaceDeclarations? _________________ TRY TRY UNTIL U SUCCEED |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 03, 2008 9:58 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Code: |
SET OutputRoot.XMLNSC.entry.(XMLNSC.NamespaceDecl)xmlns:xmlns |
The double xmlns:xmlns is the trick. Dunno why. |
|
Back to top |
|
 |
broker_new |
Posted: Thu Jul 03, 2008 11:43 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
Yes,
I tried almost everything and holding my head now.
It looks to be very very simple singleattribute for Information element.
Its tough to find what is the issue in using xmlns attribute. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 03, 2008 2:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
broker_new wrote: |
Yes,
I tried almost everything and holding my head now.
It looks to be very very simple singleattribute for Information element.
Its tough to find what is the issue in using xmlns attribute. |
There was something in some note IIRC that said you're not supposed to use the W3 XML notations like namespace and instance (xmlns, xsi) etc ... for anything else but what they were intended for by the W3 and XML boards.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jeeth_m |
Posted: Fri Jul 04, 2008 5:07 am Post subject: |
|
|
Voyager
Joined: 21 Jan 2002 Posts: 93
|
Try this code.
DECLARE mySoapNS NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE xsd NAMESPACE 'http://staples.com/xsd';
DECLARE soap NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE cert NAMESPACE 'http://staples.com/certify';
DECLARE JME NAMESPACE 'http://staples.com/certify/UserAdmin';
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:"soap" = 'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:"cert" = 'http://staples.com/certify';
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:"xsd" = 'http://ibm.com/xsd';
--Default namespace
SET OutputRoot.XMLNS.mySoapNS:Envelope.soap:Body.JME:Information.(XML.NamespaceDecl)xmlns = 'http://staples.com/certify/UserAdmin';
SET OutputRoot.XMLNS.mySoapNS:Envelope.soap:Body.JME:Information.JME:UserId = '34566775';
SET OutputRoot.Properties.MessageDomain = 'XMLNS';
RETURN TRUE;
END; |
|
Back to top |
|
 |
broker_new |
Posted: Sun Jul 06, 2008 5:17 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
Thanks a bunch for the solution jeeth_m.......It worked finally ... |
|
Back to top |
|
 |
|