You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Steve Wardell <ok...@yahoo.com> on 2013/05/20 22:57:04 UTC

Can't Add ReplyTo Header

I generated a client from a WSDL using the CFX 2.7.4 library. The service I am consuming requires a replyTo for responses to be sent to. This is being used as a standalone client with no Spring. The snippit that I am trying is below, but TCPMon does not show any content to the header. Any assistance would be appreciated.

        DMSCCSMProcess_Service ss = new DMSCCSMProcess_Service(wsdlURL, SERVICE_NAME);
        DMSCCSMProcess servicePort = ss.getDMSCCSMProcessPort();

AddressingBuilder builder =
                AddressingBuilder.getAddressingBuilder();
        AddressingProperties maps = builder.newAddressingProperties();
        AttributedURIType to = new AttributedURIType();
        to.setValue("http://www.reply-address-here.com/service");
        EndpointReferenceType toRef = new EndpointReferenceType();
        toRef.setAddress(to);
        maps.setTo(toRef);
        maps.setReplyTo(toRef);
        //associate MAPs with request context
        Map<String, Object> requestContext =
                ((BindingProvider)servicePort).getRequestContext();
        requestContext.put(CLIENT_ADDRESSING_PROPERTIES, maps);


Thanks,
Steve

Re: Can't Add ReplyTo Header

Posted by Steve Wardell <ok...@yahoo.com>.
Thank you, that helped us get it working!


Steve


________________________________
 From: Freeman Fang <fr...@gmail.com>
To: users@cxf.apache.org; Steve Wardell <ok...@yahoo.com> 
Sent: Monday, May 20, 2013 9:18 PM
Subject: Re: Can't Add ReplyTo Header
 

Hi,

Ensure you add
org.apache.cxf.ws.addressing.MAPAggregator
org.apache.cxf.ws.addressing.soap.MAPCodec
for your client outInterceptors
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-5-21, at 上午4:57, Steve Wardell wrote:

> I generated a client from a WSDL using the CFX 2.7.4 library. The service I am consuming requires a replyTo for responses to be sent to. This is being used as a standalone client with no Spring. The snippit that I am trying is below, but TCPMon does not show any content to the header. Any assistance would be appreciated.
> 
>         DMSCCSMProcess_Service ss = new DMSCCSMProcess_Service(wsdlURL, SERVICE_NAME);
>         DMSCCSMProcess servicePort = ss.getDMSCCSMProcessPort();
> 
> AddressingBuilder builder =
>                 AddressingBuilder.getAddressingBuilder();
>         AddressingProperties maps = builder.newAddressingProperties();
>         AttributedURIType to = new AttributedURIType();
>         to.setValue("http://www.reply-address-here.com/service");
>         EndpointReferenceType toRef = new EndpointReferenceType();
>         toRef.setAddress(to);
>         maps.setTo(toRef);
>         maps.setReplyTo(toRef);
>         //associate MAPs with request context
>         Map<String, Object> requestContext =
>                 ((BindingProvider)servicePort).getRequestContext();
>         requestContext.put(CLIENT_ADDRESSING_PROPERTIES, maps);
> 
> 
> Thanks,
> Steve

Re: Can't Add ReplyTo Header

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Ensure you add
org.apache.cxf.ws.addressing.MAPAggregator
org.apache.cxf.ws.addressing.soap.MAPCodec
for your client outInterceptors
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-5-21, at 上午4:57, Steve Wardell wrote:

> I generated a client from a WSDL using the CFX 2.7.4 library. The service I am consuming requires a replyTo for responses to be sent to. This is being used as a standalone client with no Spring. The snippit that I am trying is below, but TCPMon does not show any content to the header. Any assistance would be appreciated.
> 
>         DMSCCSMProcess_Service ss = new DMSCCSMProcess_Service(wsdlURL, SERVICE_NAME);
>         DMSCCSMProcess servicePort = ss.getDMSCCSMProcessPort();
> 
> AddressingBuilder builder =
>                 AddressingBuilder.getAddressingBuilder();
>         AddressingProperties maps = builder.newAddressingProperties();
>         AttributedURIType to = new AttributedURIType();
>         to.setValue("http://www.reply-address-here.com/service");
>         EndpointReferenceType toRef = new EndpointReferenceType();
>         toRef.setAddress(to);
>         maps.setTo(toRef);
>         maps.setReplyTo(toRef);
>         //associate MAPs with request context
>         Map<String, Object> requestContext =
>                 ((BindingProvider)servicePort).getRequestContext();
>         requestContext.put(CLIENT_ADDRESSING_PROPERTIES, maps);
> 
> 
> Thanks,
> Steve