I see following are the few common errors that developer might come across during the initial stages of OSB learning.
1)
Failed to set the value of context variable "body". Value must be an instance of {http://schemas.xmlsoap.org/soap/envelope/}Body.
Failed to set the value of context variable "header". Value must be an instance of {http://schemas.xmlsoap.org/soap/envelope/}Header.
This error is because of, OSB always enclose the context variables $body and $header with <soap-env:Body> and <soap-env:Header> respectively. So when we are manipulating $header and $body we should make sure that these soap-env tags are not removed. For example, doing in the following way in an Assign activity can cause the above error as we are not maintaining <soap-env:Body> tag in $body variable.
Expression: <Value>Sample Value</Value>
Variable: body
And the correct usage in assign activity is like below:
Expression:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <Value>Sample Value</Value>
</soapenv:Body>
Variable: body
When we use service call out, the variable given for ‘SOAP Request Header’ should always contain <soap-env:Header> element irrespective of the selection of either ‘Çonfigure SOAP Body’ or ‘Configure Payload Document’. Otherwise again the above header related error will come.
2)
Invalid message: the SOAP Header value is not an XML instance
One of the scenarios that this error can come is, when we use the service call out and the variable given for ‘SOAP Request Header’ is null.
dvm:lookup(‘RestQuerySampleTest/dvmExtract’,’KeyType’,’api’,’Value’,”)
Variable name RunTimeDVM
Insert
Thank you. This tip saved my day!
Thanks…for easy understanding
I am wokring on OSB project where in message flow I need to read the mail and iterate over the attachments.
I am using following expression
we have Upgraded OSB from 9 to 10g R3
for Each variable [x] in ./ctx:attachment/ctx:body/ctx:binary-content/@ref of variables fileAttachments
Buts its not coming in side the loop
I printed my attachment variable.
text/plain; name=”20121118130513.txt”
20121118130513.txt
attachment; filename=”loadshed20121118130513.txt”;
size=1379; creation-date=”Sat, 18 Aug 2012 02:42:11 GMT”;
modification-date=”Sat, 18 Aug 2012 03:30:15 GMT”
base64
FNAM 20121118130513.txt
EOF
>
Please help me and suggest