简体   繁体   中英

Soap Web Service PHP

Is it possible to send a complexType to a SOAP web service by creating the complexType locally, ie create the type by creating a class and then sending the instance of that class back to the service? Admittedly this is only possible if I can get the definition of the type from the service provider.

I'm looking to send a complexType back to a web service. So if this approach wont work please suggest an alternative...

You can certainly send complex types across SOAP, that's the power of SOAP. Anything that can be serialized into an XML document can be sent back and forth between a compatible server/client. Granted, assembling a complex type can be difficult (.NET datatables come to mind) but it can be done.

Rather than spending time trying to replicate serializers though, I've found that its much easier to just use adapters that most languages like .NET already have. In the .NET datatable example, its easier to just send over a simple PHP object and loop through the properties, repopulating the datatable than it is to assemble a full-blown datatable type in PHP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM