Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Issue with generating request XML body using Operation's build method #27

Open
njng opened this issue Jan 17, 2020 · 0 comments
Open

Issue with generating request XML body using Operation's build method #27

njng opened this issue Jan 17, 2020 · 0 comments

Comments

@njng
Copy link

njng commented Jan 17, 2020

I have an issue creating the request XML in an Operation object

This is relevant part of the WSDL:

            <s:element name="ProcessVarRequest">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="actiondoc">
                            <s:complexType mixed="true">
                                <s:sequence>
                                    <s:any />
                                </s:sequence>
                            </s:complexType>
                        </s:element>
                    </s:sequence>
                </s:complexType>
            </s:element>

This is the result of calling example_body from the Operation object:
{:ProcessVarRequest=>{:actiondoc=>{}}}

This is Hash that is passed in to the Operation's body:
{ ProcessVarRequest: { actiondoc: { nocsvc: { ... } } }

Sekken::XML::Element for "ProcessVarRequest":

#<Sekken::XML::Element:0x000000066a5da0
  @attributes=[],
  @children=[],
  @complex_type_id="http://www.levelplatforms.com/nocsupportservices/2.0/:",
  @form="qualified",
  @name="actiondoc",
  @namespace="http://www.levelplatforms.com/nocsupportservices/2.0/",
  @parent=
   #<Sekken::XML::Element:0x000000066ae428
    @attributes=[],
    @children=[...],
    @complex_type_id="http://www.levelplatforms.com/nocsupportservices/2.0/:",
    @form="qualified",
    @name="ProcessVarRequest",
    @namespace="http://www.levelplatforms.com/nocsupportservices/2.0/",
    @recursive=false,
    @singular=true>,
  @recursive=false,
  @singular=true>

When I call build on the Operation object, it just creates an empty "actiondoc" element.
"<env:Body>\n <lol0:ProcessVarRequest>\n <lol0:actiondoc/>\n </lol0:ProcessVarRequest>\n </env:Body>\n</env:Envelope>\n"

Expected:

	        <ProcessVarRequest xmlns="http://www.levelplatforms.com/nocsupportservices/2.0/">
	            <actiondoc>
	                <nocsvc xmlns="">
                            ...
	                </nocsvc>
	            </actiondoc>
	        </ProcessVarRequest>

How can I properly generate the XML request body to show the nested elements? Is this a problem of it being an "any" type?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant