You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by James Carr <ja...@gmail.com> on 2012/10/18 17:38:08 UTC
Error When Communicating with 3rd Party SOAP Service
Hey All,
I've used CXF for quite sometime and this week I was putting together
a client for a 3rd party service and get the following error when
trying to call the service:
HTTP response '415: Cannot process the message because the content
type 'text/xml; charset=UTF-8' was not the expected type
'application/soap+xml; charset=utf-8'.' when communicating with
http//service.example.com/foo/bar
Any ideas? Here is a simple snippet of the service call:
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(ILoginService.class);
factory.setAddress("https://service4.example.com/services/LoginService");
ILoginService service = (ILoginService) factory.create();
service.authenticate(new TokenRequest());
Thanks,
James
Re: Error When Communicating with 3rd Party SOAP Service
Posted by James Carr <ja...@gmail.com>.
Also, sorry! I realized when I just replied I sent this to the camel
group instead of the CXF group... they're right next to each other in
my contacts list. :-D
Thanks,
James
On Thu, Oct 18, 2012 at 12:40 PM, James Carr <ja...@gmail.com> wrote:
> I'm actually using JDK7 but I got it working. I needed to set the
> bindingId to SOAP 1.2 in the JaxWsProxyFactoryBean.
>
> factory.setBindingId("http://schemas.xmlsoap.org/wsdl/soap12/");
>
>
> That made it work.
>
>
> Thanks,
> James
>
>
> On Thu, Oct 18, 2012 at 11:23 AM, David Karlsen <da...@gmail.com> wrote:
>> Are you on an old sun jdk? They have that problem. Upgrade to the latest
>> version.
>> Den 18. okt. 2012 17:38 skrev "James Carr" <ja...@gmail.com>
>> følgende:
>>>
>>> Hey All,
>>>
>>> I've used CXF for quite sometime and this week I was putting together
>>> a client for a 3rd party service and get the following error when
>>> trying to call the service:
>>>
>>> HTTP response '415: Cannot process the message because the content
>>> type 'text/xml; charset=UTF-8' was not the expected type
>>> 'application/soap+xml; charset=utf-8'.' when communicating with
>>> http//service.example.com/foo/bar
>>>
>>> Any ideas? Here is a simple snippet of the service call:
>>>
>>> JaxWsProxyFactoryBean factory = new
>> JaxWsProxyFactoryBean();
>>> factory.getInInterceptors().add(new
>> LoggingInInterceptor());
>>> factory.getOutInterceptors().add(new
>> LoggingOutInterceptor());
>>> factory.setServiceClass(ILoginService.class);
>>>
>>> factory.setAddress("
>> https://service4.example.com/services/LoginService");
>>>
>>> ILoginService service = (ILoginService) factory.create();
>>> service.authenticate(new TokenRequest());
>>>
>>> Thanks,
>>> James
Re: Error When Communicating with 3rd Party SOAP Service
Posted by James Carr <ja...@gmail.com>.
I'm actually using JDK7 but I got it working. I needed to set the
bindingId to SOAP 1.2 in the JaxWsProxyFactoryBean.
factory.setBindingId("http://schemas.xmlsoap.org/wsdl/soap12/");
That made it work.
Thanks,
James
On Thu, Oct 18, 2012 at 11:23 AM, David Karlsen <da...@gmail.com> wrote:
> Are you on an old sun jdk? They have that problem. Upgrade to the latest
> version.
> Den 18. okt. 2012 17:38 skrev "James Carr" <ja...@gmail.com>
> følgende:
>>
>> Hey All,
>>
>> I've used CXF for quite sometime and this week I was putting together
>> a client for a 3rd party service and get the following error when
>> trying to call the service:
>>
>> HTTP response '415: Cannot process the message because the content
>> type 'text/xml; charset=UTF-8' was not the expected type
>> 'application/soap+xml; charset=utf-8'.' when communicating with
>> http//service.example.com/foo/bar
>>
>> Any ideas? Here is a simple snippet of the service call:
>>
>> JaxWsProxyFactoryBean factory = new
> JaxWsProxyFactoryBean();
>> factory.getInInterceptors().add(new
> LoggingInInterceptor());
>> factory.getOutInterceptors().add(new
> LoggingOutInterceptor());
>> factory.setServiceClass(ILoginService.class);
>>
>> factory.setAddress("
> https://service4.example.com/services/LoginService");
>>
>> ILoginService service = (ILoginService) factory.create();
>> service.authenticate(new TokenRequest());
>>
>> Thanks,
>> James
Re: Error When Communicating with 3rd Party SOAP Service
Posted by David Karlsen <da...@gmail.com>.
Are you on an old sun jdk? They have that problem. Upgrade to the latest
version.
Den 18. okt. 2012 17:38 skrev "James Carr" <ja...@gmail.com>
følgende:
>
> Hey All,
>
> I've used CXF for quite sometime and this week I was putting together
> a client for a 3rd party service and get the following error when
> trying to call the service:
>
> HTTP response '415: Cannot process the message because the content
> type 'text/xml; charset=UTF-8' was not the expected type
> 'application/soap+xml; charset=utf-8'.' when communicating with
> http//service.example.com/foo/bar
>
> Any ideas? Here is a simple snippet of the service call:
>
> JaxWsProxyFactoryBean factory = new
JaxWsProxyFactoryBean();
> factory.getInInterceptors().add(new
LoggingInInterceptor());
> factory.getOutInterceptors().add(new
LoggingOutInterceptor());
> factory.setServiceClass(ILoginService.class);
>
> factory.setAddress("
https://service4.example.com/services/LoginService");
>
> ILoginService service = (ILoginService) factory.create();
> service.authenticate(new TokenRequest());
>
> Thanks,
> James