YII - Web Services

I have two general questions regarding web services.

I have replicated successfully the Examples that comes with Yii…

Now, I need to write a more complex Web Service:

  1. How Do I define a custom Type, like the Contact example of the phonebook demo, with XML attributes in the WSDL ?

  2. Can I have a "literal" bind instead of "rpc" ?


  1. Some more reading here:


  1. I think rpc/encoded is the only supported format (at least I noticed "rpc" seems to be hardcoded). Which format do you prefer (rpc/literal, document/literal, document/literal wrapped)?

/Tommy (not a WSDL expert)

Tommy, it is not a matter of preference, but requirements. “doc/literal” is the normal way of writing web service, since you don’t have to send “type” information on the payload, so the payloads are much smaller. The encoding rules on “rpc” are a bit different of regular XML.

Anyway, another case of these needs are when you have already a deployed service, and you like to "re-write" it using Yii… for example.

Thanks, ROsimildo