Hello,

I've tried to write a simple example in which a service consumer (SC) calls
a service  provider (SP) via servicemix. The SP is a web service running on
jboss. The SC is a java application using JAX-RPC to call the SP.
Without servicemix everything works well. Now I've put servicemix in the
middle using the following servicemix.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0";
       xmlns:foo="http://servicemix.org/demo/";>
    
  <!-- the JBI container -->
  <sm:container id="jbi"
                useMBeanServer="true"
                createMBeanServer="true"
                dumpStats="true"
                statsInterval="10">
                
        <sm:activationSpecs>
        
                <!-- Create a http server binding on port 8912  and have it 
forward to the
foo:stockQuote -->      
                <sm:activationSpec componentName="httpReceiver"         
                                                   service="foo:httpBinding"
                                                   endpoint="httpReceiver"
                                                   
destinationService="foo:stockQuote">
                  <sm:component>
                    <bean 
class="org.apache.servicemix.components.http.HttpConnector">
                              <property name="host" value="localhost"/>
                              <property name="port" value="8912"/>
                    </bean>
                  </sm:component>
                </sm:activationSpec>
        
                <!-- This just invokes another service -->
                <sm:activationSpec componentName="stockQuote"   
                                                   service="foo:stockQuote"
                                                   endpoint="stockQuote">
                  <sm:component>
                        <bean 
class="org.apache.servicemix.components.http.HttpInvoker">
                                <property name="url"
value="http://10.3.102.192:8080/opsservice/ops"/>
                        </bean>
                  </sm:component>
                </sm:activationSpec>
                
        </sm:activationSpecs>
  </sm:container>
  
</beans>

I can see that the message is passed over to jboss. There it throws the
following error:

javax.xml.rpc.JAXRPCException: Cannot create SOAPFault message for:
javax.xml.rpc.soap.SOAPFaultException: javax.xml.soap.SOAPException:
Unsupported content type: text/html; charset=UTF-8

After some investigation with a http monitoring tool I finally figured out
that jboss is right, because servicemix sends a wrong http header which
looks like the following:


  <HTTPHeaders>
  <script_name /> 
  <server_protocol>HTTP/1.1</server_protocol> 
  <server_port>8912</server_port> 
  <user-agent>Java/1.5.0_06</user-agent> 
  <path_info>/</path_info> 
  <request_method>POST</request_method> 
  <remote_addr>127.0.0.1</remote_addr> 
  <accept>text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*;
q=.2</accept> 
  <connection>keep-alive</connection> 
  <content_length>435</content_length> 
  <server_name>localhost</server_name> 
  <soapaction>""</soapaction> 
  <content_type>text/xml; charset=utf-8</content_type> 
  <remote_host>127.0.0.1</remote_host> 
  <content-type>text/html; charset=UTF-8</content-type> 
  <host>10.3.102.192:8080</host> 
  <content-length>434</content-length> 
  </HTTPHeaders>

Especially interesting is that it contains two content-type entries. The
second one is wrong. I assume is was added by servicemix.

The original http header which works fine looks like this:

  <HTTPHeaders>
  <content-type>text/xml; charset=utf-8</content-type> 
  <accept>text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*;
q=.2</accept> 
  <content-length>420</content-length> 
  <soapaction>""</soapaction> 
  <user-agent>Java/1.5.0_06</user-agent> 
  <host>10.3.102.192:8080</host> 
  <connection>keep-alive</connection> 
  </HTTPHeaders>

Any ideas what to do? Is there a way to configure how the http alteration
works?
I just want to send a SOAP message unmodified from the SC to the SP.
--
View this message in context: 
http://www.nabble.com/wrong-http-header-t1608026.html#a4359390
Sent from the ServiceMix - User forum at Nabble.com.

Reply via email to