Reputation: 2135
I am using PHP nusoap library to create a webservice. The service returns 2 fields and an array of users and soap body is formatted as below:
<company></company>
<noOfUsers></noOfUsers>
<users>
<user>
.......
</user>
<user>
.......
</user>
<user>
.......
</user>
</users>
How can i change this response to remove the users wrapper so that the response looks like:
<company></company>
<noOfUsers></noOfUsers>
<user>
.......
</user>
<user>
.......
</user>
<user>
.......
</user>
Upvotes: 0
Views: 530
Reputation: 121010
TL;DR: you can’t
This is impossible because valid XML document can not have top-level nodes with same names. I bet there should be kinda hack/workaround, but I woul suggest you not to enter this territory and deal with what’s being generated by default.
Upvotes: 1