Common Mistakes in OSB message flow

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.

Advertisement

4 Responses to “Common Mistakes in OSB message flow”


  1. 1 Anonymous March 28, 2021 at 6:48 PM

    dvm:lookup(‘RestQuerySampleTest/dvmExtract’,’KeyType’,’api’,’Value’,”)

    Variable name RunTimeDVM

    Insert

  2. 2 rafaelreuber October 16, 2016 at 7:38 PM

    Thank you. This tip saved my day!

  3. 3 Anonymous September 20, 2016 at 3:09 AM

    Thanks…for easy understanding

  4. 4 Anonymous August 19, 2012 at 10:04 AM

    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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.




Pages

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 379 other subscribers

Enter your email address to follow this blog and receive notifications of new posts by email.


%d bloggers like this: