There seems to be a strange pattern in the way an array of Elements is
sent in a client request body. For example, I have an xml Element that
appears in this format:
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd">
<wsse:UserToken>
<wsse:Username>user1</wsse:Username>
<wsse:Password>pass1</wsse:Password>
</wsse:UserToken>
</wsse:Security>
I have a Get operation whose request takes in a Name string and an
Argument, which is an Element[]. I am passing 3 instances of the above
xml in the Argument parameter. The client request body is currently
coming out like this:
<soap:Body>
<pfx0:Get
xmlns:pfx0="http://schemas.cmp.cisco.com/2006/07/test">
<pfx0:Name>getRoles</pfx0:Name>
<pfx0:Arguments>
<pfx0:Arguments>
<wsse:UserToken
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd
<http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sece
xt-1.0.xsd> ">
<wsse:Username>user2</wsse:Username>
<wsse:Password>pass2</wsse:Password>
</wsse:UserToken>
</pfx0:Arguments>
<pfx0:Arguments>
<wsse:UserToken
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd
<http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sece
xt-1.0.xsd> ">
<wsse:Username>user3</wsse:Username>
<wsse:Password>pass3</wsse:Password>
</wsse:UserToken>
</pfx0:Arguments>
<wsse:UserToken
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd
<http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sece
xt-1.0.xsd> ">
<wsse:Username>user1</wsse:Username>
<wsse:Password>pass1</wsse:Password>
</wsse:UserToken>
</pfx0:Arguments>
</pfx0:Get>
</soap:Body>
Then I get an error on the server side indicating "array element type
mismatch". I think it's because there's 2 problems with the above:
1) The Argument element should contain an array of <wsse:Security>
elements, not elements of its own type (Argument).
2) The elements in the array are nested, which is wrong.
It's as if the QName of each array element's root is stripped and
replaced with the QName of the Argument array wrapper instead. And then
nested incorrectly.
Shouldn't it look something like this?
<pfx0:Arguments>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd
<http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sece
xt-1.0.xsd> ">
<wsse:UserToken>
...
</wsse:UserToken>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd
<http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sece
xt-1.0.xsd> ">
<pfx0:Security>
<wsse:UserToken>
...
</wsse:UserToken>
</pfx0:Security>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd
<http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sece
xt-1.0.xsd> ">
<wsse:UserToken>
...
</wsse:UserToken>
</pfx0:Security>
</pfx0:Arguments>
Can anyone else confirm if they are seeing the same problem?
-Vinh