|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
  |
|
Data Conversion from Java Client |
View previous topic :: View next topic |
Author |
Message
|
wmorgan999 |
Posted: Thu Apr 18, 2002 9:52 am Post subject: |
|
|
Newbie
Joined: 17 Apr 2002 Posts: 4
|
I have Messages being put to a Queue from a Java Client - Using the MQHRF2 format. Codepage 819. I cannot get the header or User Data to convert to EDCDIC. I tried without a Conversion Exit Pgm as it appears that MQHRF2 should be a standard format , I have tried with a Conversion Exit. I keep getting 2119 Return Code - I have rtied tracing MQ and it does not tell me much either. All I want is to get at the User Data in the Message!! Any Ideas on How to get a Basic Message converted coming from a Java Client in ASCII.
|
|
Back to top |
|
 |
mrlinux |
Posted: Thu Apr 18, 2002 10:07 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
What is the MQMD.Format set to ???? and are you doing a MQGET with convert turned on ???
_________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
wmorgan999 |
Posted: Thu Apr 18, 2002 10:09 am Post subject: |
|
|
Newbie
Joined: 17 Apr 2002 Posts: 4
|
Format id = MQHRF2 and I have tried with conversion on and Off still it did not convert.
|
|
Back to top |
|
 |
wmorgan999 |
Posted: Thu Apr 18, 2002 10:11 am Post subject: |
|
|
Newbie
Joined: 17 Apr 2002 Posts: 4
|
Fr the Record, i am trying to recieve this Message on Iseries V4r5 with Mq V4R2M1.
|
|
Back to top |
|
 |
deneb |
Posted: Thu Apr 18, 2002 6:50 pm Post subject: |
|
|
 Novice
Joined: 15 Apr 2002 Posts: 18
|
Hi
Can u post ur code ...
deneb |
|
Back to top |
|
 |
wmorgan999 |
Posted: Fri Apr 19, 2002 6:47 am Post subject: |
|
|
Newbie
Joined: 17 Apr 2002 Posts: 4
|
Here is the Conversion Exit Code..
/******************************************************************
#include <cmqc.h> /* For MQI datatypes
#include <cmqxc.h> /* For MQI exit-related definitions
#include <amqsvmha.h> /* For sample macro definitions
/******************************************************************
/* Insert the functions prototypes for the functions produced by
/* the data conversion utility program.
/******************************************************************
int main (int argc, char * argvݨ);
MQLONG ConvertMQRFH2 (PMQBYTE *in_cursor,
PMQBYTE *out_cursor,
PMQBYTE in_lastbyte,
PMQBYTE out_lastbyte,
MQHCONN hConn,
MQLONG opts,
MQLONG MsgEncoding,
MQLONG ReqEncoding,
MQLONG MsgCCSID,
MQLONG ReqCCSID,
MQLONG CompCode,
MQLONG Reason);
int main (int argc, char * argvݨ)
{
PMQDXP pDataConvExitParms = (PMQDXP) argvÝ1¨;
PMQMD pMsgDesc = (PMQMD) argvÝ2¨;
MQLONG InBufferLength = *(PMQLONG) argvÝ3¨;
PMQVOID pInBuffer = (PMQVOID) argvÝ4¨;
MQLONG OutBufferLength = *(PMQLONG) argvÝ5¨;
PMQVOID pOutBuffer = (PMQVOID) argvÝ6¨;
MQLONG ReturnCode = MQRC_NONE;
MQHCONN hConn = pDataConvExitParms->Hconn;
MQLONG opts = pDataConvExitParms->AppOptions;
PMQBYTE in_cursor = (PMQBYTE)pInBuffer;
PMQBYTE out_cursor = (PMQBYTE)pOutBuffer;
PMQBYTE in_lastbyte = (PMQBYTE)pInBuffer + InBufferLength - 1;
PMQBYTE out_lastbyte = (PMQBYTE)pOutBuffer + OutBufferLength - 1;
MQLONG MsgEncoding = pMsgDesc->Encoding;
MQLONG ReqEncoding = pDataConvExitParms->Encoding;
MQLONG MsgCCSID = pMsgDesc->CodedCharSetId;
MQLONG ReqCCSID = pDataConvExitParms->CodedCharSetId;
MQLONG CompCode = pDataConvExitParms->CompCode;
MQLONG Reason = pDataConvExitParms->Reason;
/******************************************************************/
/* Insert calls to the code fragments to convert the format's */
/* structure(s) here. */
ReturnCode = ConvertMQRFH2(
&in_cursor,
&out_cursor,
in_lastbyte,
out_lastbyte,
hConn,
opts,
MsgEncoding,
ReqEncoding,
MsgCCSID,
ReqCCSID,
CompCode,
Reason);
/******************************************************************/
/* Check whether the conversion succeeded or failed and return */
/* the values required by the caller. */
/******************************************************************/
if (ReturnCode == MQRC_NONE)
{
pDataConvExitParms->ExitResponse = MQXDR_OK;
pDataConvExitParms->CompCode = MQCC_OK;
pDataConvExitParms->Reason = ReturnCode;
/****************************************************************/
/* If the message had not been truncated then return its new */
/* length. */
/* Warning - this assumes that out_cursor has been set up to */
/* point to the end of the message. Routines produced by the */
/* data conversion exit utility will do this BUT if you are */
/* writing your own routines ensure it is updated or the */
/* message could end up with a zero length and appear not to */
/* get converted! */
/****************************************************************/
if (Reason != MQRC_TRUNCATED_MSG_ACCEPTED)
{
pDataConvExitParms->DataLength = out_cursor
- (PMQBYTE)pOutBuffer;
} /* end if */
}
/******************************************************************/
/* If conversion failed for lack of data or lack of output buffer */
/* but the message had been truncated then indicate success but */
/* do not adjust the values of Reason, CompCode or DataLength. */
/******************************************************************/
else if ((Reason == MQRC_TRUNCATED_MSG_ACCEPTED) &&
((ReturnCode == MQRC_TRUNCATED_MSG_ACCEPTED) ||
(ReturnCode == MQRC_CONVERTED_MSG_TOO_BIG)))
{
pDataConvExitParms->ExitResponse = MQXDR_OK;
}
/******************************************************************
/* Otherwise indicate that conversion of the message data failed. *
/******************************************************************
else
{
pDataConvExitParms->ExitResponse = MQXDR_CONVERSION_FAILED;
pDataConvExitParms->CompCode = MQCC_WARNING;
pDataConvExitParms->Reason = ReturnCode;
} /* end if */
return;
}
/* utility program. */
/********************************************************************/
MQLONG ConvertMQRFH2(
PMQBYTE *in_cursor,
PMQBYTE *out_cursor,
PMQBYTE in_lastbyte,
PMQBYTE out_lastbyte,
MQHCONN hConn,
MQLONG opts,
MQLONG MsgEncoding,
MQLONG ReqEncoding,
MQLONG MsgCCSID,
MQLONG ReqCCSID,
MQLONG CompCode,
MQLONG Reason)
{
MQLONG ReturnCode = MQRC_NONE;
ConvertChar(4); /* StrucrId */
AlignLong();
ConvertLong(1); /* Version */
AlignLong();
ConvertLong(1); /* StrucLength */
AlignLong();
ConvertLong(1); /* Encoding */
AlignLong();
ConvertLong(1); /* CodedCharSetId */
ConvertChar( ; /* Format */
AlignLong();
ConvertLong(1); /* Flags */
AlignLong();
ConvertLong(1); /* NameValueCCSID */
ConvertVarChar(); /* NameValueData */
Fail:
return(ReturnCode);
}
|
|
Back to top |
|
 |
dod |
Posted: Mon May 06, 2002 5:34 am Post subject: |
|
|
Newbie
Joined: 15 Apr 2002 Posts: 4
|
Can you please pass this to IBM? Also explain that it doesn't work even if converting to US-English(codepage 37). We believe this is a bug, but need help convincing them.
|
|
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
|
|
|
|