0 Replies Latest reply: Dec 10, 2009 8:42 AM by 843830 RSS

    Unsupported Content-Type: application/soap+xml

    843830
      I've created a simple composite application with a bpel jbi module using glassfishesbv21.
      The bpel process starts when I invoke a webservice (soap-binding).
      When I run a test case for the ca everything works fine.
      When I call the webservice from an external web application, the client (created with netbeans wizard bundled in glassfishesbv21) obtains the response as expected and doesn't report any exception while the server rises a com.sun.xml.ws.server.UnsupportedMediaException.
      Googoling I found that this maybe caused by the use of soap1.1 and soap1.2 but is also true that JAX-WS runtime should look into the WSDL to determine the binding being used and configures itself accordingly.

      the stacktrace is:
      ....
      Finished processing outbound messages.
      Request doesnt have a Content-Type
      com.sun.xml.ws.server.UnsupportedMediaException: Request doesnt have a Content-Type
      at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:267)
      at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
      at com.sun.xml.ws.transport.http.HttpAdapter.invokeAsync(HttpAdapter.java:341)
      at com.sun.jbi.httpsoapbc.embedded.JAXWSGrizzlyRequestProcessor.processAsynchRequest(JAXWSGrizzlyRequestProcessor.java:386)
      at com.sun.jbi.httpsoapbc.embedded.JAXWSGrizzlyRequestProcessor.service(JAXWSGrizzlyRequestProcessor.java:220)
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
      at com.sun.jbi.httpsoapbc.embedded.JBIGrizzlyAsyncFilter.doFilter(JBIGrizzlyAsyncFilter.java:95)
      at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
      at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
      at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
      at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
      Unsupported Content-Type: application/soap+xml Supported ones are: [text/xml]
      com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/soap+xml Supported ones are: [text/xml]
      at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:291)
      at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128)
      ...
      ====[com.sun.xml.ws.assembler.server:request]====
      <?xml version="1.0" ?>
      <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <soap-env:Header>
      <wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action>
      <wsa:To>http://localhost:19081/coreAnagrafeUpdateService/coreAnagrafeUpdatePort</wsa:To>
      <wsa:ReplyTo>
      <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
      </wsa:ReplyTo>
      <wsa:MessageID>uuid:778b135f-3fdf-44b2-b53e-ebaab7441e40</wsa:MessageID>
      </soap-env:Header>
      <soap-env:Body></soap-env:Body>
      </soap-env:Envelope>
      ============
      ...
      ====[com.sun.xml.ws.assembler.server:response]====
      <?xml version="1.0" ?>
      <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
      <S:Body>
      <S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope" xmlns="">
      <faultcode>S:Server</faultcode>
      <faultstring>javax.jbi.messaging.MessagingException: HTTPBC-E00798: Message normalization failed</faultstring>
      </S:Fault>
      </S:Body>
      </S:Envelope>
      ============
      Unsupported Content-Type: application/soap+xml Supported ones are: [text/xml]
      com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/soap+xml Supported ones are: [text/xml]
      at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:291)
      at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:128)
      at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:287)
      ...
      ====[com.sun.xml.ws.assembler.server:request]====
      <?xml version="1.0" ?>
      <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <soap-env:Header>
      <wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action>
      <wsa:To>http://localhost:19081/coreAnagrafeUpdateService/coreAnagrafeUpdatePort/mex</wsa:To>
      <wsa:ReplyTo>
      <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
      </wsa:ReplyTo>
      <wsa:MessageID>uuid:778b135f-3fdf-44b2-b53e-ebaab7441e40</wsa:MessageID>
      </soap-env:Header>
      <soap-env:Body></soap-env:Body>
      </soap-env:Envelope>
      ============

      the wsdl is:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <definitions name="coreAnagrafeUpdateService"
      targetNamespace="http://service.box.nexus.com/"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:tns="http://service.box.nexus.com/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <types>
           <xsd:schema>
      <xsd:import namespace="http://service.box.nexus.com/" schemaLocation="core_anagrafe.xsd"/>
      </xsd:schema>
      </types>
      <message name="coreAnagrafeUpdateOperationRequest">
      <part name="parameters" element="tns:requestParameter"/>
      </message>
      <message name="coreAnagrafeUpdateOperationResponse">
      <part name="parameters" element="tns:coreAnagrafeResponse"/>
      </message>
      <message name="coreAnagrafeUpdateOperationFault">
      <part name="part1" element="tns:faultMessage"/>
      </message>
      <portType name="coreAnagrafeUpdatePortType">
      <operation name="coreAnagrafeUpdateOperation">
      <input message="tns:coreAnagrafeUpdateOperationRequest"/>
      <output message="tns:coreAnagrafeUpdateOperationResponse"/>
      <wsdl:fault name="fault1" message="tns:coreAnagrafeUpdateOperationFault"/>
      </operation>
      </portType>
      <binding name="coreAnagrafeUpdateBinding" type="tns:coreAnagrafeUpdatePortType">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
      <operation name="coreAnagrafeUpdateOperation">
      <soap:operation soapAction=""/>
      <input>
      <soap:body use="literal" />
      </input>
      <output>
      <soap:body use="literal" />
      </output>
      <wsdl:fault name="fault1">
      <soap:fault use="literal" name="fault1"/>
      </wsdl:fault>
      </operation>
      </binding>
      <service name="coreAnagrafeUpdateService">
      <port name="coreAnagrafeUpdatePort" binding="tns:coreAnagrafeUpdateBinding">
      <soap:address location="http://localhost:19081/coreAnagrafeUpdateService/coreAnagrafeUpdatePort"/>
      </port>
      </service>
      </definitions>


      Can anyone help me to understand the problem and solve it?

      Thanks in advance.