Discussion:
Status of issue with SDO scoping of anonymous types with same name
cdouglas
2008-01-29 21:13:17 UTC
Permalink
Hello,
Been a long time since I have posted here since SDO has been
working so well for me. I wanted to see if there has been any updates
on the issue from this post I made about a year ago.

http://groups.google.com/group/phpsoa/browse_thread/thread/a294e044b2f2890f/95c5704c4790c2fd

I ended up giving up on the project I was doing before because of
this, but now it has re-surfaced in another one.

Thank you
Chris Douglas
simonslaws-gM/Ye1E23mwN+
2008-01-30 09:47:44 UTC
Permalink
On 29 Jan, 21:13, cdouglas <ch...-ff+wiHjHi4Ybit0LTj+***@public.gmane.org> wrote:
> Hello,
> Been a long time since I have posted here since SDO has been
> working so well for me. I wanted to see if there has been any updates
> on the issue from this post I made about a year ago.
>
> http://groups.google.com/group/phpsoa/browse_thread/thread/a294e044b2...
>
> I ended up giving up on the project I was doing before because of
> this, but now it has re-surfaced in another one.
>
> Thank you
> Chris Douglas

Hi Chris

Was just looking back at this to see what happened and it looks like a
fix when in (http://issues.apache.org/jira/browse/TUSCANY-1238). I
just ran the test from way back when against the code in the FULMAR
branch and it looks better to me. This was the output...

object(SDO_DAS_XML)#1 {
23 types have been defined. The types and their properties are::
1. commonj.sdo#BigDecimal
2. commonj.sdo#BigInteger
3. commonj.sdo#Boolean
4. commonj.sdo#Byte
5. commonj.sdo#Bytes
6. commonj.sdo#ChangeSummary
7. commonj.sdo#Character
8. commonj.sdo#DataObject
9. commonj.sdo#Date
10. commonj.sdo#Double
11. commonj.sdo#Float
12. commonj.sdo#Integer
13. commonj.sdo#Long
14. commonj.sdo#OpenDataObject
15. commonj.sdo#Short
16. commonj.sdo#String
17. commonj.sdo#URI
18. http://www.example.org/AnnonTypes#ElementA
- Overlapping (http://www.example.org/AnnonTypes#Overlapping)
19. http://www.example.org/AnnonTypes#ElementB
- Overlapping (http://www.example.org/AnnonTypes#Overlapping1)
20. http://www.example.org/AnnonTypes#Overlapping
- ValueA (commonj.sdo#String)
21. http://www.example.org/AnnonTypes#Overlapping1
- ValueB (commonj.sdo#String)
22. http://www.example.org/AnnonTypes#RootType
- Top (http://www.example.org/AnnonTypes#Top)
23. http://www.example.org/AnnonTypes#Top
- ElementA (http://www.example.org/AnnonTypes#ElementA)
- ElementB (http://www.example.org/AnnonTypes#ElementB)
}Ready to output SDO array - hit any key
SDO_DataObjectImpl Object
(
[ElementA] => SDO_DataObjectImpl Object
(
[Overlapping] => SDO_DataObjectImpl Object
(
[ValueA] => tns:ValueA
)

)

[ElementB] => SDO_DataObjectImpl Object
(
[Overlapping] => SDO_DataObjectImpl Object
(
[ValueB] => tns:ValueB
)

)

)
http://www.example.org/AnnonTypes:Top
http://www.example.org/AnnonTypes:Top ElementA isMany= http://www.example.org/A
nnonTypes:ElementA isOpen= isDataType=
http://www.example.org/AnnonTypes:ElementA
http://www.example.org/AnnonTypes:ElementA Overlapping isMany=
http://www.examp
le.org/AnnonTypes:Overlapping isOpen= isDataType=
http://www.example.org/AnnonTypes:Overlapping
http://www.example.org/AnnonTypes:Overlapping ValueA isMany=
commonj.sdo:String
isOpen= isDataType= 1
http://www.example.org/AnnonTypes:Top ElementB isMany= http://www.example.org/A
nnonTypes:ElementB isOpen= isDataType=
http://www.example.org/AnnonTypes:ElementB
http://www.example.org/AnnonTypes:ElementB Overlapping isMany=
http://www.examp
le.org/AnnonTypes:Overlapping1 isOpen= isDataType=
http://www.example.org/AnnonTypes:Overlapping1
http://www.example.org/AnnonTypes:Overlapping1 ValueB isMany=
commonj.sdo:Strin
g isOpen= isDataType= 1

Note now that there are two anonymous types registered

20. http://www.example.org/AnnonTypes#Overlapping
- ValueA (commonj.sdo#String)
21. http://www.example.org/AnnonTypes#Overlapping1
- ValueB (commonj.sdo#String)

Regards

Simon
cdouglas
2008-01-30 13:47:28 UTC
Permalink
I haven't been keeping up with the branches. I am runninng 1.2.3.
Should it be working in that one? If so, then maybe this is a
different scenario now.

Thanks
cdouglas
2008-01-30 14:05:04 UTC
Permalink
I just grabbed the Fulmar branch and tried it and it still happens.
The issue is that the items failing are defined as such:

<xs:element name="attribute" nillable="true" minOccurs="0"
maxOccurs="unbounded">
<xs:annotation>

<xs:documentation>set to "nill" to remove this attribute</
xs:documentation>

</xs:annotation>

<xs:complexType>

<xs:simpleContent>

<xs:extension base="xs:string">

<xs:attribute name="name" type="xs:string" use="required"/>

</xs:extension>

</xs:simpleContent>

</xs:complexType>
</xs:element>

and the XML looks like this

<scn:attribute name="ETH_GW" xsi:nil="true" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"/>
<scn:attribute name="ETH_IP" xsi:nil="true" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"/>
<scn:attribute name="ETH_MASK" xsi:nil="true" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"/>
<scn:attribute name="SN" xsi:nil="true" xmlns:xsi="http://www.w3.org/
2001/XMLSchema-instance"/>
...etc

So for each attribute that exists in the XML doc, it throws an error

SDO_DAS_XML_ParserException Object
(
[message:protected] => SDO_DAS_XML::loadString - Unable to parse the
supplied xml string
30 parse error(s) occurred when parsing the string:
1. Parser found unknown element attribute
2. Parser found unknown element attribute
3. Parser found unknown element attribute
4. Parser found unknown element attribute
5. Parser found unknown element attribute
6. Parser found unknown element attribute

..etc

I can email you the entire XSD and XML doc if the above isn't
sufficient.

Thank you
Chris
simonslaws-gM/Ye1E23mwN+
2008-01-31 10:33:33 UTC
Permalink
On 30 Jan, 14:05, cdouglas <ch...-ff+wiHjHi4Ybit0LTj+***@public.gmane.org> wrote:
> I just grabbed the Fulmar branch and tried it and it still happens.
> The issue is that the items failing are defined as such:
>
> <xs:element name="attribute" nillable="true" minOccurs="0"
> maxOccurs="unbounded">
> <xs:annotation>
>
> <xs:documentation>set to "nill" to remove this attribute</
> xs:documentation>
>
> </xs:annotation>
>
> <xs:complexType>
>
> <xs:simpleContent>
>
> <xs:extension base="xs:string">
>
> <xs:attribute name="name" type="xs:string" use="required"/>
>
> </xs:extension>
>
> </xs:simpleContent>
>
> </xs:complexType>
> </xs:element>
>
> and the XML looks like this
>
> <scn:attribute name="ETH_GW" xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> <scn:attribute name="ETH_IP" xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> <scn:attribute name="ETH_MASK" xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> <scn:attribute name="SN" xsi:nil="true" xmlns:xsi="http://www.w3.org/
> 2001/XMLSchema-instance"/>
> ...etc
>
> So for each attribute that exists in the XML doc, it throws an error
>
> SDO_DAS_XML_ParserException Object
> (
> [message:protected] => SDO_DAS_XML::loadString - Unable to parse the
> supplied xml string
> 30 parse error(s) occurred when parsing the string:
> 1. Parser found unknown element attribute
> 2. Parser found unknown element attribute
> 3. Parser found unknown element attribute
> 4. Parser found unknown element attribute
> 5. Parser found unknown element attribute
> 6. Parser found unknown element attribute
>
> ..etc
>
> I can email you the entire XSD and XML doc if the above isn't
> sufficient.
>
> Thank you
> Chris

OK Chris, I'll try and take a look at the sample you posted. I'll
shout if I need more.

Regards

Simon
simonslaws-gM/Ye1E23mwN+
2008-02-11 15:05:50 UTC
Permalink
On 31 Jan, 10:33, simonsl...-gM/Ye1E23mwN+***@public.gmane.org wrote:
> On 30 Jan, 14:05, cdouglas <ch...-ff+wiHjHi4Ybit0LTj+***@public.gmane.org> wrote:
>
>
>
> > I just grabbed the Fulmar branch and tried it and it still happens.
> > The issue is that the items failing are defined as such:
>
> > <xs:element name="attribute" nillable="true" minOccurs="0"
> > maxOccurs="unbounded">
> > <xs:annotation>
>
> > <xs:documentation>set to "nill" to remove this attribute</
> > xs:documentation>
>
> > </xs:annotation>
>
> > <xs:complexType>
>
> > <xs:simpleContent>
>
> > <xs:extension base="xs:string">
>
> > <xs:attribute name="name" type="xs:string" use="required"/>
>
> > </xs:extension>
>
> > </xs:simpleContent>
>
> > </xs:complexType>
> > </xs:element>
>
> > and the XML looks like this
>
> > <scn:attribute name="ETH_GW" xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> > <scn:attribute name="ETH_IP" xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> > <scn:attribute name="ETH_MASK" xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> > <scn:attribute name="SN" xsi:nil="true" xmlns:xsi="http://www.w3.org/
> > 2001/XMLSchema-instance"/>
> > ...etc
>
> > So for each attribute that exists in the XML doc, it throws an error
>
> > SDO_DAS_XML_ParserException Object
> > (
> > [message:protected] => SDO_DAS_XML::loadString - Unable to parse the
> > supplied xml string
> > 30 parse error(s) occurred when parsing the string:
> > 1. Parser found unknown element attribute
> > 2. Parser found unknown element attribute
> > 3. Parser found unknown element attribute
> > 4. Parser found unknown element attribute
> > 5. Parser found unknown element attribute
> > 6. Parser found unknown element attribute
>
> > ..etc
>
> > I can email you the entire XSD and XML doc if the above isn't
> > sufficient.
>
> > Thank you
> > Chris
>
> OK Chris, I'll try and take a look at the sample you posted. I'll
> shout if I need more.
>
> Regards
>
> Simon

Chris, A bit of an update on this. It looks like a Tuscany problem so
I passed the problem over there. I believe they have found the issue
so I hope to see confirmation soon. I raised a bug to track it (http://
pecl.php.net/bugs/bug.php?id=13101)

I'll post here again once we have something in the code base.

Regards

Simon
cdouglas
2008-02-11 18:35:57 UTC
Permalink
Thank you

Chris
simonslaws-gM/Ye1E23mwN+
2008-02-14 18:11:25 UTC
Permalink
On 11 Feb, 18:35, cdouglas <ch...-ff+wiHjHi4Ybit0LTj+***@public.gmane.org> wrote:
> Thank you
>
> Chris

Hi Chris

The Tuscany team kindly made a fix for this problem (PECL-13101). I
just committed it to the FULMAR branch. Give it a spin and let me know
if it works for you. If so I know Matthew wants to do a release so it
can go in.

Regards

Simon
cdouglas
2008-02-19 15:26:17 UTC
Permalink
Simon,
That resolved my issue. Thank you very much for your timely
resolution.

Chris
cdouglas
2008-03-31 19:23:17 UTC
Permalink
Simon,

I verified that this issues was fixed in a 1.2.3 beta built, but it
is not working in 1.2.4 final.

-Chris
Caroline Maynard
2008-04-01 14:04:01 UTC
Permalink
cdouglas wrote:
> Simon,
>
> I verified that this issues was fixed in a 1.2.3 beta built, but it
> is not working in 1.2.4 final.
>
> -Chris

Chris, the related Tuscany updates seem to have disappeared during the
release process. I can't find any recorded explanation of this, so I'm
making an assumption that it was a merge error, and have restored the
changes to both HEAD and the latest branch.

Apologies for violating the stability of the 1.2.4 release - I didn't
feel it was worth rolling a new release just to get this fix out, but if
others disagree strongly I'll do so.
cdouglas
2008-04-02 12:08:44 UTC
Permalink
Simon,
Thanks. I am ok using it from SVN until the next release. It seems
like I was the only person affected by this bug anyway.
-Chris
cem
2008-04-04 15:56:06 UTC
Permalink
On 2 Apr, 13:08, cdouglas <ch...-ff+wiHjHi4Ybit0LTj+***@public.gmane.org> wrote:
> Simon,
> Thanks. I am ok using it from SVN until the next release. It seems
> like I was the only person affected by this bug anyway.
> -Chris

Steve,
No problem
--
Caroline
Dylan
2008-04-28 16:07:22 UTC
Permalink
Hi,

I'm not sure if this has the same cause, but I'm getting a
SDO_DAS_XML::loadString error as well.

I get the loadString error when I try to access the service through
getService(wsdl) or plain soapClient. getService(php) does produce the
expected result.

I installed a PECL snapshot of the SCA binaries and updated SCA/ from
CVS since the fix didn't make it in to 1.2.4. I still get the error.

Here's the SOAP request and response:

Request :
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://
ilSoapUserAdministration"><SOAP-
ENV:Body><ns1:login><ns1:client>client</ns1:client><ns1:username>root</
ns1:username><ns1:password>homer</ns1:password></ns1:login></SOAP-
ENV:Body></SOAP-ENV:Envelope>
Response :
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-
ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Unable to
decode the SOAP message from XML. The problem was:
SDO_DAS_XML::loadString - Unable to parse the supplied xml string 3
parse error(s) occurred when parsing the string: 1. Parser found
unknown element client 2. Parser found unknown element username 3.
Parser found unknown element password </faultstring></SOAP-ENV:Fault></
SOAP-ENV:Body></SOAP-ENV:Envelope>

And here's my test code:
<?
$service = new Service();
echo $service->execSCA();
//echo $service->execSOAP();

class Service {
public $wsdl = "http://localhost/htdocs/ilias4/webservice/soap/
classes/class.ilSoapUserAdministration.php?wsdl";

function Service() { }

function execSCA() {
include_once "SCA/SCA.php";

$sua = SCA::getService('webservice/soap/classes/
class.ilSoapUserAdministration.php'); // works
//$sua = SCA::getService($this->wsdl); // does not work:
SDO_DAS_XML::loadString - Unable to parse the supplied xml string

return $sid = $sua->login('client','root','homer');
}

function execSOAP() {
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient($this->wsdl, array('trace' => 1));
print_r($client->__getFunctions());
try {
$sid = $client-
>login(array('client'=>'client','username'=>'root','password'=>'homer')); //
also produces loadString error
}
catch (SoapFault $soapFault) {
var_dump($soapFault);
echo "Request :<br>", htmlentities($client-
>__getLastRequest()), "<br>";
echo "Response :<br>", htmlentities($client-
>__getLastResponse()), "<br>";
}
return $sid;
}
}
?>

--
Dylan Oliver
Dylan
2008-04-30 07:11:07 UTC
Permalink
Hi,

Specifying a service type of 'soap' produces the same result (it knows
that it's using soap because it has a GET request of WSDL).

I'm logging $this->xmldas in setWSDLTypes($wsdl) in SOAP Mapper.php.
One request to service.php results in two executions of setWSDLTypes.
I noticed that the first lists the parameters of my login method while
the second does not:

43. http://ilSoapUserAdministration#login
- client (commonj.sdo#String)
- username (commonj.sdo#String)
- password (commonj.sdo#String)

vs.

43. http://ilSoapUserAdministration#login

The other difference is that on the first call, we have:

[ 15] Info 30/04/2008
05:49:46::795 .......SCA_Bindings_soap_Mapper::setWSDLTypes - wsdl is
http://localhost/htdocs/ilias4/webservice/soap/classes/class.ilSoapUserAdministration.php?wsdl

On the second, we have instead:

[ 13] Info 30/04/2008
05:49:47::809 ......SCA_Bindings_soap_Mapper::setWSDLTypes - wsdl is C:
\xampp\htdocs\ilias4\webservice\soap\classes
\class.ilSoapUserAdministration.wsdl

I didn't know I could access the .wsdl at that address, but it works -
except that it does not include my parameters for the login method. So
why are class.php?wsdl and class.wsdl different?

OH HEY. ilSoapUseradministration.wsdl was created back when my login
method arguments weren't being picked up because i put its parameters
in a comment starting with /* rather than /**. This would also be a
problem if I changed my schema after this static wsdl was generated.

if (!file_exists($wsdl_filename)) {
file_put_contents($wsdl_filename,

SCA_Bindings_soap_ServiceDescriptionGenerator::generateDocumentLiteralWrappedWsdl($service_description));
}

in SOAP ServiceRequestHandler.php. I deleted the cached C:\xampp\htdocs
\ilias4\webservice\soap\classes\class.ilSoapUserAdministration.wsdl,
reran, and things work.

It seems to me that this is a pretty big gotcha - it took me a day to
figure out what was going on! For now, I've just commented out the
'if' loop so the wsdl is regenerated every time ... however, I think
that this calls for an explicitly temporary caching solution.

On Apr 29, 9:06 pm, Dalibor Andzakovic <dalibor.andzako...-***@public.gmane.org>
wrote:
> try $sua = SCA::getService('http://localhost/htdocs/ilias4/webservice/
> soap/classes/class.ilSoapUserAdministration.php?wsdl', 'soap');
>
> dali
Dalibor Andzakovic
2008-04-30 02:06:17 UTC
Permalink
try $sua = SCA::getService('http://localhost/htdocs/ilias4/webservice/
soap/classes/class.ilSoapUserAdministration.php?wsdl', 'soap');

dali

On Apr 29, 4:07 am, Dylan <dylan.oli...-***@public.gmane.org> wrote:
> Hi,
>
> I'm not sure if this has the same cause, but I'm getting a
> SDO_DAS_XML::loadString error as well.
>
> I get the loadString error when I try to access the service through
> getService(wsdl) or plain soapClient. getService(php) does produce the
> expected result.
>
> I installed a PECL snapshot of the SCA binaries and updated SCA/ from
> CVS since the fix didn't make it in to 1.2.4. I still get the error.
>
> Here's the SOAP request and response:
>
> Request :
> <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-
> ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://
> ilSoapUserAdministration"><SOAP-
> ENV:Body><ns1:login><ns1:client>client</ns1:client><ns1:username>root</
> ns1:username><ns1:password>homer</ns1:password></ns1:login></SOAP-
> ENV:Body></SOAP-ENV:Envelope>
> Response :
> <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-
> ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-
> ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Unable to
> decode the SOAP message from XML. The problem was:
> SDO_DAS_XML::loadString - Unable to parse the supplied xml string 3
> parse error(s) occurred when parsing the string: 1. Parser found
> unknown element client 2. Parser found unknown element username 3.
> Parser found unknown element password </faultstring></SOAP-ENV:Fault></
> SOAP-ENV:Body></SOAP-ENV:Envelope>
>
> And here's my test code:
> <?
> $service = new Service();
> echo $service->execSCA();
> //echo $service->execSOAP();
>
> class Service {
>     public $wsdl = "http://localhost/htdocs/ilias4/webservice/soap/
> classes/class.ilSoapUserAdministration.php?wsdl";
>
>     function Service() { }
>
>     function execSCA() {
>         include_once "SCA/SCA.php";
>
>         $sua = SCA::getService('webservice/soap/classes/
> class.ilSoapUserAdministration.php'); // works
>         //$sua = SCA::getService($this->wsdl); // does not work:
> SDO_DAS_XML::loadString - Unable to parse the supplied xml string
>
>         return $sid = $sua->login('client','root','homer');
>     }
>
>     function execSOAP() {
>         ini_set("soap.wsdl_cache_enabled", "0");
>         $client = new SoapClient($this->wsdl, array('trace' => 1));
>         print_r($client->__getFunctions());
>         try {
>             $sid = $client->login(array('client'=>'client','username'=>'root','password'=>'homer')); //
>
> also produces loadString error
>         }
>         catch (SoapFault $soapFault) {
>             var_dump($soapFault);
>             echo "Request :<br>", htmlentities($client->__getLastRequest()), "<br>";
>
>             echo "Response :<br>", htmlentities($client->__getLastResponse()), "<br>";
>
>         }
>         return $sid;
>     }}
>
> ?>
>
> --
> Dylan Oliver
Dalibor Andzakovic
2008-04-30 22:49:35 UTC
Permalink
> in SOAP ServiceRequestHandler.php. I deleted the cached C:\xampp\htdocs
> \ilias4\webservice\soap\classes\class.ilSoapUserAdministration.wsdl,
> reran, and things work.
>
> It seems to me that this is a pretty big gotcha - it took me a day to
> figure out what was going on! For now, I've just commented out the
> 'if' loop so the wsdl is regenerated every time ... however, I think
> that this calls for an explicitly temporary caching solution.

Yea, that one got me too :-) Especially because if you go to your
webservice.php?wsdl you get correct WSDL shown, but SCA for some
reason uses cached generated wsdl. I've gotten into a habit of
deleting created WSDLs every time the method signatures change.

Other trick to look for is the location of the XSDs. Relative paths
are to the executing script, not the class definition...

dali
Loading...