You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "Lukasz L." <Lu...@sabre.com> on 2008/07/23 15:13:06 UTC

CXF BC provider setting wrong content-type for soap 1.1?

I'm using CXF BC provider to make a call to external web service. Target
service expects "Content-Type=text/xml" but CXF provider sends
"application/soap+xml" without regarding SOAP version which is 1.1.
I got an error:
"server found request content type to be 'application/soap+xml;
charset=UTF-8', but expected 'text/xml'."

In cxf.xml file I specified explicitly text/xml content type but it is
apparently disregarded
(<http-conf:client ContentType="text/xml" ... )
When I look into the code I see that
org.apache.servicemix.cxfbc.interceptors.JbiOutInterceptor
sets always "application/soap+xml" content type
(see fromNMSAttachments method line: message.put(Message.CONTENT_TYPE,
"application/soap+xml");)
should soap version be taken into account here?
is it a bug or should anything more be configured?
-- 
View this message in context: http://www.nabble.com/CXF-BC-provider-setting-wrong-content-type-for-soap-1.1--tp18610456p18610456.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: CXF BC provider setting wrong content-type for soap 1.1?

Posted by Freeman Fang <fr...@gmail.com>.
https://issues.apache.org/activemq/browse/SM-1483 track this issue

Freeman

Håkon Sagehaug wrote:
> Hi
>
> I was just wondering if this is fixed or has a jira, I've experienced the
> same problem
>
> Håkon
>
> 2008/7/24 Freeman Fang <fr...@gmail.com>
>
>   
>> Hi,
>>
>> Please fill a jira for us to track it.
>>
>> Regards
>> Freeman
>>
>>
>> Lukasz L. wrote:
>>
>>     
>>> I'm using CXF BC provider to make a call to external web service. Target
>>> service expects "Content-Type=text/xml" but CXF provider sends
>>> "application/soap+xml" without regarding SOAP version which is 1.1.
>>> I got an error:
>>> "server found request content type to be 'application/soap+xml;
>>> charset=UTF-8', but expected 'text/xml'."
>>>
>>> In cxf.xml file I specified explicitly text/xml content type but it is
>>> apparently disregarded
>>> (<http-conf:client ContentType="text/xml" ... )
>>> When I look into the code I see that
>>> org.apache.servicemix.cxfbc.interceptors.JbiOutInterceptor
>>> sets always "application/soap+xml" content type
>>> (see fromNMSAttachments method line: message.put(Message.CONTENT_TYPE,
>>> "application/soap+xml");)
>>> should soap version be taken into account here?
>>> is it a bug or should anything more be configured?
>>>
>>>
>>>       
>>     
>
>
>   


Re: CXF BC provider setting wrong content-type for soap 1.1?

Posted by Håkon Sagehaug <ha...@bccs.uib.no>.
Hi

I was just wondering if this is fixed or has a jira, I've experienced the
same problem

Håkon

2008/7/24 Freeman Fang <fr...@gmail.com>

> Hi,
>
> Please fill a jira for us to track it.
>
> Regards
> Freeman
>
>
> Lukasz L. wrote:
>
>> I'm using CXF BC provider to make a call to external web service. Target
>> service expects "Content-Type=text/xml" but CXF provider sends
>> "application/soap+xml" without regarding SOAP version which is 1.1.
>> I got an error:
>> "server found request content type to be 'application/soap+xml;
>> charset=UTF-8', but expected 'text/xml'."
>>
>> In cxf.xml file I specified explicitly text/xml content type but it is
>> apparently disregarded
>> (<http-conf:client ContentType="text/xml" ... )
>> When I look into the code I see that
>> org.apache.servicemix.cxfbc.interceptors.JbiOutInterceptor
>> sets always "application/soap+xml" content type
>> (see fromNMSAttachments method line: message.put(Message.CONTENT_TYPE,
>> "application/soap+xml");)
>> should soap version be taken into account here?
>> is it a bug or should anything more be configured?
>>
>>
>
>


-- 
Håkon Sagehaug, Software Developer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)

Re: CXF BC provider setting wrong content-type for soap 1.1?

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

Please fill a jira for us to track it.

Regards
Freeman

Lukasz L. wrote:
> I'm using CXF BC provider to make a call to external web service. Target
> service expects "Content-Type=text/xml" but CXF provider sends
> "application/soap+xml" without regarding SOAP version which is 1.1.
> I got an error:
> "server found request content type to be 'application/soap+xml;
> charset=UTF-8', but expected 'text/xml'."
>
> In cxf.xml file I specified explicitly text/xml content type but it is
> apparently disregarded
> (<http-conf:client ContentType="text/xml" ... )
> When I look into the code I see that
> org.apache.servicemix.cxfbc.interceptors.JbiOutInterceptor
> sets always "application/soap+xml" content type
> (see fromNMSAttachments method line: message.put(Message.CONTENT_TYPE,
> "application/soap+xml");)
> should soap version be taken into account here?
> is it a bug or should anything more be configured?
>   


Re: CXF BC provider setting wrong content-type for soap 1.1?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,
This error already get fixed, [1] track this issue.
[1]https://issues.apache.org/activemq/browse/SM-1483

thanks
Freeman

dhaas wrote:
> I had the same problem.  I assume it's a bug.  I wrote a quick and dirty
> interceptor to fix it.
>
> import org.apache.cxf.message.Message;
> import org.apache.cxf.phase.AbstractPhaseInterceptor;
> import org.apache.cxf.phase.Phase;
>
> public class ContentTypeFixer extends AbstractPhaseInterceptor<Message>{
>     private static final String CONTENT_TYPE = "text/xml";
>
>     public ContentTypeFixer(){
>         super(Phase.SEND);
>     }
>     
>     public void handleMessage(Message msg){
>         String contentType = (String)msg.get(Message.CONTENT_TYPE);
>         System.out.println("ContentTypeFixer found content type: " +
> contentType);
>         System.out.println("Replacing content type with: " + CONTENT_TYPE);
>         msg.put(Message.CONTENT_TYPE, CONTENT_TYPE);
>     }
>
> } 
>
> I added that to the out Interceptor list and that works for now.
>   


Re: CXF BC provider setting wrong content-type for soap 1.1?

Posted by dhaas <do...@issinc.com>.
I had the same problem.  I assume it's a bug.  I wrote a quick and dirty
interceptor to fix it.

import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;

public class ContentTypeFixer extends AbstractPhaseInterceptor<Message>{
    private static final String CONTENT_TYPE = "text/xml";

    public ContentTypeFixer(){
        super(Phase.SEND);
    }
    
    public void handleMessage(Message msg){
        String contentType = (String)msg.get(Message.CONTENT_TYPE);
        System.out.println("ContentTypeFixer found content type: " +
contentType);
        System.out.println("Replacing content type with: " + CONTENT_TYPE);
        msg.put(Message.CONTENT_TYPE, CONTENT_TYPE);
    }

} 

I added that to the out Interceptor list and that works for now.
-- 
View this message in context: http://www.nabble.com/CXF-BC-provider-setting-wrong-content-type-for-soap-1.1--tp18610456p18717245.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.