On Tuesday, December 13, 2011 1:14:09 AM manoj_cxf wrote:
> Hi,
> 
> How to set content type in CXF client code for web service.
> 
> Below is my code, which send content type as text/xml while invoking web
> wervice.
> I have to have content type as "application/soap+xml; charset=utf-8".

Question:   can you also check the soap version you need?   SOAP 1.1 calls for 
setting it to text/xml whild SOAP 1.2 uses application/soap+xml.     If the 
services is requiring application/soap+xml then I kind of expect it would also 
like SOAP 1.2. 

If that's the case, you should just be able to add:
factory.setBindingId("http://schemas.xmlsoap.org/wsdl/soap12/";);


Dan



> 
> How can i achieve this in this code.
> 
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> 
>                       factory.getInInterceptors().add(new 
> LoggingInInterceptor());
>                       factory.getOutInterceptors().add(new 
> LoggingOutInterceptor());
>                       factory.setServiceClass(IShuiOnService.class);
> 
> factory.setAddress("http://localhost/Test/TestAppService/TestService.svc";);
> 
>                       factory.setUsername("username");
>                       factory.setPassword("pass");
>                       IShuiOnService client = (IShuiOnService) 
> factory.create();
>                       String message = client.getUserPoints("12/12/2011");
>                       System.out.println("Server said: " + message);
> 
> 
> 
> thanks,
> Manoj
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Setting-Content-type-in-CXF-Client-tp507086
> 5p5070865.html Sent from the cxf-user mailing list archive at Nabble.com.
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to