xapix-io / paos

Clojure SOAP client
Eclipse Public License 1.0
93 stars 12 forks source link

service/wrap-body ignores array of scalar types #17

Closed priyatam closed 5 years ago

priyatam commented 5 years ago

I have a complex type like:

<s:complexType name="ArrayOfString">
        <s:sequence>
          <s:element maxOccurs="unbounded" minOccurs="0" name="string" nillable="true" type="s:string"/>
        </s:sequence>
      </s:complexType>

Another complex type refers to it like so:

...
<s:element maxOccurs="1" minOccurs="0" name="ValidationGroupList" type="tns:ArrayOfString"/>
...

I have tried multiple options to set this attribute in the 'context' object

"ValidationGroupList" ({"string" {:__value "BO_GeneralInfoModule"}})

or

"ValidationGroupList" ({:__value "BO_GeneralInfoModule"}),

(service/wrap-body srv context) converts the deeply nested object into proper namespaced xml, but ValidationGroupList is empty, given either of the above context objects.

Here, 'context' is the merged mapping and data (similar to your example in README). Note that every other attribute in the nested complex object is converted fine, except for the "array of strings" complex type.

There is no error and I can't debug this since it's using selma's template internally.

Suggestion?

DeLaGuardo commented 5 years ago

Arrays supported by adding artificial keyword in context object. In you case you can use

"ValidationGroupList" {"strings" ({"string" {:__value "BO_GeneralInfoModule"}})}

paos need this to support complex types like that:

<s:complexType name="ArrayOfStringAndInteger">
        <s:sequence>
          <s:element maxOccurs="unbounded" minOccurs="0" name="string" nillable="true" type="s:string"/>
          <s:element maxOccurs="unbounded" minOccurs="0" name="int" nillable="true" type="s:integer"/>
        </s:sequence>
      </s:complexType>

We also have service/request-mapping function that should give you form of context object