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 code 2277 when testing a DLL's function

Post new topic  Reply to topic
 error code 2277 when testing a DLL's function « View previous topic :: View next topic » 
Author Message
steiner
PostPosted: Tue Oct 17, 2006 1:33 am    Post subject: error code 2277 when testing a DLL's function Reply with quote

Voyager

Joined: 07 Mar 2003
Posts: 89

Hello all,

I'm currently building an MQ/Series DLL, and work on the first function : amqscnxc

the building of the DLL works fine, but when I test it from Windev, I always get the 2277 error code (CD_ERROR -> Channel Definition error)

a part of the error log :
Code:
10/17/2006  11:17:05
AMQ9498: The MQCD structure supplied was not valid.

EXPLANATION:
The value of the 'ChannelName' field has the value '0'. This value is invalid
for the operation requested.
ACTION:
Change the parameter and retry the operation.
----- amqrcdfa.c : 2132 -------------------------------------------------------


I've a little output from my application :
Code:
Sample AMQSCNXC start
Connecting to queue manager EH020041                                       
using the server connection channel  EH020041.CL.MRS
on connection name  '53.111.70.150(1425)'.
 Completion Code 2
 CONNX Reason Code 2277
 Conn name  '53.111.70.150(1425)'
 Channel Name name  EH020041.CL.MRS
 Qmger Name EH020041



and here is the windev code :
Code:
sChannel est une chaîne = "-c EH020041.CL.MRS"
sQueueMgr est une chaîne = "EH020041"

nTest = AppelDLL32("c:\user\test-dll\MQS.dll","amqscnxc","-x '53.111.70.150(1425)'",sChannel,sQueueMgr)



and a part of the DLL I'm creating :
Code:
MQCNO    Connect_options = {MQCNO_DEFAULT};
                                    /* MQCONNX options               */
MQCD     ClientConn = {MQCD_CLIENT_CONN_DEFAULT};
                                    /* Client connection channel     */
                                    /* definition                    */
char    *p_argQMgrName = NULL;   /* q manager name from user      */
char    *p_argConnName = NULL;   /* connection name from user     */
char    *p_argChannelName = NULL;/* channel name from user        */

ProcessCommandLine(argc, argv, &p_argQMgrName,
                          &p_argConnName, &p_argChannelName) /* process parameters */

(...)
MQCONNX(QMName,                 /* queue manager                  */
           &Connect_options,       /* options for connection         */
           &Hcon,                  /* connection handle              */
           &CompCode,              /* completion code                */
           &CReason);              /* reason code                    */


I've already read some topics, see that some times the environment variable is not correctly forwarded, then I added this :
Code:
SetEnvironmentVariable("MQSERVER","'EH020041.CL.MRS/TCP/53.111.70.150(1425)'");


and I've seen some other variables that I've added (for the MQS structure) :
Code:
ClientConn.ChannelType=MQCHT_CLNTCONN;
ClientConn.TransportType=MQXPT_TCP;


but still the same problem

I have tested on the command line :
Code:
$ amqscnxc.exe -x '53.111.70.150(1425)' -c EH020041.CL.MRS EH020041
Sample AMQSCNXC start
Connecting to queue manager EH020041
using the server connection channel EH020041.CL.MRS
on connection name 53.111.70.150(1425).
Connection established to queue manager EH020041

Sample AMQSCNXC end
Back to top
View user's profile Send private message
steiner
PostPosted: Tue Oct 17, 2006 1:56 am    Post subject: Reply with quote

Voyager

Joined: 07 Mar 2003
Posts: 89

more source code (variables settings) :
Code:
   if (p_argQMgrName != NULL)
   {
     strncpy(QMName, p_argQMgrName, MQ_Q_MGR_NAME_LENGTH);
     fprintf(ficlog,"Connecting to queue manager %-48.48s\n", p_argQMgrName);
   }
   else
   {
     QMName[0] = '\0';    /* default */
     fprintf(ficlog,"Connecting to the default queue manager\n");
   }

     strncpy(ClientConn.ConnectionName,
             p_argConnName,
             MQ_CONN_NAME_LENGTH);

     if (p_argChannelName == NULL)
     {
       p_argChannelName = "SYSTEM.DEF.SVRCONN";
     }

     strncpy(ClientConn.ChannelName,
             p_argChannelName,
             MQ_CHANNEL_NAME_LENGTH);
             
     ClientConn.ChannelType=MQCHT_CLNTCONN;
     ClientConn.TransportType=MQXPT_TCP;

     /* Point the MQCNO to the client connection definition */
     Connect_options.ClientConnPtr = &ClientConn;

     /* Client connection fields are in the version 2 part of the
        MQCNO so we must set the version number to 2 or they will
        be ignored */
     Connect_options.Version = MQCNO_VERSION_2;

SetEnvironmentVariable("MQSERVER","'EH020041.CL.MRS/TCP/SHINP002(1425)'");


and after is the call of MQCONNX
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 17, 2006 3:16 am    Post subject: Reply with quote

Grand High Poobah

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

You probably need to pad your strings. Qmgr, channel etc have a fixed length... Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
steiner
PostPosted: Tue Oct 17, 2006 6:01 am    Post subject: Reply with quote

Voyager

Joined: 07 Mar 2003
Posts: 89

thanks for your advice

finally, I've found my error : in the windev code, I've removed spaces as following :

was:
Code:
sChannel est une chaîne = "-c EH020041.CL.MRS"
sQueueMgr est une chaîne = "EH020041"

nTest = AppelDLL32("c:\user\test-dll\MQS.dll","amqscnxc","-x '53.111.70.150(1425)'",sChannel,sQueueMgr)


is now:
Code:
sChannel est une chaîne = "-cEH020041.CL.MRS"
sQueueMgr est une chaîne = "EH020041"

nTest = AppelDLL32("c:\user\test-dll\MQS.dll","amqscnxc","-x53.111.70.150(1425)",sChannel,sQueueMgr)
Back to top
View user's profile Send private message
steiner
PostPosted: Mon Oct 23, 2006 3:59 am    Post subject: Reply with quote

Voyager

Joined: 07 Mar 2003
Posts: 89

Hello,

now i have tried to run my DLL, and it runs fine. The only Problem is that the accentuated characters cannot be read from my DLL. The result is not readable.

Is there a specific CCSID to read these accentuated characters or a specific function to make that possibilty available in my DLL.

Thanks.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Oct 23, 2006 4:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

steiner wrote:
Hello,

now i have tried to run my DLL, and it runs fine. The only Problem is that the accentuated characters cannot be read from my DLL. The result is not readable.

Is there a specific CCSID to read these accentuated characters or a specific function to make that possibilty available in my DLL.

Thanks.


Not a function - you'll need to use a code page that contains the characters you need.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
steiner
PostPosted: Mon Oct 23, 2006 5:59 am    Post subject: Reply with quote

Voyager

Joined: 07 Mar 2003
Posts: 89

Hello thanks,

Ok thanks for your answer.

For info on our side we have our CCSID=1051, can you tell us which pages codes we can use to respect our characters and the accentuated characters.

Thanks bye.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Oct 23, 2006 6:04 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Hey, I'm not just English I'm from Essex - to me a forigen language is English spoken very slowly and deliberately.....

Seriously, I've no knowledge of forigen character supports, though I feel certain one of our European colleague will be along in a minute.

A quick Google revealed this:

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzak.doc/aq30s8.htm

Other & potentially more relevant links are available
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » error code 2277 when testing a DLL's function
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.