Author |
Message
|
wreed |
Posted: Fri Jan 04, 2008 11:36 am Post subject: MQ and ASP.NET |
|
|
Newbie
Joined: 04 Jan 2008 Posts: 6
|
Whats the deal, do I have to have the client installed to be able to PUT a message onto an MQ Server? I cannot find the EXACT information whether you need to have this if you are trying to create an ASP.NET application that puts something on the queue.
I am at the moment trying to create an ASP.NET application without the client installed using v6 dlls - amqmdnet.dll, and amqmdxcs.dll which are referenced but I get the error that I just saw in another recent post....I assume this error has something to with not having the client installed? All I want to do is from my .net app is to put something onto a MQ Queue without the client being installed on the machine processing the code.
System.EntryPointNotFoundException was unhandled by user code
Message="Unable to find an entry point named 'xcsGetEnvironmentString' in DLL 'amqxcs2.dll'."
Source="amqmdxcs"
TypeName=""
StackTrace:
at IBM.WMQ.MQCommonServices.xcsGetEnvironmentString(Byte* var, Byte* buffer, UInt16& length)
at IBM.WMQ.MQCommonServices.GetEnvironmentValue(String name)
at IBM.WMQ.CommonServices.GetPropertyValue(String propertyName, Boolean tryEnvironment)
at IBM.WMQ.CommonServices.GetPropertyValue(String propertyName)
at IBM.WMQ.MQEnvironment.GetBindingType(Hashtable properties)
at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)
at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, String Channel, String ConnName)
at TetaMQNet.index.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\n548we\My Documents\Visual Studio 2005\Projects\TetaMQNet\TetaMQNet\index.aspx.cs:line 43
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 04, 2008 12:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you are shooting for a pure .NET client you can only use the Managed client mode. Any other client transport mode will involve the C client and require the full MQ Client.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jan 04, 2008 12:44 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzav.doc/csq87g1.htm
Quote: |
To use WebSphere MQ classes for .NET as a WebSphere MQ client, you can install it, with the WebSphere MQ Client, either on the WebSphere MQ server machine, or on a separate machine. |
You need the MQClient installed. Unless you play around with that Managed Client Connection option.
Quote: |
The WebSphere MQ classes for .NET connecting in this mode remain in .NET managed code and make no calls to native services. For more information about managed code, refer to Microsoft(R) documentation. |
Never tried this though, so not sure on the details. It appears that if you go this route you don't need the full client installed, but you deal with some retrictions (spelled out in the above link). I guess "refer to Microsoft(R) documentation" _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
wreed |
Posted: Fri Jan 04, 2008 1:34 pm Post subject: |
|
|
Newbie
Joined: 04 Jan 2008 Posts: 6
|
The client is on a seperate machine.....
Right now my company is mostly Java....my group is one of the few using .NET.....I have a local batch file, with a text file and a config file that uses jar files to load csv's up onto the MQ client....(which I dont know much about, ah corporate life)....anyway I have better control using my own asp.net code to do the load onto the queue instead of this batch file....
So to sum it up if I have this situation can I just use the 2 dll's and process put's with c# in an asp.net page? |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 04, 2008 2:07 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Remember to check out the limitations of the managed .NET client  _________________ MQ & Broker admin |
|
Back to top |
|
 |
wreed |
Posted: Mon Jan 07, 2008 10:12 am Post subject: |
|
|
Newbie
Joined: 04 Jan 2008 Posts: 6
|
Is there sample code anywhere on a managed code example? |
|
Back to top |
|
 |
wreed |
Posted: Thu Jan 10, 2008 1:51 pm Post subject: |
|
|
Newbie
Joined: 04 Jan 2008 Posts: 6
|
I finally broke down and installed the client and all is well....
When I move my code to the server and install the client it doesnt work due to the ASP.NET user does not have rights to the queue as seen with the 2035 reason code....
My Queuemanager is done with a hash table and I try to set the USER_ID_PROPERTY to my user id but it still does not work, is there something else I am doing wrong? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 10, 2008 2:15 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
wreed wrote: |
I finally broke down and installed the client and all is well....
When I move my code to the server and install the client it doesnt work due to the ASP.NET user does not have rights to the queue as seen with the 2035 reason code....
My Queuemanager is done with a hash table and I try to set the USER_ID_PROPERTY to my user id but it still does not work, is there something else I am doing wrong? |
You need a dedicated ClientServer channel with the MCAUser set on the channel...??  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 10, 2008 4:25 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fjb_saper wrote: |
wreed wrote: |
I finally broke down and installed the client and all is well....
When I move my code to the server and install the client it doesnt work due to the ASP.NET user does not have rights to the queue as seen with the 2035 reason code....
My Queuemanager is done with a hash table and I try to set the USER_ID_PROPERTY to my user id but it still does not work, is there something else I am doing wrong? |
You need a dedicated ClientServer channel with the MCAUser set on the channel...??  |
You need to configure the ASP server to run your code as a particular user id, rather than the user id of the connecting user - and grant that service user the necessary mq authorities...
? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wreed |
Posted: Fri Jan 11, 2008 5:52 am Post subject: |
|
|
Newbie
Joined: 04 Jan 2008 Posts: 6
|
Thanks Jeff, after I posted that I used the search and found that...
Note to self, search then post, not post then search
I am gonna put this code into a folder and make that an application in IIS, then try to just have any code within that application be run by this ID that has rights to the queue.
***EDIT*****
You don't have to set a user to run your code in IIS, the following MS KB worked for me!
http://support.microsoft.com/kb/306158
Basically you can impersonate a user in code, then stop impersonating them after you successfully do the MQ call. |
|
Back to top |
|
 |
|