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 Discussion » WebService client with MQ transport cannot connect

Post new topic  Reply to topic
 WebService client with MQ transport cannot connect « View previous topic :: View next topic » 
Author Message
boonus
PostPosted: Thu Sep 28, 2006 1:58 am    Post subject: WebService client with MQ transport cannot connect Reply with quote

Newbie

Joined: 27 Sep 2006
Posts: 7

Hi!

I'm trying to call a webservice method(axis) from my ws client(axis) using MQ transport.

I got the WSDL defenition and generates the java proxy code with:
java com.ibm.mq.soap.util.RunWSDL2Java Test.wsdl
with no problems.

-----------WS Client code:
com.ibm.mq.soap.Register.extension();
TestServiceLocator locator = new TestServiceLocator();
String strURL = "jms:/queue?" +
"destination=REQUESTQUEUE@MQTESTQM" "&connectionFactory=(" +
"connectQueueManager(MQTESTQM)" +
"binding(client)" +
"clientChannel(SVRCONN)" +
"clientConnection(MQSERVER))" +
"&initialContextFactory=com.ibm.mq.jms.Nojndi" +
"&timeout=5000" +
"&persistence=0" +
"&priority=4" +
"&replyDestination=REPLYQUEUE";

TestService service = locator.getTestWS();
String message = service.getMessage();
-------------

When i call the method service.getMessage(); i get a RemoteException:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: cannotConnect; nested exception is:
java.lang.IllegalArgumentException: noCFName
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:myclient

This seems strange cause my connectionfactory options are set in the URI.

When i do som further debugging i find that the exception is thrown by the getConnectionFactory method in the JNDIVendorAdapter class cause the jndiName is not set.

I got both jndi.jar and nojndi.jar in my classpath

Any ideas?

Thanks
-bonus
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 28, 2006 2:40 am    Post subject: Reply with quote

Grand High Poobah

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

create a file context and setup queues and qcf factory in the context.
Then use it to retrieve the JNDI stuff. This should satisfy AXIS...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
boonus
PostPosted: Thu Sep 28, 2006 5:12 am    Post subject: Reply with quote

Newbie

Joined: 27 Sep 2006
Posts: 7

Sorry..

create a file context with the jms:/queue string? Do you have an example or a link about making such file?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 28, 2006 2:57 pm    Post subject: Reply with quote

Grand High Poobah

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

Read the Using Java manual and find the section about JMSAdmin.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
boonus
PostPosted: Fri Oct 27, 2006 2:31 am    Post subject: Reply with quote

Newbie

Joined: 27 Sep 2006
Posts: 7

Hello again,

I have gone thru the Using Java manual and did some further configuring with JMSAdmin.

JMSAdmin.config
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file:/C:/JNDI-Directory

sutupwsmqclient.scp
DEFINE QCF(MQConnectionFactory) TRANSPORT(CLIENT) HOST(MQSERVER) PORT(1414) CHANNEL(SVRCONN) QMGR(MQTESTQM)
DEFINE Q(REQUESTQUEUE) QU(REPLYQUEUE)
END

I have executed the scp script with JMSAdmin, generating a .bindings file in C:/JNDI-Directory

How do i use this JNDI-Directory? In client.config.wsdd?

I am afraid i'm stucked here.. any ideas? TU
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Oct 27, 2006 2:51 am    Post subject: Reply with quote

Grand High Poobah

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

You have to pass the information to your context factory:
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file:/C:/JNDI-Directory
and then retrieve the qcf and queue like
Code:

Properties myhash = new Properties();
myhash.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
myhash.put(Context.PROVIDER_URL,"file:/C:/JNDI-Directory");
Context ctx = new InitialContext(myhash);
QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup("MQConnectionFactory");
Queue myqueue = (Queue)ctx.lookup("REQUESTQUEUE");


Better double check the code as this is from memory...

Now it's up to you to configure Axis to do this for you...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » WebService client with MQ transport cannot connect
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.