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 » General IBM MQ Support » API crossing exit help

Post new topic  Reply to topic
 API crossing exit help « View previous topic :: View next topic » 
Author Message
skiv
PostPosted: Wed Jul 05, 2006 2:45 am    Post subject: API crossing exit help Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 33

Hi

I need some help in the API crossing exit. In this exit there is a function that is MQ_CONNX entrypoint. In this function there is a parameter PPMQCNO ppConnectOpts

this parameter contains another point securityParamPtr that contains the address for MQCSP

to use this the MQCNO_Version need to be version 5. To do this i changed inside the header file cmqc.h right? but then it did not seems to change the version. Are there any other way to change the version?

Or are there any way i can access the MQCSP structure from this MQCONNX? I need to retrieve the CSPUserIdPtr in it...

Any help will be appreciated.. thanks
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Jul 05, 2006 9:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

Are you at the correct MQ level (i.e. WMQ v6) that will support the MQCNO_Version you are looking for??

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
skiv
PostPosted: Thu Jul 06, 2006 1:51 am    Post subject: Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 33

yup i`m using websphere v6
Back to top
View user's profile Send private message
mvic
PostPosted: Thu Jul 06, 2006 3:19 am    Post subject: Re: API crossing exit help Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

skiv wrote:
this parameter contains another point securityParamPtr that contains the address for MQCSP

to use this the MQCNO_Version need to be version 5. To do this i changed inside the header file cmqc.h right?

No, this is not right. Did you really edit /opt/mqm/inc/cmqc.h? Please use a copy of cmqc.h that has not been altered.

Also, please post some code that you believe shows a problem. It might be possible for us to make remarks that help.

Please avoid posting anything that could be sensitive. Eg. remove IP addresses, usernames, passwords from anything you post.
Back to top
View user's profile Send private message
skiv
PostPosted: Thu Jul 06, 2006 4:17 pm    Post subject: Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 33

void MQENTRY ConnxAfter ( PMQAXP pExitParms
, PMQAXC pExitContext
, MQCHAR48 QMgrName
, PPMQCNO ppConnectOpts
, PPMQHCONN ppHconn
, PMQLONG pCompCode
, PMQLONG pReason
)
{
MQLONG rc = MQRC_NONE;
MYEXITUSERAREA ** ppExitUserArea = (void*) &pExitParms->ExitUserArea;
MYEXITUSERAREA * pExitUserArea = *ppExitUserArea;
FILE * fp = pExitUserArea->fp;
char buffer1[50] = "";
char buffer2[50] = "";
.
.
.
.

fprintf(fp,"UserID : %s\n", (*((*ppConnectOpts->SecurityParmsPtr)).CSPUserIdPtr);

.
.
.


return;
}

When i place this into the MQ to run it gives me an error when initialising the Qmanager. It says Object canot be created.

When I change the :
fprintf(fp,"UserID : %s\n", (*((*ppConnectOpts->SecurityParmsPtr)).CSPUserIdPtr);
to
fprintf(fp,"StrucId : %s\n", (*((*ppConnectOpts->SecurityParmsPtr)).StrucId);

it can run but when print it prints (null)

this is from the example amqsaxe0.c where i modify abit including adding in the line above. Are there also any other methods that I can retrieve the CSPUserId from this example also?

Thanks
Back to top
View user's profile Send private message
wschutz
PostPosted: Thu Jul 06, 2006 4:32 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

You do know that you can only address the MQCSP structure if the application that is calling MQCONNX has setup a V5 MQCNO and setup a pointer to the MQCSP structure. You aren't assuming that its ALWAYS there for you in the exit, are you?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
skiv
PostPosted: Thu Jul 06, 2006 5:05 pm    Post subject: Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 33

ya I understand that MQCNO got to be V5 and i read that it can be set am I right? How can i go about doing it? I tried once changing the header file but when I print out the version number, only a few times it prints 5, the rest of the time is 1. Also what and how you mean but setup a pointer to the MQCSP structure?

Actually I got an idea I need to point the pointer to somewhere but not sure how to go about doing it
Back to top
View user's profile Send private message
skiv
PostPosted: Thu Jul 06, 2006 7:23 pm    Post subject: Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 33

i set the version using (*ppConnectOpts)->Version = 5

am I right?

then the pointing of pointer use

&(*((*ppConnectOpts)->SecurityParmsPtr))="CSP"

seems weird to me but i not sure whats the other methods
Back to top
View user's profile Send private message
wschutz
PostPosted: Fri Jul 07, 2006 2:06 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

No, you must set the version in the program that CALLS mqconnx, not in the exit.

Perhaps you need to tell us WHAT you are trying to accomplish here. I really doubt that using CNO/CSP is going to do what you think it will. If you explain what the requirement is, perhaps we can suggest a better way to do it.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
skiv
PostPosted: Sun Jul 09, 2006 9:57 am    Post subject: Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 33

I now got a client that send username and password to the server using the security parameters... I want to retrieve this username and password which needs me to access to the MQCSP data structure.

At Q manager level, I wrote a MQ_AUTHENTICATE_USER function which successfully authenticated the username and password. I also want to authenticate if the client is publisher or subscriber. However at this function, it does not allow me to know if the client is publisher or subcriber...

At the API crossing exit side, at the channel level, I can retrieve if the client is publisher or subscriber. However i cant retrieve the username here... I found out that the MQ_CONNX can link to the MQCSP structure, so trying to retrieve it thru this link.
Back to top
View user's profile Send private message
skiv
PostPosted: Sun Jul 09, 2006 7:12 pm    Post subject: Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 33

By the way, if I want to send user defined username and password to the server and retrieved them at the server, are there any other ways beside using the security parameters MQCSP?
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 » General IBM MQ Support » API crossing exit help
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.