ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Error in Bank service application

Post new topic  Reply to topic
 Error in Bank service application « View previous topic :: View next topic » 
Author Message
hoa_lan_trang1982
PostPosted: Tue Nov 21, 2006 11:51 pm    Post subject: Error in Bank service application Reply with quote

Newbie

Joined: 15 Nov 2006
Posts: 7

Dear!
When I try to do like sample name Bank service application in "WebSphere MQ Solutions in a Microsoft .NET Environment" ebook I have error.
Quote:

MQQueueManager queueManager = null;
MQQueue queueIn;
String replyToQueue;
MQMessage custDetails;
MQGetMessageOptions gmo;

StringWriter sw = new StringWriter();
XmlTextWriter tw = new XmlTextWriter(sw);
// next create the XML stream
tw.WriteStartDocument();
tw.WriteStartElement("BSS");
tw.WriteAttributeString("BankID", textBox1.Text);
tw.WriteAttributeString("UniqueID", textBox2.Text);
tw.WriteAttributeString("Name", textBox3.Text);
tw.WriteAttributeString("Addr", textBox4.Text);
tw.WriteAttributeString("DOB", textBox5.Text);
tw.WriteAttributeString("IDType", textBox6.Text);
tw.WriteEndElement();
tw.WriteEndDocument();
// clean up
tw.Flush();
tw.Close();

sw.Close();
string message = sw.ToString();

try
{
// connect to QueueManager
queueManager = new MQQueueManager("QM_APPLE");
System.Console.WriteLine("Connected to QueueManager QM_APPLE");
}
// catch MQExceptions
catch (MQException ex)
{
System.Console.WriteLine("MQException: compCode: " + ex.CompCode.ToString()
+ " Reason: " + ex.Reason.ToString());
}

//Declare WebSphereMQ variable - queue
MQQueue queueOut = null;
// Open queue out (local queue on CCS)
queueOut = queueManager.AccessQueue("CreditCheck", MQC.MQOO_OUTPUT |
MQC.MQOO_FAIL_IF_QUIESCING);

// model queue used to create dynamic queue with unique name - Q2*
queueIn = queueManager.AccessQueue("CreditScore", MQC.MQOO_INPUT_EXCLUSIVE |
MQC.MQOO_FAIL_IF_QUIESCING);
// save dynamic queue name in a variable in order to define replyToQueue

//Error here
replyToQueue = queueIn.Name;
//There is no error if I change this become:
replyToQueue = "CreditScore";

// create new message
custDetails = new MQMessage();
// define message properties
custDetails.Persistence = 1;
// the messages’ replyToQueue is now unique dynamic queue
custDetails.ReplyToQueueName = replyToQueue;
// set message type to request and format to string
custDetails.MessageType = MQC.MQMT_REQUEST;
custDetails.Format = MQC.MQFMT_STRING;

// put message on queueOut
custDetails.WriteString(message);
queueOut.Put(custDetails);

// create new message
MQMessage creditScore = new MQMessage();
// assign the correlation ID the value of the messageID of the message that
//was sent
creditScore.CorrelationId = custDetails.MessageId;
// set getmessageOptions so that there is a 10 seconds wait but stop if
//problems occur
gmo = new MQGetMessageOptions();
gmo.Options = MQC.MQGMO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;
gmo.WaitInterval = 10000;

//This line of code also caused error but I don't know why
//Can you tell me know?
// get message
queueIn.Get(creditScore, gmo);


// close queueOut
queueOut.Close();
// close & delete queueIn (dynamic queue)
queueIn.CloseOptions = MQC.MQCO_DELETE_PURGE;
queueIn.Close();
// disconnect QueueManager
queueManager.Disconnect();
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Nov 22, 2006 6:07 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Could this be because in .NET your variable is stored in Unicode ??
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Error in Bank service application
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.