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 construct CWF for variable length binary message?

Post new topic  Reply to topic
 How to construct CWF for variable length binary message? « View previous topic :: View next topic » 
Author Message
edtguy
PostPosted: Thu Oct 28, 2004 7:02 am    Post subject: How to construct CWF for variable length binary message? Reply with quote

Novice

Joined: 28 Oct 2004
Posts: 13
Location: Hoboken, NJ, USA

I am working with a black-box service that produces a Java JMS ObjectMessage. The format is as follows:

27 bytes - Java object serialization info
4 bytes - int, header length, value always 24
4 bytes - int, version, value currently 100
4 bytes - int, PDL, value currently 4
4 bytes - int, outputLength
4 bytes - int, messageLength, normally 0
4 bytes - int, userDataLength, normally 0
variable - binary, output of length outputLength
variable - string, message of length messageLength, normally empty
variable - binary, userData of length userDataLength, normally empty

I need to extract the contents of the output field and pass it as a blob to a custom node that performs base64 encoding.

Question: Can I define the MQInput Node as MRM and apply a schema, or do I have to define it as a Blob and issue a parse command in a compute node? What type do I assign the schema element that represents the "output" field? The output field holds the contents of a pdf file, and I want to make sure that no character translations are performed on the contents.

Either way, the result I'm looking for is an output message that is a blob containing only the contents of the "output" field from the input message.

TIA for any assistance,
Ed
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
kirani
PostPosted: Thu Oct 28, 2004 8:40 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

You can model this in MRM-CWF. For "variable" fields you can say the length is dependent on (Value of) outputLength, messageLength and userDataLength fields. You can define the binary fields as BINARY data type in your MRM-CWF message.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
edtguy
PostPosted: Thu Oct 28, 2004 11:34 am    Post subject: Reply with quote

Novice

Joined: 28 Oct 2004
Posts: 13
Location: Hoboken, NJ, USA

Thanks for getting me started. Being new to this, I'm a bit confused on some points:

>> You can model this in MRM-CWF

Ok, I've defined a new message set with Default Wire Format = CWF1 and Runtime Parser = MRM. I have not made any changes to the physical properties of CWF1, as I don't think I have any special needs there.

>>For "variable" fields you can say the length is dependent on (Value of) outputLength, messageLength and userDataLength fields. You can define the binary fields as BINARY data type in your MRM-CWF message.

I've created a new message definition file. The first element is of type stuff, based on xsd:anyURI, with a length constraint of Length = 27.
The next 6 elements are all xsd:int.
Now that I'm ready to define "output", I don't see an element type of BINARY. Is this a simple type I'm supposed to define based on xsd:anyURI? As for the length, how do I set the dependency on the value of outputLength? When I try to type "(Value of) outputLength" in the length constraint Length field, I see the warning, "The length facet value '(Value of) outputLength' must be greater than 0 and less than or equal to 2147483647 for simple type '#BINARY'". Am I trying to define this dependency in the wrong place?

Thanks again for any assistance.

-Ed
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
kimbert
PostPosted: Fri Oct 29, 2004 1:02 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I have not made any changes to the physical properties of CWF1, as I don't think I have any special needs there.

Remember that WMQI separates the logical model from the physical model. You have only set up the logical model. All the rest of your problems stem from this basic misunderstanding.

Quote:
The first element is of type stuff, based on xsd:anyURI, with a length constraint of Length = 27
That length constraint is in the logical model. It will only be used if you enable validation. It has absolutely no effect on the CWF parser. You must set the CWF length to 27 for this field.

Quote:
Now that I'm ready to define "output", I don't see an element type of BINARY.
You need to set the type to either 'hexBinary' or 'base64Binary'. I sounds as if 'base64Binary' might be the one you want. Either way, check the CWF physical properties, and ensure that the 'Encoding' property is set to 'base64'.

Quote:
When I try to type "(Value of) outputLength" in the length constraint Length field, I see the warning, "The length facet value '(Value of) outputLength' must be greater than 0 and less than or equal to 2147483647 for simple type '#BINARY'". Am I trying to define this dependency in the wrong place?
Yes, but you probably know the answer by now. You need to set this in the CWF physical properties.


Hope this helps.
Back to top
View user's profile Send private message
edtguy
PostPosted: Thu Nov 04, 2004 7:11 am    Post subject: Reply with quote

Novice

Joined: 28 Oct 2004
Posts: 13
Location: Hoboken, NJ, USA

After a somewhat painful upgrade from WIN2000 to WINXP, I've reinstalled the message broker, and I'm trying to find where in the editor to define the physical layout for the CWF. The on-line help is not providing much insight. Is there some edit panel that is activated by some special control key sequence that only works on Tuesdays?
I've created a new message set project and message set. In the message set editor, I right-clicked on Physical Properties in order to define a custom wire format. I set the message set's default wire format to that newly created definition. I don't see anything in the panel for the custom wire format that allows me to specify the physical layout. I assume that when I create a message definition file, this is only the logical layout.
I'm not making the connection between the logical definition and the physical definition.
Can someone help me out with what I'm missing?
-Ed
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
kimbert
PostPosted: Thu Nov 04, 2004 8:23 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Fear not - it's easier than you think. (but you have my sympathy if you're finding the learning curve a little steep at first).
If you look in the upper-right panel of the message editor (the one which shows the spreadsheet-like view), you will notice that there are two tabs at the bottom labelled 'Overview' and 'Properties'. If you switch to 'Properties' you will see a tree on the left and a properties panel on the right. In the tree, select the node 'CWF1' and the CWF properties for the selected object will appear.
As a general hint, its best to keep using the 'Properties' view, and do any selection of objects via the 'Outline' view at the lower left.
Back to top
View user's profile Send private message
edtguy
PostPosted: Thu Nov 04, 2004 10:40 am    Post subject: Reply with quote

Novice

Joined: 28 Oct 2004
Posts: 13
Location: Hoboken, NJ, USA

Thanks! I always seem to expect to find tabs at the top of a pane and forget to look for them at the bottom.
I think my other mistake is that I was only defining Elements and Types which have no corresponding physical properties, whereas it is the elements under Messages that have corresponding physical properties.
Thanks again!
-Ed
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
kimbert
PostPosted: Fri Nov 05, 2004 1:20 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Glad you're back on track.
I should have mentioned that CWF properties only appear when the element/attribute is included within a type. Note that CWF is unique in this respect - TDS and XML properties are associated with the element/attribute itself.
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 construct CWF for variable length binary message?
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.