I am using the built-in PHP SoapClient to access a private web service
that has several complex types defined in a WSDL, some of which require
explicit namespaces. In at least one case, the namespace of one element
is missing from the SOAP request being generated by SoapClient, and I
need to explicitly add it.
The problem is that I see no examples and no obvious way to add
namespaces or any attributes to a SOAP call. Is there a method for
doing this?
I have tried using SoapVar to specify a namespace with some success, but
it introduces another problem: Elements that occur multiple times do
not seem to work. For example, instead of
<lineItem>
.....
</lineItem>
<lineItem>
.....
</lineItem>
The SOAP request has
<lineItem>
<SOAP-ENC:Struct>
.....
</SOAP-ENC:Struct>
<SOAP-ENC:Struct>
.....
</SOAP-ENC:Struct>
</lineItem>
If I specify a type, I can get SOAP-ENC:Struct to change to <item>, but
that isn't really any better.
So my specific questions are:
1. Is is appropriate to use SoapVar in WSDL mode?
2. If not, how can attributes / namespaces be specified in WSDL mode?
3. If SoapVar is the correct solution, then how can the
multiple-occurrence element problem described above be overcome?
4. Should it ever be necessary to specify an element's namespace
explicitly in WSDL mode, or should SoapClient be learning that from the
WSDL?
Thanks,
Jack
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php