Author |
Message
|
skiv |
Posted: Wed Jul 05, 2006 2:45 am Post subject: API crossing exit help |
|
|
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 |
|
 |
RogerLacroix |
Posted: Wed Jul 05, 2006 9:02 pm Post subject: |
|
|
 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 |
|
 |
skiv |
Posted: Thu Jul 06, 2006 1:51 am Post subject: |
|
|
Apprentice
Joined: 19 Jun 2006 Posts: 33
|
yup i`m using websphere v6 |
|
Back to top |
|
 |
mvic |
Posted: Thu Jul 06, 2006 3:19 am Post subject: Re: API crossing exit help |
|
|
 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 |
|
 |
skiv |
Posted: Thu Jul 06, 2006 4:17 pm Post subject: |
|
|
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 |
|
 |
wschutz |
Posted: Thu Jul 06, 2006 4:32 pm Post subject: |
|
|
 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 |
|
 |
skiv |
Posted: Thu Jul 06, 2006 5:05 pm Post subject: |
|
|
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 |
|
 |
skiv |
Posted: Thu Jul 06, 2006 7:23 pm Post subject: |
|
|
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 |
|
 |
wschutz |
Posted: Fri Jul 07, 2006 2:06 am Post subject: |
|
|
 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 |
|
 |
skiv |
Posted: Sun Jul 09, 2006 9:57 am Post subject: |
|
|
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 |
|
 |
skiv |
Posted: Sun Jul 09, 2006 7:12 pm Post subject: |
|
|
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 |
|
 |
|