tags:

views:

59

answers:

1

Is it possible to send a complexType to a SOAP web service by creating the complexType locally, i.e. 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...

A: 

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.

Jarrod