Author |
Message
|
soni |
Posted: Mon Oct 08, 2007 8:34 am Post subject: Extract a part of a xmlns |
|
|
 Novice
Joined: 08 Oct 2007 Posts: 15 Location: Spain
|
Hello world!!
I need help to extract a part of a input message (in xmlns). I have a input message like this:
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<Q1:BLOB_BO.xmlns:Q1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/BLOB_BO" version="3.0.0" verb="Create" locale="en_US" delta="false">
<Q1:BLOB>4a6f686e20416e74686f6e792052.......</Q1:BLOB>
<Q1:MetaData>
<Q2:JText_META_DATA xmlns:Q2="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/JText_META_DATA" version="3.0.0" verb="Create" locale="en_US" delta="false">
<Q2:InFileName>/wbiaappl/jtextsighn01/interfaces/out/One_line.in</Q2:InFileName>
</Q2:JText_META_DATA>
</Q1:MetaData>
<Q1:ObjectEventId>JTextConnector_1190272214492_1</Q1:ObjectEventId>
</Q1:BLOB_BO> |
This message has been sent by jtext adapter. And I need only the part that it is between <Q1:BLOB> tags. How can I do to send this part to the outroot?
Thanks |
|
Back to top |
|
 |
soni |
Posted: Tue Oct 09, 2007 12:34 am Post subject: |
|
|
 Novice
Joined: 08 Oct 2007 Posts: 15 Location: Spain
|
I try something like this:
Code: |
SET OutputRoot.XMLNS = InputRoot.XMLNS.*:BLOB_BO.*:BLOB; |
|
|
Back to top |
|
 |
AkankshA |
Posted: Tue Oct 09, 2007 12:47 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
soni wrote: |
I try something like this:
Code: |
SET OutputRoot.XMLNS = InputRoot.XMLNS.*:BLOB_BO.*:BLOB; |
|
did you try
SET OutputRoot.XMLNS.*:* = InputRoot.XMLNS.*:BLOB_BO.*:BLOB; _________________ Cheers |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 09, 2007 1:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Is this a workflow question? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
soni |
Posted: Tue Oct 09, 2007 5:29 am Post subject: |
|
|
 Novice
Joined: 08 Oct 2007 Posts: 15 Location: Spain
|
Thanks AkankshA to help me!
I tried it but now show this error:
"Caught exception and rethrowing. XML Writing Errors have occurred. No valid body of the document could be found."
Any idea?? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 09, 2007 5:58 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are the contents of the Q1:BLOB tag valid XML? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
soni |
Posted: Tue Oct 09, 2007 6:08 am Post subject: |
|
|
 Novice
Joined: 08 Oct 2007 Posts: 15 Location: Spain
|
Maybe the problem is that the content of the Q1:BLOB tag is in hexadecimal??  |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 09, 2007 6:12 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
soni wrote: |
Maybe the problem is that the content of the Q1:BLOB tag is in hexadecimal??  |
That would cause XML parsing errors, yes...
Have you considered searching around for 'base64'? I think you'll find a nice ESQL shortcut. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
soni |
Posted: Tue Oct 09, 2007 8:27 am Post subject: |
|
|
 Novice
Joined: 08 Oct 2007 Posts: 15 Location: Spain
|
I have looked for it but I didn't find it...
If I use something like this:
Code: |
SET OutputRoot.XMLNS.*:* = CAST(InputRoot.XMLNS.*:BLOB_BO.*:BLOB AS CHARACTER); |
Sorry I am very novice in MQ world
Thanks for everything |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 09, 2007 9:19 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
soni |
Posted: Tue Oct 09, 2007 9:41 pm Post subject: |
|
|
 Novice
Joined: 08 Oct 2007 Posts: 15 Location: Spain
|
|
Back to top |
|
 |
soni |
Posted: Tue Oct 09, 2007 11:34 pm Post subject: |
|
|
 Novice
Joined: 08 Oct 2007 Posts: 15 Location: Spain
|
I have tried to use this:
Code: |
CREATE PROCEDURE base64Decode(IN source CHAR)
RETURNS BLOB
LANGUAGE JAVA
EXTERNAL NAME "com.ibm.broker.javacompute.Base64.decode"; |
but WebSphere shows an error when I compile it...
We have a Message Broker v5, is necessary to have v6 to use this external procedure?
If I put:
Code: |
CREATE PROCEDURE base64Decode(IN source CHAR)
EXTERNAL NAME "com.ibm.broker.javacompute.Base64.decode"; |
it's ok when I compile it but I'm not sure that with this way it works well because it's not defined out param... |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Oct 09, 2007 11:48 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 10, 2007 1:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
That method may not exist on that class in v5.
This is an excellent flow to start migrating to v6 with... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|