Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F72717633 for ; Mon, 1 Jun 2015 08:48:18 +0000 (UTC) Received: (qmail 87392 invoked by uid 500); 1 Jun 2015 08:48:18 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 87354 invoked by uid 500); 1 Jun 2015 08:48:18 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 87341 invoked by uid 99); 1 Jun 2015 08:48:18 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 08:48:18 +0000 Date: Mon, 1 Jun 2015 08:48:18 +0000 (UTC) From: "Christian Koch (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CXF-6430) SwA: Wrong Content-Type of root part MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Christian Koch created CXF-6430: ----------------------------------- Summary: SwA: Wrong Content-Type of root part Key: CXF-6430 URL: https://issues.apache.org/jira/browse/CXF-6430 Project: CXF Issue Type: Bug Components: Transports Affects Versions: 3.0.1 Reporter: Christian Koch we are implementing an ebMS3 solution using cxf 3. The profile to be implemented has the following requirements: - SwA (no MTOM) - SOAP 1.2 - Due to the design of ebMS3 there is no WSDL As there is no WSDL we use the javax.xml.ws.Dispatch API with SOAPBinding.SOAP12HTTP_BINDING as binding. The message ebMS3 expects, according to its specification looks as follows: Content-Type: Multipart/Related; boundary=MIME_boundary; type=application/soap+xml; start="" --MIME_boundary Content-Type: application/soap+xml; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-ID: --MIME_boundary Content-Type: image/tiff Content-Transfer-Encoding: binary Content-ID: ...binary TIFF image of the car... --MIME_boundary-- However, what we produce is as follows: Content-Type:multipart/related; type="application/soap+xml"; boundary="MIME_boundary"; start=""; start-info="application/soap+xml" Accept:*/* User-Agent:Apache CXF 3.0.1 Cache-Control:no-cache Pragma:no-cache Host:127.0.0.1:8080 Connection:keep-alive --MIME_boundary Content-Type: text/xml; charset=UTF-8; type="application/soap+xml" Content-Transfer-Encoding: binary Content-ID: --MIME_boundary Content-Type: image/tiff Content-Transfer-Encoding: binary Content-ID: ...binary TIFF image of the car... -- MIME_boundary-- The difference lies in the Content-Type of the root part, which is expected as application/soap+xml but set to text/xml. When testing against an Axis driven implementation we get the following error: Error while executing the transport Method RuntimeException: Invalid Content-Type: text/xml; charset=UTF-8; type="application/soap+xml" Our dispatch method looks like this: public SOAPMessage dispatch(final SOAPMessage soapMessage) { final QName serviceName = new QName("http://example.com", "msh-dispatch-service"); final QName portName = new QName("http://example.com", "msh-dispatch"); final javax.xml.ws.Service service = javax.xml.ws.Service.create(serviceName); service.addPort(portName, SOAPBinding.SOAP12HTTP_BINDING, "127.0.0.1:8080"); Dispatch dispatch = service.createDispatch(portName, SOAPMessage.class, javax.xml.ws.Service.Mode.MESSAGE); Policy policy = policyFactory.parsePolicy("mypolicy.xml"); dispatch.getRequestContext().put(PolicyConstants.POLICY_OVERRIDE, policy); SOAPMessage result = dispatch.invoke(soapMessage); return result; } -- This message was sent by Atlassian JIRA (v6.3.4#6332)