Java BPEL复合应用程序:不是此wsdl文件中可用的有效xml模式元素



当我部署BPEL组合应用程序时,我得到错误:

错误:在"parameters"部分中,属性元素的值"tns:hello"为不是此wsdl文件中可用的有效xml模式元素。:具体说明元素属性的有效架构元素值。

以下是发生此错误的CASA xml文件:

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             targetNamespace="RetailerBPELCA"
             xmlns:tns="RetailerBPELCA" xmlns:ns="http://retailer.sc.team7/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <import namespace="http://retailer.sc.team7/" location="../jbiServiceUnits/RetailerBPEL/localhost_8080/Retailer/RetailerService.wsdl"/>
    <portType name="dummyCasaPortType"/>
    <binding name="casaBinding1" type="ns:RetailerService">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="hello">
            <soap:operation/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
        <operation name="processOrder">
            <soap:operation/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
        <operation name="orderConfirmation">
            <soap:operation/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="RetailerBPELCAService1">
        <port name="casaPort1" binding="tns:casaBinding1">
            <soap:address location="http://localhost:${HttpDefaultPort}/RetailerBPELCAService1/casaPort1"/>
        </port>
    </service>
</definitions>

以及原始WSDL文件:

<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.1.1 (branches/2.1-6844; 2011-07-29T12:07:24+0000) JAXWS-RI/2.2.5 JAXWS/2.2. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.1.1 (branches/2.1-6844; 2011-07-29T12:07:24+0000) JAXWS-RI/2.2.5 JAXWS/2.2. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://retailer.sc.team7/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://retailer.sc.team7/" name="RetailerService">
<types>
<xsd:schema>
<xsd:import namespace="http://retailer.sc.team7/" schemaLocation="http://localhost:8080/Retailer/RetailerService?xsd=1"/>
</xsd:schema>
</types>
<message name="hello">
<part name="parameters" element="tns:hello"/>
</message>
<message name="helloResponse">
<part name="parameters" element="tns:helloResponse"/>
</message>
<message name="processOrder">
<part name="parameters" element="tns:processOrder"/>
</message>
<message name="processOrderResponse">
<part name="parameters" element="tns:processOrderResponse"/>
</message>
<message name="orderConfirmation">
<part name="parameters" element="tns:orderConfirmation"/>
</message>
<message name="orderConfirmationResponse">
<part name="parameters" element="tns:orderConfirmationResponse"/>
</message>
<portType name="RetailerService">
<operation name="hello">
<input wsam:Action="http://retailer.sc.team7/RetailerService/helloRequest" message="tns:hello"/>
<output wsam:Action="http://retailer.sc.team7/RetailerService/helloResponse" message="tns:helloResponse"/>
</operation>
<operation name="processOrder">
<input wsam:Action="http://retailer.sc.team7/RetailerService/processOrderRequest" message="tns:processOrder"/>
<output wsam:Action="http://retailer.sc.team7/RetailerService/processOrderResponse" message="tns:processOrderResponse"/>
</operation>
<operation name="orderConfirmation">
<input wsam:Action="http://retailer.sc.team7/RetailerService/orderConfirmationRequest" message="tns:orderConfirmation"/>
<output wsam:Action="http://retailer.sc.team7/RetailerService/orderConfirmationResponse" message="tns:orderConfirmationResponse"/>
</operation>
</portType>
<binding name="RetailerServicePortBinding" type="tns:RetailerService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="hello">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="processOrder">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="orderConfirmation">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="RetailerService">
<port name="RetailerServicePort" binding="tns:RetailerServicePortBinding">
<soap:address location="http://localhost:8080/Retailer/RetailerService"/>
</port>
</service>
</definitions>

在部署时,WSDL会被解析,系统必须能够访问引用的XSD模式才能读取类型。按照现在的描述方式,XML模式位于本地主机上。您的服务器必须在8080端口上启动并侦听,并且不应该有任何东西阻止系统访问该地址。

确保xsd模式可在以下位置访问:

http://localhost:8080/Retailer/RetailerService?xsd=1.

如果它可用但仍然没有部署,您可以尝试将模式中引用的所有类型直接复制到节中的WSDL中,而不是该节。

最新更新