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 » User Exits » Problem with C# Channel API Exit for Receive data

Post new topic  Reply to topic
 Problem with C# Channel API Exit for Receive data « View previous topic :: View next topic » 
Author Message
lapastina
PostPosted: Sun Dec 16, 2007 6:22 pm    Post subject: Problem with C# Channel API Exit for Receive data Reply with quote

Newbie

Joined: 16 Dec 2007
Posts: 3

Hi,

This is my first question on this forum, and my English is not very well. Sorry!!

I have a problem with an test with an API Exit in MQ 6.0 with fix 6.0.2.2.

This is my code:
using System;
using System.Text;
using System.Diagnostics;

using IBM.WMQ;

namespace MQExitReceiveChannel
{
public class MQExitsReceive : MQChannelExit, MQReceiveExit, IMQExitsReceive
{
private ASCIIEncoding ascii = null;

public byte[] ReceiveExit(MQChannelExit channelExitParms, MQChannelDefinition channelDefinition, byte[] dataBuffer, ref int dataOffset, ref int dataLength, ref int dataMaxLength)
{
LogaEvento("Buffer: " + ascii.GetString(dataBuffer), "MQExitsReceive", EventLogEntryType.Warning, true);
return dataBuffer;
}

public void LogaEvento(string Msg, string Source, EventLogEntryType Type, bool boolLog)
{
if (boolLog)
{
System.Diagnostics.EventLog.WriteEntry(Source, Msg, Type);
}
}
}
}

An the configuration in page o Exits in my Receiver Channel is:
MQExitReceiveChannel(MQExitReceiveChannel.MQExitsReceive)

When I try to start a Sender channel that connects with my Receiver channel MQ returns an error:
User exit not valid.

Channel program 'C12345678.SIMULA.1' ended because user exit 'MQExitReceiveChannel(MQExitReceiveChannel.MQExitsReceive)' is not valid.

Ensure that the user exit is specified correctly in the channel definition, and that the user exit program is correct and available.

Please, help me if as possible!

Thanks.

Leandro
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sun Dec 16, 2007 6:44 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you can only write API exits in C, and not in C#.
(These are much further apart than Microsoft wants you to think they are...)

You might be able to manage C++, but the runtime bindings might cause some difficulties...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
David.Partridge
PostPosted: Mon Dec 17, 2007 1:44 am    Post subject: Reply with quote

Master

Joined: 28 Jun 2001
Posts: 249

Usage of C++ in channel exits and in the API exit isn't officially supported. C is of course OK, as is assembler on 390 systems.

On MVS (z/OS), your usage of C is officially constrained to the SPC environment. It is possible, with some care, to use assembler code to set up a persistent C (non-SPC) environment, but this is outside the supported envelope.

C++ can be used with some restrictions (which you'll need to find out the hard way) in channel exits and API exits, but definitely falls into the category of "use at your own risk".

Unless you are highly knowledgeable about how C++ does its stuff and also somewhat of a C++ language lawyer, and have lots of experience with MQ exits in C (or assembler), I'd strongly suggest that you restrict your experiments with exits to the C language on the distributed platforms.

C# is, in my opinion, a step too far.

The usual warnings about exits being "an advanced topic" and to torture test your exits in play-pen environment apply of course.
_________________
Cheers,
David C. Partridge
Back to top
View user's profile Send private message
tleichen
PostPosted: Mon Dec 17, 2007 7:42 am    Post subject: Reply with quote

Yatiri

Joined: 11 Apr 2005
Posts: 663
Location: Center of the USA

Since DotNet is another shell that C# runs under, I dare say that, even if it would be possible, it would be foolish and inefficient to write exit code in C#.
_________________
IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Mon Dec 17, 2007 8:23 am    Post subject: Reply with quote

Jedi Knight

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

Hi,

In one of the manuals, (APG ??) you will read that 'CLNTCONN' is the ONLY type of channel that an send/receive/security exit can be written in C#. The same principles apply to Java.

If you require an exit for a Receiver channel then you need to follow the guidelines/information given above.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
lapastina
PostPosted: Mon Dec 17, 2007 3:24 pm    Post subject: IBM Documents Reply with quote

Newbie

Joined: 16 Dec 2007
Posts: 3

Hi,

I find a IBM documentation in the follow address:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzav.doc/csq8709.htm

This help describes a implementation of DotNet API Exits, but not work fine.

Thanks.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Dec 17, 2007 3:36 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you mean
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzav.doc/csqzav0538.htm

And if you look at the top of that page, it clearly says that it only applies when using a fully managed client connection.

Which is going to only apply on the client side, and not on the server side.

So it won't allow you to do this for a Sender channel.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
lapastina
PostPosted: Tue Dec 18, 2007 3:16 pm    Post subject: Reply with quote

Newbie

Joined: 16 Dec 2007
Posts: 3

Oh!

Sorry, but my english is not good! And I don´t read this help complete.

Thank you!
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 » User Exits » Problem with C# Channel API Exit for Receive data
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.