|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
.Net Client to .Net WebService using SOAP over MQ |
« View previous topic :: View next topic » |
Author |
Message
|
lincoln42 |
Posted: Tue Sep 23, 2008 1:11 am Post subject: .Net Client to .Net WebService using SOAP over MQ |
|
|
Newbie
Joined: 23 Sep 2008 Posts: 2
|
Environment
Windows XP Professional 2002 Service Pack 2
MQ V6 with Maintenance pack 2.1
Microsoft .NET runtime 3.5
MQ Queue manager installed locally, called 'QM_LOCAL'
Problem
I am trying to run some of the .Net examples supplied with MQ v6. I have run the amqwdeployWMQService utility against the supplied 'StockQuoteDotNet.asmx' webservice and have got it to generate the proxy and wsdl. Created the required resuect and response queues and server connection channel as well as a TCP listener on the queue manager.
The URI supplied to the deployment utility was
"jms:/queue?destination=SQ.REQUEST@QM_LOCAL&connectionFactory=(connectQueueMana" +
"ger(QM_LOCAL))&initialContextFactory=com.ibm.mq.jms.Nojndi&targetService=StockQu" +
"oteDotNet.asmx&replyDestination=SQ.RESPONSE"
I then started up a new Visual Studio project and included the supplied client, 'SQCS2DotNet.cs' and the generated proxy and a reference to the amqsoap.dll and compiled the whole project.
I then started the generated SOAP listener using the generated 'startWMQNListener.cmd' batch file. With the SOAP listener running I run the client but get the Error shown below
>>> EXCEPTION WHILE RUNNING SQCS2DotNet DEMO <<<
System.InvalidOperationException: Response is not well-formed XML. ---> System.X
ml.XmlException: Element 'Envelope' was not found. Line 1, position 2.
Has anyone tried to use SOAP over MQ with .Net WebServices and Clients? If so what is causing this to happen? What am I missing and how do I get it to work? Please advise |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Sep 23, 2008 8:29 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
>>> EXCEPTION WHILE RUNNING SQCS2DotNet DEMO <<<
System.InvalidOperationException: Response is not well-formed XML. ---> System.X
ml.XmlException: Element 'Envelope' was not found. Line 1, position 2. |
I don't quite understand your question. The exception seems quite clear and does not point to your setup. What is the data in the response message? This message leads me to believe that the response message might not be soap...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
lincoln42 |
Posted: Wed Sep 24, 2008 2:32 am Post subject: |
|
|
Newbie
Joined: 23 Sep 2008 Posts: 2
|
The webservice is returning a float value to the client via the proxy, the method is marked as a SoapRpc method. Essentially the IBM redbook 'WebSphere MQ Version 6 and Web Services' says the once you have generated an MQ SOAP aware proxy for a given .Net WebService by using their utility all that remains to be done to communicate with the WebService using MQ as the transport is to setup the MQ request and response queues and server conn channel, start the SOAP listener, include the proxy in the client and register IBM MQ as the transport in the client code and then simply call methods on the Web Service via the proxy. See Chapters 10 and 11 of the redbook mentioned above to get more detail on what I am trying to do. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 25, 2008 9:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
lincoln42 wrote: |
The webservice is returning a float value to the client via the proxy, the method is marked as a SoapRpc method. Essentially the IBM redbook 'WebSphere MQ Version 6 and Web Services' says the once you have generated an MQ SOAP aware proxy for a given .Net WebService by using their utility all that remains to be done to communicate with the WebService using MQ as the transport is to setup the MQ request and response queues and server conn channel, start the SOAP listener, include the proxy in the client and register IBM MQ as the transport in the client code and then simply call methods on the Web Service via the proxy. See Chapters 10 and 11 of the redbook mentioned above to get more detail on what I am trying to do. |
Also make sure you use a bytesMessage if you use SoapRpc or attachments etc...
I thought there might be a limitation that said you should not use SoapRpc.
Haven't read the doc in detail so I may be mistaken. It is more complex because you are now on an asynchronous model. So if the destination does not do SoapRpc, instead of detecting this right away you may just see that nothing works....
You previous message says you do not have a well formed xml message.
Examine the message with some tool like RFHUTIL and make sure you have well formed xml. This could be a provider error.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|