Hello,
Would really appreciate some assistance with this error message.
Working on a soap request web service and receiving the following message:
*HTTP/1.1 415 Cannot process the message because the content type
'text/xml; charset=utf-8' was not the expected type
'application/soap+xml; charset=utf-8'*
This is the RPG soap message and request.
//----------------------------------------------------------------------
// Create soap envelope
//----------------------------------------------------------------------
begsrCreateSoap;
Soap =
'<?xml version="1.0" encoding="UTF-8"?>'+
'<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"'+
'xmlns:tem="http://tempuri.org/"'+
'xmlns:ari="http://schemas.datacontract.org/2004/07/ARI.AMS.Domain" +
xmlns:ari1="ARI.AMS.Domain"'+
'xmlns:ari2="ARI.AMS.Domain.Person"'+
'xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays"'+
'xmlns:ari3="ARI.AMS.Domain.ARIVehicle"'+
'xmlns:ari4='+
'"http://schemas.datacontract.org/2004/07/ARI.AMS.Data.Model">'+
'<soap:Header>'+
'<o:Security s:mustUnderstand="1"'+
'xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-'+
'wss-wssecurity-secext-1.0.xsd" xmlns:s="s"> <o:UsernameToken>'+
'<o:Username>TEST_AMS</o:Username> '+
'<o:Password Type="http://docs.oasis-'+
'open.org/wss/2004/01/oasis-200401-wss-username-token-profile-'+
'1.0#PasswordText">lldjsrf43b5i43ub543abcd</o:Password>'+
'</o:UsernameToken> '+
'</o:Security></soap:Header>'+
'<soap:Body>'+
'<tem:SearchPerson>'+
'<!--Optional:-->'+
'<tem:person>'+
'<ari:DriverId>506152</ari:DriverId>'+
'</tem:person>'+
'</tem:SearchPerson>'+
' </soap:Body>'+
'</soap:Envelope>';
endsr;
//----------------------------------------------------------------------
// Post request
//----------------------------------------------------------------------
begsrPostRequest;
soapData =%addr(SOAP:*data);
soapDataLength =%len(SOAP);
elemStartProc =*null;
elemEndProc =%paddr(GetResponse);
userData =%addr(response);
returnCode =http_url_post_xml(postURL
:soapData
:soapDataLength
:elemStartProc
:elemEndProc
:userData
:HTTP_TIMEOUT
:HTTP_USERAGENT
:'text/xml; charset=utf-8'
:postURL);
endsr;
The httpapi_debug.txt file is attached.
Some of the documentation I found indicates that it may be a binding
issue but have not found an appropriate solution.
Regards,
Debra