You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by David Payne <da...@gmail.com> on 2018/10/11 15:29:48 UTC

SOAP over IBM MQ - MQHRF2 Format

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.


RE: SOAP over IBM MQ - MQHRF2 Format

Posted by Andrei Shakirin <as...@talend.com>.
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-----
> From: Jens [mailto:smixdev@dzbank.de]
> Sent: Freitag, 12. Oktober 2018 10:11
> To: users@cxf.apache.org
> 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
> JMSConfiguration style instead:
> 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=
>
>
> David Payne-2 wrote
> > 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:
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.w3.org_soapjms
> > _&d=DwICAg&c=2w5q_42kFG40MI2alLPgJw&r=bWOqkHjIZE0sZtdpFMIhm-
> lcbhtB3cv0
> > 8OlIr0lkKR4&m=zQkdcRErC6MdX-
> 5MalMM9zNj__roxHQSj0zPSS1eONo&s=a65MfwkHaO
> > MGWgZla2AgFNEo9gBuvScQhDnmAFHVMr0&e=
> >
> > I assume this is because I'm setting this on my JaxWsProxyFactoryBean:
> >
> >   JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> >
> >
> factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPO
> > 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, &lt;
>
> > smixdev@
>
> > &gt; wrote:
> >
> >> 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
> >>
> >>
> >> David Payne-2 wrote
> >> > 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:
> >> 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
> >> =bWOqkHjIZE0sZtdpFMIhm-lcbhtB3cv08OlIr0lkKR4&m=zQkdcRErC6MdX-
> 5MalMM9z
> >>
> Nj__roxHQSj0zPSS1eONo&s=4D_IhfenezgFJkvr5xBnsJn3DQTSWurhjFHTKzmXJyA
> &e
> >> =
> >>
>
>
>
>
>
> --
> 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/>



Re: SOAP over IBM MQ - MQHRF2 Format

Posted by Jens <sm...@dzbank.de>.
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


David Payne-2 wrote
> 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.
> 
> 
> On Fri, 12 Oct 2018, 07:24 Jens, &lt;

> smixdev@

> &gt; wrote:
> 
>> 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
>>
>>
>> David Payne-2 wrote
>> > 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

Re: SOAP over IBM MQ - MQHRF2 Format

Posted by David Payne <da...@gmail.com>.
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.


On Fri, 12 Oct 2018, 07:24 Jens, <sm...@dzbank.de> wrote:

> 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
>
>
> David Payne-2 wrote
> > 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
>

Re: SOAP over IBM MQ - MQHRF2 Format

Posted by Jens <sm...@dzbank.de>.
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


David Payne-2 wrote
> 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