Discussion:
SOAP over IBM MQ - MQHRF2 Format
David Payne
2018-10-11 15:29:48 UTC
Permalink
Hi,

I'm trying to send a one-way SOAP request over IBM MQ. Unfortunately I
know nothing about MQ and have no access to the broker or its tools. My
contact who manages the MQ instance knows lots about MQ but nothing
about JMS or CXF.

He's complaining that the messages I'm sending have a format of MQHRF2.
I _think_ he wants them to have a format of MQSTR.

How can I persuade CXF to generate messages with that format?

In case it's relevant, I'm using Spring Boot, with the IBM MQ Spring
Boot starter (v2.0.0), and I'm using the Maven CXF plugin to generate
the SOAP stubs. I instantiate the generated Port like so:

   @Bean
   public SessionQueryBindingPort
sessionQueryBindingPort(ConnectionFactory connectionFactory,
QueueConfig queueConfig) {
       JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
       factory.setServiceClass(SessionQueryBindingPort.class);
       factory.setAddress(queueConfig.getQueue());

       ConnectionFactoryFeature connectionFactoryFeature = new
ConnectionFactoryFeature(connectionFactory);
factory.setFeatures(Collections.singletonList(connectionFactoryFeature));

       return (SessionQueryBindingPort) factory.create();
   }

I'm using the Port directly, rather than the generated Service, because
the WSDL I've been provided with is configured for HTTP transport, and
apparently the other party is unable to give me one configured for JMS.

Any advice - however basic - greatly appreciated.
Dave Payne.
Jens
2018-10-12 06:24:32 UTC
Permalink
Hi,

I suspect you want to tell MQ that the receiver is not a JMS client but a
"regular" consumer.

Try specifying the target queue name like this:

"queue:///" + queueConfig.getQueue() + "?targetClient=1"

Cheers,
Jens
Post by David Payne
I'm trying to send a one-way SOAP request over IBM MQ. Unfortunately I
know nothing about MQ and have no access to the broker or its tools. My
contact who manages the MQ instance knows lots about MQ but nothing
about JMS or CXF.
He's complaining that the messages I'm sending have a format of MQHRF2.
I _think_ he wants them to have a format of MQSTR.
--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
David Payne
2018-10-12 07:49:52 UTC
Permalink
Hi Jens,

Thanks very much for this, I've tried it, and my MQ admin is telling me
that the message still has the MQMD format of MQHRF2, and includes an
MQRFH2 header.

I only have the vaguest understanding of what that means, but it sounds to
me like that's what the targetClient=1 parameter should prevent.

In the CXF logs I can see that the targetClient setting is being included,
but noticed that the queue name I'm setting is
"jms:queue:...?targetClient=1".

I notice that your suggestion doesn't include the "jms:", so tried removing
it and now CXF throws an exception saying:

Could not find conduit initiator for address: queue:///...?
targetClient=1 and transport: http://www.w3.org/soapjms/

I assume this is because I'm setting this on my JaxWsProxyFactoryBean:

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);

Is there some other transportId value I should be using?

Any other thoughts welcome, of course.
Dave.
Post by Jens
Hi,
I suspect you want to tell MQ that the receiver is not a JMS client but a
"regular" consumer.
"queue:///" + queueConfig.getQueue() + "?targetClient=1"
Cheers,
Jens
Post by David Payne
I'm trying to send a one-way SOAP request over IBM MQ. Unfortunately I
know nothing about MQ and have no access to the broker or its tools. My
contact who manages the MQ instance knows lots about MQ but nothing
about JMS or CXF.
He's complaining that the messages I'm sending have a format of MQHRF2.
I _think_ he wants them to have a format of MQSTR.
--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
Jens
2018-10-12 08:10:40 UTC
Permalink
Hi David,

I've never used CXF3-style JMS configuration, but only the JMSConfiguration
feature where the address set on the endpoint is just "jms://" and the
target queue
is defined in the feature.

The problem here (with the CXF3 style) is that the properties given in the
URL are
CXF properties, not MQ properties, and CXF doesn't know about targetClient.
I'm
not sure how you would pass properties to the JMS impl with this scheme. I
don't
see a way to set a DestinationResolver, either.

Maybe someone else knows about that, but I can only suggest using the
JMSConfiguration
style instead:
http://cxf.apache.org/docs/using-the-jmsconfigfeature.html
Post by David Payne
Hi Jens,
Thanks very much for this, I've tried it, and my MQ admin is telling me
that the message still has the MQMD format of MQHRF2, and includes an
MQRFH2 header.
I only have the vaguest understanding of what that means, but it sounds to
me like that's what the targetClient=1 parameter should prevent.
In the CXF logs I can see that the targetClient setting is being included,
but noticed that the queue name I'm setting is
"jms:queue:...?targetClient=1".
I notice that your suggestion doesn't include the "jms:", so tried removing
Could not find conduit initiator for address: queue:///...?
targetClient=1 and transport: http://www.w3.org/soapjms/
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
Is there some other transportId value I should be using?
Any other thoughts welcome, of course.
Dave.
On Fri, 12 Oct 2018, 07:24 Jens, <
Post by Jens
Hi,
I suspect you want to tell MQ that the receiver is not a JMS client but a
"regular" consumer.
"queue:///" + queueConfig.getQueue() + "?targetClient=1"
Cheers,
Jens
Post by David Payne
I'm trying to send a one-way SOAP request over IBM MQ. Unfortunately I
know nothing about MQ and have no access to the broker or its tools. My
contact who manages the MQ instance knows lots about MQ but nothing
about JMS or CXF.
He's complaining that the messages I'm sending have a format of MQHRF2.
I _think_ he wants them to have a format of MQSTR.
--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
Andrei Shakirin
2018-10-16 16:47:04 UTC
Permalink
Hi,

The most flexible option is implementing own CXF transport for IBM MQ.
In this case you have all options, sender and listener full under control.
Drawback - option requires some efforts.

You can have a look how to add your own transport in CXF here: http://cxf.apache.org/docs/custom-transport.html and in my blog http://ashakirin.blogspot.com/2012/02/custom-cxf-transport.html

Regards,
Andrei.
-----Original Message-----
Sent: Freitag, 12. Oktober 2018 10:11
Subject: Re: SOAP over IBM MQ - MQHRF2 Format
Hi David,
I've never used CXF3-style JMS configuration, but only the JMSConfiguration
feature where the address set on the endpoint is just "jms://" and the target
queue is defined in the feature.
The problem here (with the CXF3 style) is that the properties given in the URL
are CXF properties, not MQ properties, and CXF doesn't know about
targetClient.
I'm
not sure how you would pass properties to the JMS impl with this scheme. I
don't see a way to set a DestinationResolver, either.
Maybe someone else knows about that, but I can only suggest using the
https://urldefense.proofpoint.com/v2/url?u=http-
3A__cxf.apache.org_docs_using-2Dthe-
2Djmsconfigfeature.html&d=DwICAg&c=2w5q_42kFG40MI2alLPgJw&r=bWOqk
HjIZE0sZtdpFMIhm-lcbhtB3cv08OlIr0lkKR4&m=zQkdcRErC6MdX-
5MalMM9zNj__roxHQSj0zPSS1eONo&s=GFpMNoRCbLcw5DbugKSQ9SmN6Tc7B
xZgBZl5aUqss4I&e=
Post by David Payne
Hi Jens,
Thanks very much for this, I've tried it, and my MQ admin is telling
me that the message still has the MQMD format of MQHRF2, and includes
an
MQRFH2 header.
I only have the vaguest understanding of what that means, but it
sounds to me like that's what the targetClient=1 parameter should prevent.
In the CXF logs I can see that the targetClient setting is being
included, but noticed that the queue name I'm setting is
"jms:queue:...?targetClient=1".
I notice that your suggestion doesn't include the "jms:", so tried
Could not find conduit initiator for address: queue:///...?
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.w3.org_soapjms
_&d=DwICAg&c=2w5q_42kFG40MI2alLPgJw&r=bWOqkHjIZE0sZtdpFMIhm-
lcbhtB3cv0
Post by David Payne
8OlIr0lkKR4&m=zQkdcRErC6MdX-
5MalMM9zNj__roxHQSj0zPSS1eONo&s=a65MfwkHaO
Post by David Payne
MGWgZla2AgFNEo9gBuvScQhDnmAFHVMr0&e=
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPO
Post by David Payne
RTID);
Is there some other transportId value I should be using?
Any other thoughts welcome, of course.
Dave.
On Fri, 12 Oct 2018, 07:24 Jens, <
Post by Jens
Hi,
I suspect you want to tell MQ that the receiver is not a JMS client
but a "regular" consumer.
"queue:///" + queueConfig.getQueue() + "?targetClient=1"
Cheers,
Jens
Post by David Payne
I'm trying to send a one-way SOAP request over IBM MQ.
Unfortunately I know nothing about MQ and have no access to the
broker or its tools. My contact who manages the MQ instance knows
lots about MQ but nothing about JMS or CXF.
He's complaining that the messages I'm sending have a format of
MQHRF2.
Post by David Payne
Post by Jens
Post by David Payne
I _think_ he wants them to have a format of MQSTR.
--
https://urldefense.proofpoint.com/v2/url?u=http-3A__cxf.547215.n5.nab
ble.com_cxf-2Duser-
2Df547216.html&d=DwICAg&c=2w5q_42kFG40MI2alLPgJw&r
Post by David Payne
Post by Jens
=bWOqkHjIZE0sZtdpFMIhm-lcbhtB3cv08OlIr0lkKR4&m=zQkdcRErC6MdX-
5MalMM9z
Nj__roxHQSj0zPSS1eONo&s=4D_IhfenezgFJkvr5xBnsJn3DQTSWurhjFHTKzmXJyA
&e
Post by David Payne
Post by Jens
=
--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-
3A__cxf.547215.n5.nabble.com_cxf-2Duser-
2Df547216.html&d=DwICAg&c=2w5q_42kFG40MI2alLPgJw&r=bWOqkHjIZE0sZt
dpFMIhm-lcbhtB3cv08OlIr0lkKR4&m=zQkdcRErC6MdX-
5MalMM9zNj__roxHQSj0zPSS1eONo&s=4D_IhfenezgFJkvr5xBnsJn3DQTSWurhj
FHTKzmXJyA&e=
As a recipient of an email from Talend, your contact personal data will be on our systems. Please see our contacts privacy notice at Talend, Inc. <https://www.talend.com/contacts-privacy-policy/>
Loading...