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

Comments

Projects
None yet
2 participants
@gucce
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 the READY label May 18, 2017

@christophd christophd added this to the v2.7.2 milestone May 18, 2017

@christophd christophd added IN PROGRESS and removed READY labels Jun 29, 2017

@christophd christophd self-assigned this Jun 29, 2017

@christophd christophd changed the title from <header> does not allow <payload> child element (like <message> does) to Support header child elements (like payload in message element) Jun 29, 2017

@christophd christophd removed the IN PROGRESS label Jun 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment