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 » IBM MQ API Support » Writing Delphi APP with SOAP/JMS/MQ

Post new topic  Reply to topic Goto page 1, 2  Next
 Writing Delphi APP with SOAP/JMS/MQ « View previous topic :: View next topic » 
Author Message
francoG
PostPosted: Thu Aug 18, 2011 4:40 am    Post subject: Writing Delphi APP with SOAP/JMS/MQ Reply with quote

Novice

Joined: 18 Aug 2011
Posts: 23

Hello,
I have already developed a Client Application that is able to send a SOAP request to a SOAP server over http (and https) and for this I get no big trouble by using the simple standard THTTPRIO component supplied by Borland.

But Now I need to develop a client application that must send SOAP request ( and of course read SOAP response) to a server that respond on a JMS over MQ transport.
I spent a lot of time googling without finding a clear answer: sombody says that is a hard task or that is even not possible at all.

Does anybody have experiences on writing Delphi apps that speak "SOAP" over JMS ( and IBM MQ) ?

I already seen the MQIC.Pas file and the Dinko Miljak's library but I still have a gap between SOAP and MQ.

That is: Wheneer I have a valid XML document, How I can send it to the server? I only need to call MQPUT ? Mhmm I don't think it is so easy!
Are there any component or library I can Use to do this?

Please Help me!

Many thanks
Franco
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Aug 18, 2011 4:54 am    Post subject: Re: Writing Delphi APP with SOAP/JMS/MQ Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

francoG wrote:
Does anybody have experiences on writing Delphi apps that speak "SOAP" over JMS ( and IBM MQ) ?


Don't think of WMQ and JMS as 2 different things. There is the "native" WMQ, which includes MQPUT and it's friends, and the JMS which WMQ supports.

So if you can find a way to include a JMS library inside Delphi you're fine. Once you've built the SOAP obviously.

FWIW I linked a Delphi app with WMQ using the native interface once, just after the glaciers melted and we'd converted the computers to use electricity rather than steam boilers. It was 1997 and I wrote a C module that wrapped up the MQ calls. The Deplhi app passed over object names and payload, my module built the data structures and did the call.

Worked in so far as it sent & recieved messages. Never went live as we abandoned Delphi. Well the whole project got abandoned eventually, but Delphi went early.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Aug 18, 2011 5:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You don't explicitly mention which platform you're running on.

Looking at this, if you are running on Windows then your best bet is to figure out how to talk WCF from Delphi.

If you're not running on Windows... then you need to look at using Axis somehow.

You should at least spend some time reviewing that link and the rest of the manual it sits in.
Back to top
View user's profile Send private message
francoG
PostPosted: Thu Aug 18, 2011 12:33 pm    Post subject: Reply with quote

Novice

Joined: 18 Aug 2011
Posts: 23

Dear Vitor
Dear Mqjeff
Thank you for your prompt reply,
just to be more precise:
I normally develop application in Delphi... this because I (we) have 13 years of history and million of lines of code, so It hard to think to move out...

anyway, this last challenge is to build a client application (more or less like another we have just done 1 years ago) but instead to have a SOAP/HTTP server to talk to, we have a SOAP/JMS/WMQ
the platform for the client is Windows the server is Websphere (of course).

now I have to decide where I have to cut the delphi application ( that do the main dirty job of collecting data from DB, then map each DB columns into the appropriate XML fields, then send it to the server then receive the response and map xml fields back to appropriate db columns, after IThad managed errors)
transmission part is easy while I have a component that send/recieve the XML to /from the SOAP SERVER. the name of the componet is HTTPRIO : as the name says, it works thinking thaT soap is only over HTTP

so the gap is that: despite I can speak MQish with delphi, I cannot tell to HTTPRIO to speak with MQ....

I never declined challenges, but I unfortunately have only a couple of mounths to do everything so it is very improbale I can write even 2 layer of OSI model just to go from SOAP to JMS.
I need to find a delphi component or I have to find out another solution, like develop a Java app that works like a gateway from my delphi app and the WEBSphere.

Any suggestions will be appreciated as the water in the desert.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Aug 18, 2011 12:38 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

francoG wrote:
I have to find out another solution, like develop a Java app that works like a gateway from my delphi app and the WEBSphere.


Like I said, that's what I did the 1 time I tried this. In C rather than Java but I don't see that's a significant difference. And Java might be eaiser given JMS (which wasn't around when I did it).

And remember always: WMQ = JMS. You don't need anything that goes SOAP -> JMS -> WMQ. You go SOAP -> JMS or SOAP -> WMQ as you see fit.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
francoG
PostPosted: Sun Aug 21, 2011 11:57 pm    Post subject: Reply with quote

Novice

Joined: 18 Aug 2011
Posts: 23

Hi Vitor,
This is confusing me:

Quote:
and remember always: WMQ = JMS. You don't need anything that goes SOAP -> JMS -> WMQ. You go SOAP -> JMS or SOAP -> WMQ as you see fit.


I found a component for Delphi (http://www.habarisoft.com/habari.html) . It works over ActiveMQ, OpenMQ and Hornet Q but it has no support for IBM MQ.
( I ask this to Habary and they say "NO support for IBM")
so MQ is not really = JMS ....or better: is not always *MQ = *MQ

Anyway even with that Component I always be one step far from the solution : How I can do the SOAP communication with JMS?
Do you think is enought to prepare a XML doc, connect with a remote Queue and perform a MQPut?
Let's say....it sound me too easy!
Franco
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 22, 2011 4:18 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

francoG wrote:
I found a component for Delphi (http://www.habarisoft.com/habari.html) . It works over ActiveMQ, OpenMQ and Hornet Q but it has no support for IBM MQ.
( I ask this to Habary and they say "NO support for IBM")
so MQ is not really = JMS ....or better: is not always *MQ = *MQ


Ok, I don't know the product you're talking about so view my comments in this light.

But it's a fact that WMQ does have 2 interfaces; its own (which I would theorise this product does not support) and a JMS interface which, as the name suggests (given the S in JMS) is a standard JMS provider which should in theory work with any JMS-aware application. Lord knows my Java's not great, but even I know that.

francoG wrote:
How I can do the SOAP communication with JMS? Do you think is enought to prepare a XML doc, connect with a remote Queue and perform a MQPut?


Well I think you need to ensure your XML document conforms to the SOAP framework but yes, that's about it.

francoG wrote:
Let's say....it sound me too easy!


I'm sure you can find a way to make it harder if you want. SOAP is a messaging and transport standard, not brain surgery.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
francoG
PostPosted: Mon Aug 22, 2011 6:15 am    Post subject: Reply with quote

Novice

Joined: 18 Aug 2011
Posts: 23

Hi Vitor!
Well, well, well!

you are saying me that it is so easy?
because:
1 writing the xml for me is not a problem
2 writing the Soap Header, the Soap body: idem, is not a problem
3 writing SOAP comforming the customer very intricated specifics....ok I'm working on it but I will get it...
4 sending the SOAP via MQI ( bypassing JMS because I dont'Have it)
is not a problem by using the one of the two library of MQI interface from IBM....

so that: I should.. I could... I can...!

Ok I will try it.

one more thing:
One or two of the message I have to call in SOAP is a function that allow me to send / receive a big amount of data to the server ( a sort of Upload/download information for massive computation )
Do you know if there are size limitation in sending data over MQ?
That is: should I have to think about a sort of fileUpload that split the doc in small truncs to send the whole file.... or I'm doing again a useless demage of my brain?
Franco
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 22, 2011 6:31 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

francoG wrote:
Do you know if there are size limitation in sending data over MQ?


By OTB default WMQ limits a single message to 4Mb. If you speak to whoever administers your WMQ software they can increase that (if they've not already) to the software limit of 100Mb per message (messages that size cause decisions their end which are not your problem as an application developer). If you need to send more than 100Mb:

a) that's a big SOAP message
b) Look up "segmentation" in the WMQ documentation

francoG wrote:
I'm doing again a useless demage of my brain?


I think you should consider sitting back and letting this very expensive piece of IBM software do the heavy lifting for you.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
francoG
PostPosted: Thu Aug 25, 2011 7:47 am    Post subject: Reply with quote

Novice

Joined: 18 Aug 2011
Posts: 23

Hi Vitor,
it's me again.
I continue to study my soulution for Delphi/Soap/JMS/MQ
you one wrote me that JMS = MQ
I found an example on how I should write this specific program....
this is the comment I found:
/* Wrapper around the native MQ API for communication in a JMS like fashion.
* Properties are rendered in a newly generated RFH2-Header.
*/
public class MqRfh2Wrapper{ etc...

does this sound you as already known?

I then google "RFH2" and I found this http://fmair.blogspot.com/2011/02/roll-your-own-rfh2-header-for-websphere.html
where he wrote more or less the same scenario i should have.

So that here seems ( may it be, may it not) that I need to put a RFH2 header over my payload ( i.e. an xml/soap document) before sending it over the MQ....to be JMS compliant...

1st question: how I can be sure of this?

2nd question : do I have to worry about this?

Franco
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Aug 25, 2011 8:00 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

francoG wrote:
does this sound you as already known?




francoG wrote:
So that here seems ( may it be, may it not) that I need to put a RFH2 header over my payload ( i.e. an xml/soap document) before sending it over the MQ....to be JMS compliant...


We started at the top of this thread with you saying that you wanted "SOAP over JMS" rather than "SOAP over http". Now do you mean:

a) SOAP over JMS because the SOAP message is being consumed by a JMS application
b) SOAP over JMS because the consuming application wants to use a queue rather than http & is using "JMS" as shorthand for "some queueing mechanism"

If a) then you need to make your message JMS compliant. If b), you don't.

And you don't need to put an RFH2 on the message if you use a Java module with the JMS library included to send the message; it does it for you. My comment about letting the software do the heavy lifting applies here.

francoG wrote:
1st question: how I can be sure of this?


Work out what you need to do, probably with reference to whoever's developing the consuming application.

francoG wrote:
2nd question : do I have to worry about this?


Yes. If the consuming application gets a message in a format it doesn't expect (either with JMS information included it doesn't expect or with required JMS information missing) then it's probably going to react badly. It's certainly unlikely to work correctly IMHO.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
francoG
PostPosted: Sun Aug 28, 2011 11:03 pm    Post subject: Reply with quote

Novice

Joined: 18 Aug 2011
Posts: 23

I vitor,

Quote:
We started at the top of this thread with you saying that you wanted "SOAP over JMS" rather than "SOAP over http".

I apolige myself if i miss some information. I'm reading the documentation of the system ( Soap/JMS/MQ Server) I have to interface to.
Unfortunately documentation is huge an written in german, and have only to thank you and some other friends, if I can better understand it.
Anyway,here is The transaltion of a chapter describing the standard the system have to follow.
The Web Service uses the Simple Object Access Protocol SOAP v1.1 as protocol.
In order to guarantee a high interoperability, a compilance of the WSDL to „WS-I Basic Profile v1.1“ is approached by valition.
For the implementation of the Web service is used the infrastructure of JAX.RPC. This Implementazion is basically conforming to „JSR-109 Web Services for Java EE v1.3“ and to „WS-I Basic Profile v1.1“.
IT IS NOT POSSIBILE TO guarantee 100% compatibility to SOAP over JMS protocol (in fact SOAP over JMS Protocol is not conforming to WS-I BP). Non-conformity to SOAP over JMS must be therefore ignored.


So I tzhink the answer to your question is :
Quote:
a) SOAP over JMS because the SOAP message is being consumed by a JMS application

So I think I need to add a RFH2 header...
to do that I transalte in Pascal the example given in the documentation ( the public class MqRfh2Wrapper... ) .
the only problem I have now ( until the next ) if that it seems I should have come function defined here:
import com.ibm.mq.MQC;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;

but, As I wrote you, I only have the simply MQI interface for Delphi.....I heard about an Activex could It help me? If Yes where I can download it?.

Franco
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 29, 2011 4:31 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

francoG wrote:
but, As I wrote you, I only have the simply MQI interface for Delphi


Why? If you can import these, why can you not import the JMS? Or use these to communicate with a JMS app that can add the headers for you?

francoG wrote:
I heard about an Activex could It help me? If Yes where I can download it?.


a) I don't see how it will do much more than what you have
b) Wherever (or whoever) you heard it will have the details on how to download it
c) The ActiveX control is depriciated (so shouldn't be used in new development) and doesn't work that well on versions of WMQ past v5.3 (or on the 2 occassions I've seen it attempted on v6 & v7 it's not worked)
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 29, 2011 6:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

francoG wrote:
So I think I need to add a RFH2 header...

Can you explain why you would think that?
A message can be read / written in JMS without using the RFH2...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Aug 29, 2011 6:05 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fjb_saper wrote:
francoG wrote:
So I think I need to add a RFH2 header...

Can you explain why you would think that?


I feel this is the impression I have given per pro the JMS application.

fjb_saper wrote:

A message can be read / written in JMS without using the RFH2...


Yes, but only if the JMS applcation concerned agrees. I believe we've established futher up the thread that this application does expect the headers.

But this whole thread is built on assumptions, supositions and mismatched technologies....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » Writing Delphi APP with SOAP/JMS/MQ
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.