[wsf-c-dev] [jira] Updated: (WSFPHP-276) schema import /include doesn't work some time - depends on the appendChild works

Dimuthu Gamage (JIRA) jira at wso2.org
Sat May 10 00:05:17 PDT 2008


     [ https://wso2.org/jira/browse/WSFPHP-276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dimuthu Gamage updated WSFPHP-276:
----------------------------------

    Description: 
Schema import in wsf/php completely depends on how appendChild works. In theory if imported schema is added to the original wsdl (we add all to one wsdl to parse it with xslt templates) it should work.
E.x.
the following schema

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://test" targetNamespace="http://test">
    <xsd:element ref="me"/>
    <xsd:element name="me" type="xsd:int"/>
</xsd:schema>

 can be added in to 

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<!--adding to here-->
</wsdl:types>
</wsdl:definitions>

straight away , and theoretically it should work.

We use PHP DOM appendChild function to this work. But appendChild do some optimization so duplicate namespaces are not re-declared. (this happen only with some conditions). This leads to change in prefixes of some namespaces, or sometime loose prefixes. 

The problem is 
1. if some elements referring to other elements with such a changing prefix,  it will not identify the actual object.
2. if the namespace prefix is used only inside ref attribute, dom thinks the prefix is never used and ignore that.

For an example for above schema php generates following wsdl


<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>

<xsd:schema targetNamespace="http://test">
    <xsd:element ref="me"/>
    <xsd:element name="me" type="xsd:int"/>
</xsd:schema>


</wsdl:types>
</wsdl:definitions>


This is not the same wsdl that we hope to get, the appendChild have ignored the default namespace declaration in addition to the xsd: namespace declaration. 

This should be fixed to get some wsdls working :(

  was:
Schema import in wsf/ph completely depends on how appendChild works. In theory if imported schema is added to the original wsdl (we add all to one wsdl to parse it with xslt templates).
E.x.
the following schema

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://test" targetNamespace="http://test">
    <xsd:element ref="me"/>
    <xsd:element name="me" type="xsd:int"/>
</xsd:schema>

 can be added in to 

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<!--adding to here-->
</wsdl:types>
</wsdl:definitions>

straight away , and theoretically it should work.

We use PHP DOM appendChild function to this work. But appendChild do some optimization so duplicate namespaces are not declared over and over again (this happen only with some conditions). This leads to change in prefixes of some namespaces, or sometime loose prefixes. 

The problem is 
1. if some elements referring to other elements with such a changing prefix,  it will not identify the actual object.
2. if the namespace prefix is used only inside ref attribute, dom thinks the prefix is never use and ignore that.

For an example for above schema php generates following kind of wsdl


<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>

<xsd:schema targetNamespace="http://test">
    <xsd:element ref="me"/>
    <xsd:element name="me" type="xsd:int"/>
</xsd:schema>


</wsdl:types>
</wsdl:definitions>


This is not the same wsdl that we hope to get, the appendChild have ignored the default namespace declaration in addition to the xsd: namespace declaration. 

This should be fixed to get some wsdls working :(

    Component/s: WSDL Mode

> schema import /include doesn't work some time - depends on the appendChild works
> --------------------------------------------------------------------------------
>
>                 Key: WSFPHP-276
>                 URL: https://wso2.org/jira/browse/WSFPHP-276
>             Project: WSO2 WSF/PHP
>          Issue Type: Bug
>          Components: WSDL Mode
>         Environment: Linux + windows
>            Reporter: Dimuthu Gamage
>            Assignee: Dimuthu Gamage
>
> Schema import in wsf/php completely depends on how appendChild works. In theory if imported schema is added to the original wsdl (we add all to one wsdl to parse it with xslt templates) it should work.
> E.x.
> the following schema
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://test" targetNamespace="http://test">
>     <xsd:element ref="me"/>
>     <xsd:element name="me" type="xsd:int"/>
> </xsd:schema>
>  can be added in to 
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <wsdl:types>
> <!--adding to here-->
> </wsdl:types>
> </wsdl:definitions>
> straight away , and theoretically it should work.
> We use PHP DOM appendChild function to this work. But appendChild do some optimization so duplicate namespaces are not re-declared. (this happen only with some conditions). This leads to change in prefixes of some namespaces, or sometime loose prefixes. 
> The problem is 
> 1. if some elements referring to other elements with such a changing prefix,  it will not identify the actual object.
> 2. if the namespace prefix is used only inside ref attribute, dom thinks the prefix is never used and ignore that.
> For an example for above schema php generates following wsdl
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <wsdl:types>
> <xsd:schema targetNamespace="http://test">
>     <xsd:element ref="me"/>
>     <xsd:element name="me" type="xsd:int"/>
> </xsd:schema>
> </wsdl:types>
> </wsdl:definitions>
> This is not the same wsdl that we hope to get, the appendChild have ignored the default namespace declaration in addition to the xsd: namespace declaration. 
> This should be fixed to get some wsdls working :(

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the Wsf-c-dev mailing list