|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Exception in HTTPRequest Node |
« View previous topic :: View next topic » |
Author |
Message
|
Thripura Sundari |
Posted: Sat Jul 16, 2005 4:24 am Post subject: Exception in HTTPRequest Node |
|
|
Acolyte
Joined: 13 Jun 2005 Posts: 57 Location: Bangalore, India
|
Hi all,
I have a simple message flow which is as follows:
MQInput->Compute->HTTPRequest->MQOutput.
I have given Trace and MQOutput nodes accordngly for the errors, failures and exceptions.
The ESQL in the compute node is as follows:
Code: |
CREATE COMPUTE MODULE testmsgflow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
SET Environment.myMQMD = InputRoot.MQMD;
SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.Properties.MessageFormat = 'XMLNS';
SET OutputLocalEnvironment = InputLocalEnvironment;
-- Create an HTTP header for the message
SET OutputRoot.HTTPRequestHeader.SOAPAction = 'http://tempuri.org/productName';
-- Declare the XML namespaces we will be using
DECLARE mySoapNS NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE myNS1 NAMESPACE 'http://tempuri.org/';
DECLARE myXSI NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';
DECLARE myXSD NAMESPACE 'http://www.w3.org/2001/XMLSchema';
-- Add an XML declaration to the message
SET OutputRoot.XMLNS.(XML.XmlDecl) = '';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Encoding) = 'UTF-8';
-- Create the SOAP Envelope
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:"SOAP-ENV" ='http://schemas.xmlsoap.org/soap/envelope/' ;
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance' ;
SET OutputRoot.XMLNS.mySoapNS:Envelope.(XML.NamespaceDecl)xmlns:xsd = 'http://www.w3.org/2001/XMLSchema' ;
-- Set the operation name and parameters
SET
OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Body.productName.(XML.NamespaceDecl)xmlns:ns1 = 'http://tempuri.org/';
--SET
--OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Body.productName.pdtName.(XML.Attribute)myXSI:type = 'xsd:string';
--SET
--OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Body.myNS1:userName.(XML.NamespaceDecl)mySoapNS:encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
SET OutputRoot.XMLNS.mySoapNS:Envelope.mySoapNS:Body.productName.pdtname= 'Cruise';
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
END MODULE;
|
I have hard coded the input value, so it doesnot matter what is the message given to the MQInput node.
I can read the HTTPRequestHeader from the flow which is similar to the format in the SOAP which is as follows:
Code: |
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<productName xmlns="http://tempuri.org/">
<pdtname>string</pdtname>
</productName>
</soap:Body>
</soap:Envelope>
|
I am getting the exception that the Message doesnt contain a valid MQMD.
The trace after the exception has occured which was caught at the MQInput node is as follows:
Code: |
(
(0x01000000):Properties = (
(0x03000000):MessageSet = 'testmsgset (BU095QO002001)'
(0x03000000):MessageType = 'productName'
(0x03000000):MessageFormat = 'XML1'
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2005-07-16 11:54:51.700'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'TESTIN'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 273
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d51205742524b5f514d2020202020e9aed8422000142e'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'WBRK_QM '
(0x03000000):UserIdentifier = 'db2admin '
(0x03000000):AccountingToken = X'16010515000000b4b7cd227ceb240d07e53b2bf503000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 'MB\eclipse\jre\bin\javaw.exe'
(0x03000000):PutDate = DATE '2005-07-16'
(0x03000000):PutTime = GMTTIME '11:54:51.700'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000010):XML = (
(0x05000018):XML = (
(0x06000011): = '1.0'
(0x06000012): = 'utf-8'
)
(0x01000000):productName = (
(0x01000000):pdtname = (
(0x02000000): = 'Cruise'
)
)
)
) |
If it could help, the input message was
Code: |
<?xml version="1.0" encoding="utf-8"?>
<productName><pdtname>Cruise</pdtname></productName>
|
|
|
Back to top |
|
 |
JT |
Posted: Sun Jul 17, 2005 7:04 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Post the entire ExceptionList. |
|
Back to top |
|
 |
Thripura Sundari |
Posted: Sun Jul 17, 2005 8:12 am Post subject: |
|
|
Acolyte
Joined: 13 Jun 2005 Posts: 57 Location: Bangalore, India
|
Hi,
Is there an easier way to get the entire exception list without having to copy the individual messages. May be I have not explored into all the features of WBIMB, but if you could help me, I will be able to save some time. I am sorry for this.
Thanks and Regards,
Thripura Sundari |
|
Back to top |
|
 |
JustFriend |
Posted: Sun Aug 14, 2005 11:30 pm Post subject: |
|
|
Novice
Joined: 30 May 2005 Posts: 22
|
I am using the following in the trace-node for getting the error-trace in a file:
Trace-Node Properties:
Destination : File
File Path : C:\MyErrorTrace.txt
Pattern:
Code: |
############### TRACE-START #################
ROOT TRACE:
${Root}
ENVIRONMENT TRACE:
${Environment}
LOCAL ENVIRONMENT TRACE:
${LocalEnvironment}
EXCEPTION TRACE:
${ExceptionList}
############### TRACE-E N D ################## |
Message Catalog : <blank>
Message Number : default value (here I am using 3051) _________________ Best Regards,
Just Friend. |
|
Back to top |
|
 |
DanielSonFocus |
Posted: Mon Aug 15, 2005 10:50 am Post subject: |
|
|
 Apprentice
Joined: 05 Jun 2005 Posts: 35 Location: Louisville, Kentucky
|
You're getting the exception because your message does'nt have an MQMD.. Add a compute node after the HTTPRequest that will add the MQMD back to the message before it is put to your Output Queue... Like So... MQInput->Compute->HTTPRequest->Compute2->MQOutput
Here's the ESQL in Compute2:
Code: |
CREATE COMPUTE MODULE compute2
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
//Copy in the MQMD.
SET OutputRoot.MQMD = Environment.myMQMD;
//Im assuming your message is in the XML Domain.
SET OutputRoot.XML = InputRoot.XML;
END;
END MODULE;
|
Also refer to Chapter 4 of IBM RedBook " SG246583 - Using Web Services for Business Integration " --> http://www.redbooks.ibm.com/redbooks/pdfs/sg246583.pdf |
|
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
|
|
|
|