Author |
Message
|
shan123 |
Posted: Thu May 10, 2007 10:28 pm Post subject: RFH2 CharacterCodeSetId from WSE .Net |
|
|
Novice
Joined: 19 Apr 2007 Posts: 11
|
Hi,
I am using websphere MQ 6.0 to send request to Request Queue .I’m sending request using RFH2 format from WSE 2.0 .net client. My issue is that I tried all charactersetid like 1200, 1208, 819 while sending request .But when I see the request from Queue using Rfh2c utility; it always displays codepage as 1200. In addition, message header is not displaying properly. Request is displaying like bellow . Also because of that I'm not able to read RFH2 header from service side .
00000000 R.F.H. .....°..."...¸...M.Q.H.R.
00000032 F.2. . .....¸... ...<.m.c.d.>.<.
00000064 M.s.d.>.j.m.s._.t.e.x.t.<./.M.s.
00000096 d.>.<./.m.c.d.>. . .....<.j.m.s.
00000128 >.j.m.s.T.e.x.t.<./.j.m.s.>. . .
00000160 L...<.u.s.r.>.<./.u.s.r.>. .<?xm
00000832 l version="1.0" encoding="utf-8"
00000864 ?><soap:Envelope xmlns:wsa="http
00000896 ://schemas.xmlsoap.org/ws/2004/0
00000928 3/addressing" xmlns:wsse="http:/
00000960 /docs.oasis-open.org/wss/2004/01
00000992 /oasis-200401-wss-wssecurity-sec
00001024 ext-1.0.xsd" xmlns:wsu="http://d
00001056 ocs.oasis-open.org/wss/2004/01/o
00001088 asis-200401-wss-wssecurity-utili
00001120 ty-1.0.xsd" xmlns:soap="http://s
00001152 chemas.xmlsoap.org/soap/envelope
00001184 /"><soap:Header><wsa:Action>http
00001216 ://tempuri.org/InteropTest/Boole
00001248 anEcho</wsa:Action><wsa:MessageI
00001280 D>uuid:ff0638bb-596d-4369-aa4f-a
00001312 7296e248e5e</wsa:MessageID><wsa:
00001344 ReplyTo><wsa:Address>http://sche
00001376 mas.xmlsoap.org/ws/2004/03/addre
00001408 ssing/role/anonymous</wsa:Addres
00001440 s></wsa:ReplyTo><wsa:To>soap.mq:
00001472 //env/TEST.RAJA/mq-wse-interop.1
00001504 .0</wsa:To><wsse:Security><wsu:T
00001536 imestamp wsu:Id="Timestamp-5f57f
00001568 0c6-97b5-4318-8be3-713ed41897d8"
00001600 ><wsu:Created>2007-05-11T06:17:1
00001632 3Z</wsu:Created><wsu:Expires>200
00001664 7-05-11T06:22:13Z</wsu:Expires><
00001696 /wsu:Timestamp></wsse:Security><
00001728 /soap:Header><soap:Body><Boolean
00001760 EchoRequest xmlns:xsd="http://ww
00001792 w.w3.org/2001/XMLSchema" xmlns:x
00001824 si="http://www.w3.org/2001/XMLSc
00001856 hema-instance" xmlns="http://tem
00001888 puri.org/InteropTest/">true</Boo
00001920 leanEchoRequest></soap:Body></so
00001952 ap:Envelope>
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 11, 2007 12:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
The RFH2 contains non text fields. The example you post looks ok at first glance. Bear in mind it also has it's own CCSID.
You'll find all this described in the Application Programming Reference. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shan123 |
Posted: Fri May 11, 2007 1:00 am Post subject: |
|
|
Novice
Joined: 19 Apr 2007 Posts: 11
|
Vitor wrote: |
The RFH2 contains non text fields. The example you post looks ok at first glance. Bear in mind it also has it's own CCSID.
You'll find all this described in the Application Programming Reference. |
Thanks for reply . have gone through Application Programming Reference .
If I set header values like
<mcd><Msd>mcd_text</Msd></mcd>
<jms>jms_Text</jms>
<usr><targetService>/MABPING</targetService><soapAction>http://abb.write.com/TestService</soapAction><contentType>text/xml; charset=utf-8</contentType><transportVersion>1</transportVersion></usr>
, sent the request and view from Rfhutilc , it is not showing <usr> text under usr tab of the utility . I think something is missing and that's why I'm not able to read msg from my service .
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 11, 2007 1:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shan123 wrote: |
[
If I set header values like
<mcd><Msd>mcd_text</Msd></mcd>
<jms>jms_Text</jms>
<usr><targetService>/MABPING</targetService><soapAction>http://abb.write.com/TestService</soapAction><contentType>text/xml; charset=utf-8</contentType><transportVersion>1</transportVersion></usr>
, sent the request and view from Rfhutilc , it is not showing <usr> text under usr tab of the utility . I think something is missing and that's why I'm not able to read msg from my service .
|
Ah.
You're quite right - the <usr> tab in your posted message is indeed empty. I'd say the client is not including it in the PUT message. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shan123 |
Posted: Fri May 11, 2007 1:38 am Post subject: |
|
|
Novice
Joined: 19 Apr 2007 Posts: 11
|
Vitor wrote: |
shan123 wrote: |
[
If I set header values like
<mcd><Msd>mcd_text</Msd></mcd>
<jms>jms_Text</jms>
<usr><targetService>/MABPING</targetService><soapAction>http://abb.write.com/TestService</soapAction><contentType>text/xml; charset=utf-8</contentType><transportVersion>1</transportVersion></usr>
, sent the request and view from Rfhutilc , it is not showing <usr> text under usr tab of the utility . I think something is missing and that's why I'm not able to read msg from my service .
|
Ah.
You're quite right - the <usr> tab in your posted message is indeed empty. I'd say the client is not including it in the PUT message. |
Thanks again.
My issue is though I included values for <mcd> , <jms> and <usr> in request , why it is not showing in Rfhutilc under different tabs like RFH , Usr , Instead of displaying under different tabs entire message is displaying under data tab . That means Rfhutilc is not separating header from payload. I am wondering what could be the reason. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 11, 2007 1:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shan123 wrote: |
That means Rfhutilc is not separating header from payload. I am wondering what could be the reason. |
I'd guess that you're not setting the MQMD.Format field to indicate an RFH2 is included in the message. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shan123 |
Posted: Fri May 11, 2007 2:14 am Post subject: |
|
|
Novice
Joined: 19 Apr 2007 Posts: 11
|
Hi ,
I set format value as MQC.MQFMT_RF_HEADER_2 .
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 11, 2007 3:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shan123 wrote: |
I set format value as MQC.MQFMT_RF_HEADER_2 .
|
I clearly guessed wrong then...  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri May 11, 2007 7:57 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hello shan123,
I do not know why you posted your question in the Capitalware forum.
I am moving it to the MQ Support forum since it has nothing to do with any Capitalware product.
In the future, please be more careful about where you post your questions. Selecting the appropriate will help you get timely responses.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri May 11, 2007 1:05 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@shan123
How are you creating the RFH2.
Are you using XMS? or JMS?
Thanks  _________________ MQ & Broker admin |
|
Back to top |
|
 |
shan123 |
Posted: Sun May 13, 2007 9:39 pm Post subject: |
|
|
Novice
Joined: 19 Apr 2007 Posts: 11
|
fjb_saper wrote: |
@shan123
How are you creating the RFH2.
Are you using XMS? or JMS?
Thanks :oops: |
Hi !
I'm not using XMS.net . I'm using WSE 2.0 (using IBM.WMQ)
I have declared some constatants like :
const string RFH2_STRUCID_DEFAULT = MQC.MQRFH_STRUC_ID ;
const int RFH2_VERSION_DEFAULT = MQC.MQRFH_VERSION_2 ;
const int RFH2_STRUCLENGTH_DEFAULT = 36;
const int RFH2_ENCODING_DEFAULT = MQC.MQENC_NATIVE;
const int RFH2_CODEDCHARSETID_DEFAULT = 1208;
const string RFH2_FORMAT_DEFAULT = MQC.MQFMT_RF_HEADER_2;
const int RFH2_FLAGS_DEFAULT = MQC.MQRFH_NO_FLAGS ;
const int RFH2_NAMEVALUECCSID_DEFAULT = 1208;
const string MCD_DATA_DEFAULT = "<mcd><Msd>jms_text</Msd></mcd>";
const string FORMAT_MESSAGE_HRF2 = MQC.MQFMT_RF_HEADER_2;
Then have created structure like
public struct MQRFH2
{
public string StrucId;
public int Version;
public int StrucLength;
public int Encoding;
public int CodedCharSetId;
public string Format;
public int Flags;
public int NameValueCCSID ;
public MQRFH2(string sStrucId, int iVersion, int iStrucLength, int iEncoding, int iCodedCharSetId, string sFormat, int iFlags, int iNameValueCCSID)
{
StrucId = sStrucId;
Version = iVersion;
StrucLength = iStrucLength;
Encoding = iEncoding;
CodedCharSetId = iCodedCharSetId;
Format = sFormat;
Flags = iFlags;
NameValueCCSID = iNameValueCCSID;
}
}
Then I have written separate method putdata : code -
MQMessage mqMsg = new MQMessage();
//Message generation
MQRFH2 rfh2 = new MQRFH2(RFH2_STRUCID_DEFAULT, RFH2_VERSION_DEFAULT, RFH2_STRUCLENGTH_DEFAULT, RFH2_ENCODING_DEFAULT, RFH2_CODEDCHARSETID_DEFAULT,
RFH2_FORMAT_DEFAULT, RFH2_FLAGS_DEFAULT, RFH2_NAMEVALUECCSID_DEFAULT);
string mcd_data = MCD_DATA_DEFAULT;
string jms_data = "<jms>jmsText</jms>";
string usr_data = "<usr><targetService>/Testing</targetService><soapAction>http://abc.ttrtrt.com/TestService</soapAction><contentType>text/xml; charset=utf-8</contentType><transportVersion>1</transportVersion><endpointURL></endpointURL></usr>";
int mcd_len = ((mcd_data.Length - 1) / 4) * 4 + 4;
int jms_len = ((jms_data.Length - 1) / 4) * 4 + 4;
int usr_len = ((usr_data.Length - 1) / 4) * 4 + 4;
int msg_len = data.Data.Length;
//Padding of sections (again attention to the spaces)
mcd_data += " ";
mcd_data = mcd_data.Substring(0, mcd_len);
jms_data += " ";
jms_data = jms_data.Substring(0, jms_len);
usr_data += " ";
usr_data = usr_data.Substring(0, usr_len);
mqMsg.Format = FORMAT_MESSAGE_HRF2;
mqMsg.Persistence = (int)MQC.MQPER_PERSISTENT;
mqMsg.WriteString(rfh2.StrucId);
mqMsg.WriteLong(rfh2.Version);
mqMsg.WriteLong(rfh2.StrucLength + mcd_len + jms_len + usr_len + 12);
mqMsg.WriteLong(rfh2.Encoding);
mqMsg.WriteLong(rfh2.CodedCharSetId);
mqMsg.WriteString(rfh2.Format);
mqMsg.WriteLong(rfh2.Flags);
mqMsg.WriteLong(rfh2.NameValueCCSID);
mqMsg.WriteLong(mcd_len);
mqMsg.WriteString(mcd_data);
mqMsg.WriteLong(jms_len);
mqMsg.WriteString(jms_data);
mqMsg.WriteLong(usr_len);
mqMsg.WriteString(usr_data);
mqMsg.Write(data.Data);
MQPutMessageOptions options = new MQPutMessageOptions();
options.Options = MQC.MQPMO_FAIL_IF_QUIESCING ;
this.Queue.Put(mqMsg, options);
I'm getting RFH2 header generated , but when I view message on Queue using rfhutilc entire message showing in data tab and nothing is there under user and jms tab . rfhutilc not separating payload ,usr and jms header .
I'll appreciate ur help
Thanks. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 14, 2007 1:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks like you might be missing the alignment that impacts the length of the RFH2....
It is way easier to use XMS....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
shan123 |
Posted: Wed May 16, 2007 11:07 pm Post subject: |
|
|
Novice
Joined: 19 Apr 2007 Posts: 11
|
Thanks for your help .
my issue has been solved . I just changed mqMsg.WriteString with mqMsg.WriteByte and it works .
Thanks
:D |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 17, 2007 6:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
shan123 wrote: |
Thanks for your help .
my issue has been solved . I just changed mqMsg.WriteString with mqMsg.WriteByte and it works .
Thanks
 |
Makes me think that it was another of the .NET conandrums:
Thinking that write string writes ascii when it writes unicode (UTF-16)...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|