Author |
Message
|
bbcno |
Posted: Fri Sep 29, 2017 1:34 am Post subject: Java SOAP with JMS IBM MQ transport - noCFName |
|
|
Newbie
Joined: 29 Sep 2017 Posts: 6
|
We have a java desktop application and need to call a web service from a customer. We have received the wsdl-file and the server side endpoint URL. It is built on dotNET / WCF and IBM MQ 8.
I believe we need to take the JAX-RPC approach, so I'm trying to follow this guide : Developing a JAX-RPC client for WebSphere transport for SOAP using Eclipse
I have installed IBM MQ 8 and created a project in Eclipse. I have added the jars from IBM_INSTALL\lib and IBM_INSTALL\lib\soap.
I have imported the wsdl to the project and generated the web service client using Eclipse and Axis.
Getting "You must have 1 post before you can post URLs/Links", continuing in next post. |
|
Back to top |
|
 |
bbcno |
Posted: Fri Sep 29, 2017 1:38 am Post subject: |
|
|
Newbie
Joined: 29 Sep 2017 Posts: 6
|
Code: |
public static void main(String[] args) throws MalformedURLException, ServiceException, Error, RemoteException{
com.ibm.mq.soap.Register.extension();
Wf1AGwImplLocator locator = new Wf1AGwImplLocator();
String endpoint = "xxx";
IWf1AGw service = locator.getBasicHttpBinding_IWf1aGw(new URL(endpoint));
service.dispatch("", "", "", "", "",false, "", "", 1, Calendar.getInstance(), false, "", "");
}
|
I get the following error message when calling dispatch():
Quote: |
Caused by: java.lang.IllegalArgumentException: noCFName
at org.apache.axis.components.jms.JNDIVendorAdapter.getConnectionFactory(JNDIVendorAdapter.java:71)
at org.apache.axis.components.jms.JNDIVendorAdapter.getQueueConnectionFactory(JNDIVendorAdapter.java:55)
at org.apache.axis.transport.jms.JMSConnectorFactory.createConnector(JMSConnectorFactory.java:227)
at org.apache.axis.transport.jms.JMSConnectorFactory.createClientConnector(JMSConnectorFactory.java:178)
at org.apache.axis.transport.jms.JMSConnectorManager.getConnector(JMSConnectorManager.java:107)
... 8 more |
The endpoint URL used is:
jms:/queue?destination=QG.WF1AGW.REQ&connectionFactory=clientChannel(WIP.SVRCONN)clientConnection(<customerIP1>(1414), <customerIP2>(1414))&initialContextFactory=com.ibm.mq.jms.Nojndi&replyDestination=QP.ABBSVC.WF1AGW.RESP&timeToLive=30000&persistence=1
The customer requires us to use IBM MQ transport, but the wsdl does not contain any MQ configuration, only HTTP. The URL used was received from the customers server side config.
JMS and IBM MQ is new to me, and I haven't completely understood the concept yet. I was hoping to get some assistance in getting started here. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 29, 2017 5:04 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It looks like you have all the connection details for the connection factory: channel, hostname, port. The error text suggests that you also need to name the QCF (even though this is a nojndi qcf?)  _________________ MQ & Broker admin
Last edited by fjb_saper on Fri Sep 29, 2017 5:06 am; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 29, 2017 5:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you looked at the verifier and samples in <mqinstall>\tools\soap\samples\java ?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bbcno |
Posted: Fri Sep 29, 2017 6:08 am Post subject: |
|
|
Newbie
Joined: 29 Sep 2017 Posts: 6
|
Yes I've looked at the examples, but I'm a little confused:
Do I need a server running locally? The samples have both client and server on the same machine.
But in my case, since the endpoint is external, isn't it enough to just generate the classes from wsdl using Axis and set the correct endpoint URL in order to call the web service? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Sep 29, 2017 7:30 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
<edited to remove misreading. wait for follow up>
You don't need a server running on the same machine as your jms code.
It's probably better if you don't, it will allow you to test your code in a way that is similar to talking to your customer.
I'm not really sure where Axis comes in, but that's just because java webstuff is not my area of expertise.
You should review the info in the MQ Knowledge center on using jMS with MQ.
You may have to create an MQJmsDestionation instead of a plain JMS Destination... but it's been a while since I've looked at that stuff too. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
bbcno |
Posted: Wed Oct 04, 2017 6:12 am Post subject: |
|
|
Newbie
Joined: 29 Sep 2017 Posts: 6
|
I have added
Code: |
<transport name="jms" pivot="java:com.ibm.mq.soap.transport.jms.WMQSender"/> |
to client-config.wsdd.
The error is now:
Quote: |
Required Option connectionFactory missing from MQ URL. MQCC_FAILED(2) MQRC_SOAP_URL_ERROR(2212).
at com.ibm.mq.soap.transport.jms.WMQSOAPException.getSOAPException(Unknown Source)
at com.ibm.mq.soap.transport.jms.WMQAddress.validate(Unknown Source)
at com.ibm.mq.soap.transport.jms.WMQAddress.setWmqURI(Unknown Source)
at com.ibm.mq.soap.transport.jms.WMQSender.invoke(Unknown Source)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812) |
It seems I got one step closer since the ibm mq classes now are involved in the call. But it still complains about the connectionFactory. I don't understand why since it is there in the URL. I've also tried the URL used at the sample documentation https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q033020_.htm
But the error occurs regardless of what I put in the URL. |
|
Back to top |
|
 |
bbcno |
Posted: Thu Oct 05, 2017 12:27 am Post subject: |
|
|
Newbie
Joined: 29 Sep 2017 Posts: 6
|
In the URL I needed to replace the & with & and remove the ports. Now it seems to work! |
|
Back to top |
|
 |
bbcno |
Posted: Thu Oct 05, 2017 6:21 am Post subject: |
|
|
Newbie
Joined: 29 Sep 2017 Posts: 6
|
The cause of the error was actually the ORDER of the added external libraries.
The jars in MQ_INSTALLATION_PATH/java/lib must be added BEFORE the jars in MQ_INSTALLATION_PATH/java/lib/soap. |
|
Back to top |
|
 |
|