【问题标题】:Java BPEL Composite Application: not a valid xml schema element available in this wsdl fileJava BPEL 复合应用程序:此 wsdl 文件中没有可用的有效 xml 模式元素
【发布时间】:2015-04-03 04:47:04
【问题描述】:

当我部署我的 BPEL 复合应用程序时,我收到错误:

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

【问题讨论】:

    标签: java xml soap soa bpel


    【解决方案1】:

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-29
      • 2013-01-07
      • 1970-01-01
      • 1970-01-01
      • 2017-03-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多