Showing posts with label soap. Show all posts
Showing posts with label soap. Show all posts

Friday 9 December 2016

OSB-382032: The message must be an instance of: {http://www.w3.org/2003/05/soap-envelope}Envelope

The error could be as seen below :

<soap:Text  xml:lang="en">
OSB-382032: The message must be an instance of: {http://www.w3.org/2003/05/soap-envelope}Envelope
</soap:Text>
</soap:Reason>
<soap:Detail>
<con:stack-trace  xmlns:con="http://www.bea.com/wli/sb/context">
com.bea.wli.sb.service.handlerchain.HandlerException: The message must be an instance of: {http://www.w3.org/2003/05/soap-envelope}Envelope
 at com.bea.wli.sb.service.handlerchain.handlers.ComputeOperation$1.getPayload(ComputeOperation.java:204)
 at com.bea.wli.sb.services.bindinglayer.BindingOperationMapper$QNameMapper.computeOperationName(BindingOperationMapper.java:564)
 at com.bea.wli.sb.service.handlerchain.handlers.ComputeOperation.dispatch(ComputeOperation.java:93)


Analysis:
This issue comes when you are invoking a SOAP 1.2 web service.
The request you sent, to service must have namespace declaration with
http://www.w3.org/2003/05/soap-envelope

I see 3 differences in SOAP 1.1 & SOAP 1.2 :
  • SOAP 1.2 uses "application/soap+xml" as Content-Type and SOAP 1.1 uses "text/xml".
  • SOAP 1.2 does not use SOAPAction header line.
  • SOAP 1.2 uses "http://www.w3.org/2003/05/soap-envelope" as the envolope namespace and SOAP 1.1 uses "http://schemas.xmlsoap.org/soap/envelope/".

Solution :
Make sure the payload you are sending to Target SOAP 1.2 service is having correct namespace declaration.
Your payload should be something like below :

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">

<soapenv:Header  xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
</soapenv:Header>
<soapenv:Body  xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<get:string  xmlns:get="http://xmlns.oracle.com/OSB_App_Jaguar/Santa/GetSantaDetails"></get:string>
</soapenv:Body>
</soapenv:Envelope>