WSDL (SOAP) behaves different since 1.1.16

Since I have updated Yii from 1.1.15 to 1.1.16 for my project, the SOAP webservice of this project is behaving different. Now it is stopped working for me and this is a problem! The code of the project is not changed but the output of the SOAP service is.

OLD output (partial, only the top):

[xml]<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="ubplus:website" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://xml.apache.org/xml-soap">

<SOAP-ENV:Body>

  &lt;ns1:readProfileObjectResponse&gt;


     &lt;return xsi:type=&quot;ns1:ReturnMessageProfileWSDL&quot;&gt;


        &lt;data SOAP-ENC:arrayType=&quot;ns1:ProfileWSDL[1]&quot; xsi:type=&quot;ns1:ProfileWSDLArray&quot;&gt;


           &lt;item xsi:type=&quot;ns1:ProfileWSDL&quot;&gt;


              &lt;user_id[/xml]

NEW output (partial…)

[xml]<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="ubplus:website" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://xml.apache.org/xml-soap">

<SOAP-ENV:Body>

  &lt;ns1:readProfileObjectResponse&gt;


     &lt;return xsi:type=&quot;ns1:ReturnMessageProfileWSDL&quot;&gt;


        &lt;data SOAP-ENC:arrayType=&quot;SOAP-ENC:Struct[1]&quot; xsi:type=&quot;ns1:ProfileWSDLArray&quot;&gt;


           &lt;item xsi:type=&quot;ns1:ProfileWSDL&quot;&gt;


              &lt;user_id[/xml]

As a matter of fact the only [color="#FF8C00"]difference is in the <data> element, the SOAP-ENC:arrayType has changed from "ns1:ProfileWSDL[1]" to "SOAP-ENC:Struct[1]".[/color]

I have seen in the change log that there are indeed changes made to the CWsdlGenerator class. But I cannot pinpoint what seems to be the real problem… Can anyone perhaps help me out here?

Greetings,

Ametad

b[/b]

I realize that my previous post is not as clear as one would wish… I myself was lost in confusion, that is what the post also reflected I guess :rolleyes:

Some basic knowledge from the class reference of CWebServiceAction:

[indent]CWebServiceAction serves for two purposes. On the one hand, it displays the WSDL content specifying the Web service APIs. On the other hand, it invokes the requested Web service API. A GET parameter named ws is used to differentiate these two aspects: the existence of the GET parameter indicates performing the latter action.[/indent]

A closer look revealed that the output of my " WSDL content specifying the Web service APIs" are a little bit different using yii version 1.1.15 and -1.1.16. The diff is in the description of the complexType’s. Here follows one description (of many…) stated in the WSDL.

Using Yii 1.1.15:




      <xsd:complexType name="ReactionWSDLArray">

        <xsd:complexContent>

          <xsd:restriction base="soap-enc:Array">

            <xsd:attribute ref="soap-enc:arrayType" wsdl:arrayType="tns:ReactionWSDL[]"/>

          </xsd:restriction>

        </xsd:complexContent>

      </xsd:complexType>



Using Yii 1.1.16:




      <xsd:complexType name="ReactionWSDLArray">

        <xsd:complexContent>

          <xsd:restriction base="soap-enc:Array">

            <xsd:attribute ref="soap-enc:arrayType" arrayType="tns:ReactionWSDL[]"/>

          </xsd:restriction>

        </xsd:complexContent>

      </xsd:complexType>



[color="#FFA500"]

The difference is in ‘arrayType=“tns:ReactionWSDL[]”’ and ‘wsdl:arrayType=“tns:ReactionWSDL[]”’

[/color]

Could this be the problem? There a some more changes I detected, but those are mainly changes (IMHO) in flavour and not in syntax.

Help is appreciated! :)

For those who are interested, the problem is solved! With a little change in the CWsdlGenerator class:

Before:


$attribute->setAttribute('arrayType',(isset(self::$typeMap[$arrayType]) ? 'xsd:' : 'tns:') .$arrayType.'[]');

After:


$attribute->setAttribute('wsdl:arrayType',(isset(self::$typeMap[$arrayType]) ? 'xsd:' : 'tns:') .$arrayType.'[]');

I will make a pull request at Github.

Bye!