'org.apache.cxf.transport.http.HTTPException: HTTP response '415: Unsupported Media Type'
I am trying to invoke o SOAP web service using an apache CXF client and the error above appears. I tried to fix this by using SOAP12HTTP_BINDING but then the following error occurs:
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted
The outbound message is the folowing:
Address: myHostName
HttpMethod: POST
Content-Type: text/xml
ExchangeId: myExchangeId
ServiceName: myServiceName
PortName: myPortName
PortTypeName: DummyImpl
Headers: {SOAPAction="mySoapAction",
Accept=*/*, Host=myHost,
Accept-Encoding=gzip,deflate,
Content-Type=application/soap+xml;
charset=UTF-8;action="}
Payload: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="myNamespace">
<soapenv:Body>
<a:operatioName>
...
</a:operatioName>
</soapenv:Body>
</soapenv:Envelope>
Solution 1:[1]
Turns out the problem was the Content-Type header, i changed it to text/xml;charset=UTF-8 and it worked.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Skouprinio |
