|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[SOLVED] Unable to respond to UPES message in MQ |
« View previous topic :: View next topic » |
Author |
Message
|
Kumarakuru |
Posted: Tue Feb 12, 2008 12:19 am Post subject: [SOLVED] Unable to respond to UPES message in MQ |
|
|
Novice
Joined: 21 Jan 2008 Posts: 17
|
Hi,
Im using .NET api's to manipulate the MQ series. With the workflow,im able to dump XML message to a queue manager->Queue. I want to respond back to this message, so that the activity can finish. But my responses are not understood by workflow, I dont know the exact way of responding.
The message in the queue is
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- This document is generated by a MQSeries Workflow Version 3.6.0 server -->
<WfMessage>
<WfMessageHeader>
<ResponseRequired>Yes</ResponseRequired>
</WfMessageHeader>
<ActivityImplInvoke>
<ActImplCorrelID>RUEAAAABAAiABAAAAAAAAAAAAAAAAgAAAAEABoAAAAAAAAAAAAAAAAACQQAAAAEACIAGAAAAAAAAAABF</ActImplCorrelID>
<Starter>ADMIN</Starter>
<ProgramID>
<ProcTemplID>UQAAAAEABoAAAAAAAAAAAABR</ProcTemplID>
<ProgramName>AutoTask</ProgramName>
</ProgramID>
<ImplementationData>
<ImplementationPlatform>WindowsNT</ImplementationPlatform>
<ExeOptions>
<PathAndFileName>auto.bat</PathAndFileName>
<InheritEnvironment>true</InheritEnvironment>
<StartInForeGround>true</StartInForeGround>
<WindowStyle>Minimized</WindowStyle>
</ExeOptions>
</ImplementationData>
<ProgramInputData>
<_ACTIVITY>UPES</_ACTIVITY>
<_PROCESS>T1</_PROCESS>
<_PROCESS_MODEL>TestQ</_PROCESS_MODEL>
<OrderFulfillmentDS>
<OrderedItem>
<ProdID>ProdId</ProdID>
<Qty>10</Qty>
<Total>25</Total>
</OrderedItem>
<CustID>CustID</CustID>
</OrderFulfillmentDS>
</ProgramInputData>
<ProgramOutputDataDefaults>
<_ACTIVITY>UPES</_ACTIVITY>
<_PROCESS>T1</_PROCESS>
<_PROCESS_MODEL>TestQ</_PROCESS_MODEL>
<OrderFulfillmentDS>
</OrderFulfillmentDS>
</ProgramOutputDataDefaults>
</ActivityImplInvoke>
</WfMessage>
My reply XML is:
<WfMessage>
- <WfMessageHeader>
<ResponseRequired>No</ResponseRequired>
</WfMessageHeader>
- <ActivityImplInvokeResponse>
<ActImplCorrelID>RUEAAAABAAfAFgAAAAAAAAAAAAAAAgAAAAEABoAAAAAAAAAAAAAAAAACQQAAAAEAB8AYAAAAAAAAAABF</ActImplCorrelID>
<ProgramRC>0</ProgramRC>
- <ProgramOutputData>
- <OrderFulfillmentDS>
- <OrderedItem>
<ProdID>ProdId</ProdID>
<Qty>10</Qty>
<Total>25</Total>
</OrderedItem>
<CustID>CustID</CustID>
</OrderFulfillmentDS>
</ProgramOutputData>
</ActivityImplInvokeResponse>
</WfMessage>
My Code to write data to queue is:
MQMessage mqwMsg = new MQMessage();
mqwMsg.ReplyToQueueManagerName = "FMCQM";
mqwMsg.ReplyToQueueName = ReplyToQueue;
mqwMsg.CorrelationId = Cor;
mqwMsg.WriteString(strData); (my above XML)
mqwMsg.Format = MQC.MQFMT_STRING;
MQPutMessageOptions mqPutMsgOpts = new MQPutMessageOptions();
mqQueue.Put(mqwMsg, mqPutMsgOpts);
Is this the right way?, am I missing something, please help....
Last edited by Kumarakuru on Tue Feb 12, 2008 10:59 pm; edited 1 time in total |
|
Back to top |
|
 |
jmac |
Posted: Tue Feb 12, 2008 6:22 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Looks to me like your correlation ID is not matching. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
Kumarakuru |
Posted: Tue Feb 12, 2008 9:15 pm Post subject: Unable to respond to UPES message in MQ |
|
|
Novice
Joined: 21 Jan 2008 Posts: 17
|
I've corrected the correlId and used WriteUTF instead of WriteString, MessageType = Request, Persistence and all. Still Im unable to determine why the workflow doesnt pickup the reply.
Moreover when I terminate the workflow using the workflow client, it writes XML to the queue, I examined it, and the only difference I can make out is the User Id (context), for the workflow (triggered by fmcemain.exe) it is admin, and for me it is FMC, and I dont know how to set this (Setting Message.UserId has no effect and also the alternate user id (used in contructor) has no effect.... ) .
Any further help..... ?? |
|
Back to top |
|
 |
Kumarakuru |
Posted: Tue Feb 12, 2008 10:58 pm Post subject: [SOLVED] Unable to respond to UPES message in MQ |
|
|
Novice
Joined: 21 Jan 2008 Posts: 17
|
I cracked it, the answer lies in ReplyToQueue. It goes like this
The queue to which UPES dumps XML is defined by us, but the queue to which workflow listens is different, it is <prefix>.<SystemGroupName>.<SystemName>.EXE.XML (which you can get it from the ReplyToQueueName of the queue to which you have written.
So the access queue itself should be the Above said queue, and other property entries such as ReplyToQueue are ignored.
Note: If anyone need the code, let me know so that i can post it later, so this forum is clean untill then.....
Thanks everyone |
|
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
|
|
|
|