2016-07-18 14 views
0

ich habe Problem veröffentlichen, wenn ich Wsdl über ServiceMix mit jaxwsWsdl Schema Namenskonflikt in der Sammlung

ich habe WSDL-Datei wie veröffentlichen:

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions name="CartesSim" targetNamespace="http://monappli.com/cartesSim/cartesSim/V1" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:tns="http://monappli.com/cartesSim/cartesSim/V1" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:cs="http://monappli.com/cartesSim/datatypes/V1"> 
<wsdl:types> 
    <xsd:schema targetNamespace="http://monappli.com/cartesSim/cartesSim/V1"> 
     <xsd:import namespace="http://monappli.com/cartesSim/datatypes/V1" schemaLocation="cartesSim.xsd" /> 

     <xsd:element name="chargerCartesSimInput" type="cs:referentielCartesSim" /> 
     <xsd:element name="chargerCartesSimOutput" type="cs:rapportImport" /> 

     <xsd:element name="chargerConsoCartesSimInput" type="cs:consommationCartesSim" /> 
     <xsd:element name="chargerConsoCartesSimOutput" type="cs:rapportImport" /> 
    </xsd:schema> 
</wsdl:types> 

<wsdl:message name="chargerCartesSim"> 
    <wsdl:part element="tns:chargerCartesSimInput" name="parameters"/> 
</wsdl:message> 
<wsdl:message name="chargerCartesSimResponse"> 
    <wsdl:part element="tns:chargerCartesSimOutput" name="parameters"/> 
</wsdl:message> 
<wsdl:message name="chargerConsoCartesSim"> 
    <wsdl:part element="tns:chargerConsoCartesSimInput" name="parameters"/> 
</wsdl:message> 
<wsdl:message name="chargerConsoCartesSimResponse"> 
    <wsdl:part element="tns:chargerConsoCartesSimOutput" name="parameters"/> 
</wsdl:message> 
<!-- fault --> 
<wsdl:message name="cartesSimFault" > 
    <wsdl:part type="xsd:string" name="errorMessage" /> 
</wsdl:message> 

<wsdl:portType name="CartesSim"> 
    <wsdl:operation name="chargerCartesSim"> 
     <wsdl:input message="tns:chargerCartesSim"/> 
     <wsdl:output message="tns:chargerCartesSimResponse"/> 
     <wsdl:fault message="tns:cartesSimFault" name="cartesSimFault"/> 
    </wsdl:operation> 
    <wsdl:operation name="chargerConsoCartesSim"> 
     <wsdl:input message="tns:chargerConsoCartesSim"/> 
     <wsdl:output message="tns:chargerConsoCartesSimResponse"/> 
     <wsdl:fault message="tns:cartesSimFault" name="cartesSimFault"/> 
    </wsdl:operation> 
</wsdl:portType> 

<wsdl:binding name="CartesSimSOAP" type="tns:CartesSim"> 
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
    <wsdl:operation name="chargerCartesSim"> 
     <soap:operation soapAction="chargerCartesSim"/> 
     <wsdl:input> 
      <soap:body use="literal"/> 
     </wsdl:input> 
     <wsdl:output> 
      <soap:body use="literal"/> 
     </wsdl:output> 
     <wsdl:fault name="cartesSimFault"> 
      <soap:body use="literal"/> 
     </wsdl:fault> 
    </wsdl:operation> 
    <wsdl:operation name="chargerConsoCartesSim"> 
     <soap:operation soapAction="chargerConsoCartesSim"/> 
     <wsdl:input> 
      <soap:body use="literal"/> 
     </wsdl:input> 
     <wsdl:output> 
      <soap:body use="literal"/> 
     </wsdl:output> 
     <wsdl:fault name="cartesSimFault"> 
      <soap:body use="literal"/> 
     </wsdl:fault> 
    </wsdl:operation> 
</wsdl:binding> 

<wsdl:service name="CartesSim"> 
    <wsdl:port binding="tns:CartesSimSOAP" name="CartesSimSOAP"> 
     <soap:address location="http://localhost/CartesSim"/> 
    </wsdl:port> 
</wsdl:service> 

und XSD wie folgt aus:

<?xml version="1.0" encoding="UTF-8"?> 
<xsd:schema targetNamespace="http://monappli.com/cartesSim/datatypes/V1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 

<xsd:complexType name="referentielCartesSim"> 
    <xsd:sequence> 
     <xsd:element name="fichier" type="xsd:base64Binary"/> 
    </xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="consommationCartesSim"> 
    <xsd:sequence> 
     <xsd:element name="fichier" type="xsd:base64Binary"/> 
     <xsd:element name="mois" type="xsd:gYearMonth" /> 
    </xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="rapportImport"> 
    <xsd:sequence> 
     <xsd:element name="fichier" type="xsd:base64Binary"/> 
    </xsd:sequence> 
</xsd:complexType> 

Generation mit WSDL2Java funktionieren gut.

aber wenn ich veröffentlichen Endpunkt in Plan wie folgt aus:

<jaxws:endpoint implementor="#webServiceCartesSim" 
    address="/cartesim"> 
    <jaxws:dataBinding> 
     <bean class="org.apache.cxf.jaxb.JAXBDataBinding"/> 
    </jaxws:dataBinding> 
</jaxws:endpoint> 

i in ServiceMix diesen Fehler bekam:

Caused by: javax.xml.ws.WebServiceException: org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection 
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371) 
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251) 
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:539) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_71] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_71] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_71] 
    at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_71] 
    at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[18:org.apache.aries.blueprint.core:1.4.3] 
    at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[18:org.apache.aries.blueprint.core:1.4.3] 
    at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[18:org.apache.aries.blueprint.core:1.4.3] 
    ... 39 more 
Caused by: org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in collection 
    at org.apache.ws.commons.schema.XmlSchema.<init>(XmlSchema.java:126) 
    at org.apache.ws.commons.schema.XmlSchema.<init>(XmlSchema.java:140) 
    at org.apache.cxf.common.xmlschema.SchemaCollection.newXmlSchemaInCollection(SchemaCollection.java:194) 
    at org.apache.cxf.jaxb.JAXBSchemaInitializer.createBridgeXsElement(JAXBSchemaInitializer.java:355) 
    at org.apache.cxf.jaxb.JAXBSchemaInitializer.checkForExistence(JAXBSchemaInitializer.java:333) 
    at org.apache.cxf.jaxb.JAXBSchemaInitializer.begin(JAXBSchemaInitializer.java:150) 
    at org.apache.cxf.service.ServiceModelVisitor.visitOperation(ServiceModelVisitor.java:120) 
    at org.apache.cxf.service.ServiceModelVisitor.walk(ServiceModelVisitor.java:74) 
    at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:396) 
    at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) 
    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:467) 
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:712) 
    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:527) 
    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:261) 
    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215) 
    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102) 
    at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159) 
    at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211) 
    at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456) 
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334) 
    ... 48 more 

i don t das Problem finden :(

Quellcode XmlSchema ist:

if (parent != null) { 
     XmlSchemaCollection.SchemaKey schemaKey = new XmlSchemaCollection.SchemaKey(this.logicalTargetNamespace, systemId); 

     if (parent.containsSchema(schemaKey)) { 
      throw new XmlSchemaException("Schema name conflict in collection"); 
     } 
     parent.addSchema(schemaKey, this); 
    } 

aber Apache kann SchemaKey nicht im Log ausgeben, so weiß ich nicht wo der Fehler ist.

Dank für Ihre Hilfe

Antwort

0

finaly finde ich eine Lösung:

i mein Endpunkt wie folgt erklären und alle Arbeiten gut!

<jaxws:endpoint implementor="#webServiceCartesSim" 
wsdlLocation="classpath:cartesSim.wsdl" 
        address="/cartesSim" 
        xmlns:s="http://monappli.com/cartesSim/cartesSim/V1" 
        serviceName="s:CartesSim" 
        > 
    <jaxws:dataBinding> 
     <bean class="org.apache.cxf.jaxb.JAXBDataBinding"/> 
    </jaxws:dataBinding> 
</jaxws:endpoint>