cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-2810) Wrong namespaces in WSDL - 2.2.6 OK, 2.2.7 and 2.2.8 BROKEN
Date Mon, 20 Dec 2010 07:57:02 GMT

    [ https://issues.apache.org/jira/browse/CXF-2810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973133#action_12973133
] 

Freeman Fang commented on CXF-2810:
-----------------------------------

As the SEI has a type with namespace like

@XmlType(name = "VOX", namespace = "http://wo.rtf2pdf.doc.ws.daisy.marbes.cz")
    public class VO {
...

So the generated wsdl should have schema like
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://wo.rtf2pdf.doc.ws.daisy.marbes.cz"
xmlns:tns="http://wo.rtf2pdf.doc.ws.daisy.marbes.cz" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="VO">
<xsd:sequence>
<xsd:element minOccurs="0" name="str" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>


but currently the generated wsdl have schema for Type VO like
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://aegis.systest.cxf.apache.org"
xmlns:tns="http://aegis.systest.cxf.apache.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="VO">
<xsd:sequence>
<xsd:element minOccurs="0" name="str" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

Which somehow use the package name as the namespace but ignore the correct one from @XmlType
annotation. So when user load the generated wsdl to SOAPUI
and send request, they see problems.

testGeneratedWsdlNs in the runnable testcase I attached can expose this problem.



> Wrong namespaces in WSDL - 2.2.6 OK, 2.2.7 and 2.2.8 BROKEN
> -----------------------------------------------------------
>
>                 Key: CXF-2810
>                 URL: https://issues.apache.org/jira/browse/CXF-2810
>             Project: CXF
>          Issue Type: Bug
>          Components: Aegis Databinding, Core
>    Affects Versions: 2.2.7, 2.2.8, 2.2.12, 2.3.1
>            Reporter: Jara Cesnek
>            Assignee: Freeman Fang
>            Priority: Blocker
>         Attachments: CXF-2810-testcase.zip, CXF-2810.test
>
>
> In WSDL there is wrong namespaces on arguments.
> Version 2.2.6 and below is OK, 2.2.7 and 2.2.8 generate invalid WSDL.
> 2.2.6 OK
> {code}
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://v2_0_0.smlouva.ws.aa.marbes.cz"
>
>    <soapenv:Header/>
>    <soapenv:Body>
>       <v2:updateSmlouvy>
>          <v2:smlouva>
>             <v2:cenaKupni>?</v2:cenaKupni>
>             <v2:dodatkyKeSmlouve>
>                <v2:AaSmlouvaDodatek>
>                   <v2:zadavaciDok>?</v2:zadavaciDok>
>                   <v2:zakon>?</v2:zakon>
>                </v2:AaSmlouvaDodatek>
>             </v2:dodatkyKeSmlouve>
>          </v2:smlouva>
>          <v2:idempotentGuid>?</v2:idempotentGuid>
>       </v2:updateSmlouvy>
>    </soapenv:Body>
> </soapenv:Envelope>
> {code}
> 2.2.7 WRONG - there is "wo" namespace from java package
> {code}
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://v2_0_0.smlouva.ws.aa.marbes.cz"
xmlns:wo="http://wo.v2_0_0.ws.smlouva.modules.aa.modules.daisy.marbes.cz">
>    <soapenv:Header/>
>    <soapenv:Body>
>       <v2:updateSmlouvy>
>          <v2:smlouva>
>             <wo:cenaKupni>?</wo:cenaKupni>
>             <wo:dodatkyKeSmlouve>
>                <v2:AaSmlouvaDodatek>
>                   <v2:zadavaciDok>?</v2:zadavaciDok>
>                   <v2:zakon>?</v2:zakon>
>                </v2:AaSmlouvaDodatek>
>             </wo:dodatkyKeSmlouve>
>          </v2:smlouva>
>          <v2:idempotentGuid>?</v2:idempotentGuid>
>       </v2:updateSmlouvy>
>    </soapenv:Body>
> </soapenv:Envelope>
> {code}
> If I call WS from SOAPUI, all values shows as NULL. When I modify SOAPUI XML - replace
wo with v2 - WS start working.
> *So CXF expects "v2" namespace in request XML, but in WSDL generate "wo" namespace.*
> Server code:
> {code}
>         JaxWsServerFactoryBean serverFactoryBean = new JaxWsServerFactoryBean();
>         serverFactoryBean.setServiceClass(AopUtils.getTargetClass(implementor));
>         serverFactoryBean.setServiceBean(implementor);
>         serverFactoryBean.setDataBinding(new AegisDatabinding());
>         serverFactoryBean.setAddress(url);
>         serverFactoryBean.setBus(cxfServlet.getBus());
>         serverFactoryBean.create();
> {code}
> Interface:
> {code}
> @WebService(name = "aa_smlouva_v2_0_0", targetNamespace = "http://v2_0_0.smlouva.ws.aa.marbes.cz")
> public interface AaSmlouvaWS {
>     @WebMethod
>     public WOrepeatable_result updateSmlouvy (
>             @WebParam(name = "smlouva")  WOAaSmlouva smlouva, 
>             @WebParam(name = "idempotentGuid")  String idempotentGuid
>     );
> }
> @org.apache.cxf.aegis.type.java5.XmlType(name = "AaSmlouva", namespace = "http://v2_0_0.smlouva.ws.aa.marbes.cz")
> public class WOAaSmlouva {
>  ...
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message