xml as binary

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jagadam
Premium Member
Premium Member
Posts: 107
Joined: Wed Jul 01, 2009 4:55 pm
Location: Phili

xml as binary

Post by jagadam »

Hi All,

One of my requirement is sending the xml file as a binary to the webservices.

I have two questions regarding this.

1) Can we send the XML File as Binary..?

2) Can we send an XML file as an attachment to the webservices.

I searched the forum and couldnt find them.

Regards.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I'm not sure of what a binary XML file would look like, since the format of tags in XML uses certain (displayable) characters.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

agree with Arnd...xml is, by nature, character. There are binary things that happen with xml and web services, such as web services "SOAP with Attachments", and there are ways to carry binary data within xml (simple ways like using an extended hex notation is common).......but each are more specific than just "xml as binary"....

The Web Services pack does not support SOAP with Attachments. What exactly do you need to do?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
jagadam
Premium Member
Premium Member
Posts: 107
Joined: Wed Jul 01, 2009 4:55 pm
Location: Phili

Post by jagadam »

Hi Ernie,

I have a requirement where they(the client) are expecting to send an xml as an attachment to the webservices.

They gave a wsdl which has some thing like this.

s:element minOccurs="0" maxOccurs="1" name="Stream" type="s:base64Binary"

So my understanding is that we need to send an xml file as an attachment and it should be in binary(please correct me if iam wrong).

So trying to find out whether this is possible or not.

Regards.
jagadam
Premium Member
Premium Member
Posts: 107
Joined: Wed Jul 01, 2009 4:55 pm
Location: Phili

Post by jagadam »

Hi Ernie,

Thanks for the response.

I wanted to find out... how to convert the XML as a base64 binary..?

Any inputs would be of great help.

Regards.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

jagadam wrote:I have a requirement where they(the client) are expecting to send an xml as an attachment to the webservices.
Resist stupid requirements!

XML is a text-based standard.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

To Ray's point, you won't convert "the xml"....you would convert something that is carried "inside" the xml....

There are various ways to do this, (I like using Server with iconv/oconv), but once you have the hex value translated into character, you put it inside your tags....

For example, if my memory serves me correctly, the hex for 1234 is C1C2C3C4, so if this was the value for productID, you would end up with <productID>C1C2C3C4</productID> instead of <productID>1234</productID>.

Obviously you wouldnt need hex for this example, but if it was an unprintable set of values, like binary zeros or something, you'd want this technique.

Sounds like you need to find out more about EXACTLY what type of payload you need to be sending.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could always zip the XML. That would be binary.
:wink:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SBSA_DW2
Premium Member
Premium Member
Posts: 37
Joined: Fri Jul 25, 2008 1:24 am

Post by SBSA_DW2 »

ray.wurlod wrote:You could always zip the XML. That would be binary.
:wink:
Man am I glad I found this! :D
I want to send a zip file to MQ but am struggling to define the source to the MQ stage. If it's a compressed file, what do I specify in the sequential stage for the metadata? (original file is XML, but larger than life, thus the reason to compress the file before placing it on the Q)

Any other ideas on getting the zipped file onto the Q?

thanks guys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Glad you found this too, but less glad that you decided to hijack the thread you found it in. Please start your own post on this subject.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply