Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support header child elements (like payload in message element) #239

Closed
gucce opened this issue May 17, 2017 · 0 comments
Closed

Support header child elements (like payload in message element) #239

gucce opened this issue May 17, 2017 · 0 comments
Assignees
Milestone

Comments

@gucce
Copy link
Contributor

gucce commented May 17, 2017

Background

Citrus version: 2.7.1

Problem

There are two ways to write the actual XML message body in a ws:send action :

  • <data> which is of type xs:string
  • <payload> which allows a arbitrary XML structure

To write the XML SOAP header in a ws:send action there is only <data>. This means that you must always wrap the XML structure in a CDATA tag.
I see no reason why <payload> is not allowed in a <header> tag.

Solution

Allow <payload> as child of <header>.

Example

<!-- Currently this is how you have to define a SOAP message -->
<ws:send endpoint="someEndpoint">
    <message>
        <payload>
            <someXmlStructure>
                ...
            </someXmlStructure>
        </payload>
    </message>
    <header>
        <data>
            <![CDATA[
            <someHeaderXmlStructureEnclosedInCDATA>
                ...
            </someHeaderXmlStructureEnclosedInCDATA>
            ]]>
        </data>
    </header>
</ws:send>

<!-- This should be possible -->
<ws:send endpoint="someEndpoint">
    <message>
        <payload>
            <someXmlStructure>
                ...
            </someXmlStructure>
        </payload>
    </message>
    <header>
        <payload><!-- this is currently not possible -->
            <someHeaderXmlStructure>
                ...
            </someHeaderXmlStructure>
        </payload>
    </header>
</ws:send>
@christophd christophd added this to the v2.7.2 milestone May 18, 2017
@christophd christophd self-assigned this Jun 29, 2017
@christophd christophd changed the title <header> does not allow <payload> child element (like <message> does) Support header child elements (like payload in message element) Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants