Java BPEL Composite Application:不是此wsdl文件中可用的有效xml架构元素

时间:2015-04-03 04:47:04

标签: java xml soap soa bpel

当我部署BPEL Composite Application时,出现错误:

  

错误:在“参数”部分,属性元素的值“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>

1 个答案:

答案 0 :(得分:0)

在部署时,WSDL会被解析,系统必须能够访问引用的XSD架构才能读取类型。现在描述它的方式,XML模式在您的localhost上。您的服务器必须启动并侦听端口8080,并且不应阻止系统访问该地址。

确保xsd架构可在以下位置访问:

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

如果它可用但仍然没有部署,您可以尝试将从架构引用的所有类型直接复制到该部分所在部分的WSDL中。