Author |
Message
|
Rajat |
Posted: Mon Jul 09, 2012 3:45 am Post subject: MIME + XML in HTTP Request node |
|
|
Novice
Joined: 26 Nov 2009 Posts: 15
|
Hello Guys,
I have a requirement where I need to expose a service(single URL) which can accept both MIME and XML messages i.e either we will receive a XML or MIME.
Example : Document service, where you can receive a insert document request(MIME) or search document request(XML). This needs to be exposed via same URL.
Input(MIME) -> INSERT -> Output(XML)
Input(XML) ->SEARCH -> Output(XML)
Input(XML) -> RETREIVE -> Output(MIME)
Thanks in advance |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Jul 09, 2012 5:00 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Thats a great requirement. Let us know how you implement it. Should be very easy with WebSphere Message Broker. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Rajat |
Posted: Mon Jul 09, 2012 5:11 am Post subject: |
|
|
Novice
Joined: 26 Nov 2009 Posts: 15
|
Actually I have to implement in Message Broker only. Could you suggest what are the possible ways of doing it. I am really sorry If I am asking something very basic. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jul 09, 2012 5:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Rajat wrote: |
Could you suggest what are the possible ways of doing it. |
I'd suggest writing a message flow.
Rajat wrote: |
I am really sorry If I am asking something very basic. |
It's so basic I don't understand the problem. You're receiving something via a URL (http or SOAP). You process this and output a result. And?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Jul 09, 2012 5:21 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
Rajat |
Posted: Mon Jul 09, 2012 5:22 am Post subject: |
|
|
Novice
Joined: 26 Nov 2009 Posts: 15
|
I want to use a HttpInputNode but if I configure it for MIME then it is not parsing just XML messages and as explained above I have requirement like this
Input(MIME) -> INSERT -> Output(XML)
Input(XML) -> SEARCH-> Output(XML)
Input(XML) -> RETREIVE -> Output(MIME)
Hope this makes more sense. Please let me know If I am still not clear. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Jul 09, 2012 5:41 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Have you attended the training class? have you read the InfoCentre? If you have done both of these things, which one is unclear? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jul 09, 2012 5:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Rajat wrote: |
I want to use a HttpInputNode but if I configure it for MIME then it is not parsing just XML messages |
So you have 2 difference possible input formats, and you can only set 1 format on the input node. We know that & you've discovered it. So you'll need to come up with some means of accepting a generic format message, discovering which of the possible types it is and then handling it.
We call that "development", or more loosely "working for a living".
1 viable alternative is to push back on the requirement. It's certainly questionable to have 3 operations (insert, search, retrieve) on a single URL as an http POST. Another would be to use SOAP rather than http, have the 3 operations litterally as 3 operations in the WSDL and make all your problems disappear as WMB will then work it out for you.
As it is, you'll just have to code for it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Rajat |
Posted: Mon Jul 09, 2012 8:39 am Post subject: |
|
|
Novice
Joined: 26 Nov 2009 Posts: 15
|
Thanks Vitor..
Is it a good idea to accept messages as BLOB and later parse it in MIME or XML formats depending on the opeartion invoked in case I am using HTTPInputNode ? |
|
Back to top |
|
 |
MBMQDeveloper |
Posted: Mon Jul 09, 2012 9:36 pm Post subject: |
|
|
Novice
Joined: 02 Jul 2012 Posts: 19
|
Accepting as BLOB would require you to convert the message back to MIME/XML for further processing which would affect your performance.
What about using a message set that can accept both XML and MIME? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jul 10, 2012 4:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
MBMQDeveloper wrote: |
Accepting as BLOB would require you to convert the message back to MIME/XML for further processing which would affect your performance. |
Not significantly.
MBMQDeveloper wrote: |
What about using a message set that can accept both XML and MIME? |
You mean code a DFDL message set that determines if the first character of the message is "<" or not?
That's a *terrible* idea. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 10, 2012 5:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Rajat wrote: |
Is it a good idea to accept messages as BLOB and later parse it in MIME or XML formats depending on the opeartion invoked in case I am using HTTPInputNode ? |
It's an idea, I'm unconvinced it's a good idea or the best idea.
Are you using the HTTPInputNode for a valid reason or just because you've been told to? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 10, 2012 5:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MBMQDeveloper wrote: |
What about using a message set that can accept both XML and MIME? |
That's like cutting your hair with a chain saw; there's a good chance you can achieve something in the direction of hair cutting but there are a number of issues to overcome and the odds of a serious problem are high.... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|