【问题标题】:WSO2 BPEL import wsdl services with different namespaces but using same schema namespaceWSO2 BPEL 导入具有不同命名空间但使用相同模式命名空间的 wsdl 服务
【发布时间】:2015-05-19 10:22:26
【问题描述】:

我正在使用 WSO2 BPS 3.2.0、WSO2 应用服务器 5.2.1 和 WSO2 身份服务器 5.0.0。
我的流程调用了许多服务,因此它导入了许多 WSDL。
BPEL 的 WSDL 有这个:

<import location="Service1.wsdl" namespace="http://webservice1.com/"/>  
<import location="Service2.wsdl" namespace="http://webservice2.com/"/> 

但是两个 Web 服务在同一个命名空间中导入模式。
所以 Service1.wsdl 有

<wsdl:types>
  <xsd:schema>
    <xsd:import namespace="http://Message.com" schemaLocation="webservice1.xsd"></xsd:import>
  </xsd:schema>
</wsdl:types>

并且Service2.wsdl有

<wsdl:types>
  <xsd:schema>
    <xsd:import namespace="http://Message.com" schemaLocation="webservice2.xsd"></xsd:import>
  </xsd:schema>
</wsdl:types>

在我尝试部署流程之前,WSDL 是有效的并且一切正常。
然后我得到异常:

Caused by: org.apache.ode.bpel.compiler.api.CompilationException: error: [CompilationErrors] Compilation completed with 4 error(s):
file:/D:/WSO2/WSO2BP~1.0/bin/../tmp/work/bpelTemp/1.4320261653222122E12/messageProcess_1.0.0/messageProcess.bpel:52: error: [UndeclaredXsdType]
Attempt to reference undeclared XSD type "{http://Message.com}Message".
file:/D:/WSO2/WSO2BP~1.0/bin/../tmp/work/bpelTemp/1.4320261653222122E12/messageProcess_1.0.0/messageProcess.bpel:176: error: [UndeclaredVariable]
Attempt to reference undeclared variable "Service1PLRequest".
null:190: error: [UndeclaredVariable] Attempt to reference undeclared variable "Service1PLRequest".

我发现避免这种情况的唯一方法是重命名服务 WSDL 之一的架构命名空间(删除 web 服务之一也可以工作 :))。
但是这两个服务都使用相同的 3rd 方模式,并且命名空间重命名是不合适的。如何解决这个难题?有什么最佳做法吗?

提前致谢

【问题讨论】:

    标签: namespaces wsdl wso2 bpel


    【解决方案1】:

    爱德华镍。

    对不起,我没听懂..

    您说两个 Web 服务共享相同的命名空间...但是您提供了不同的命名空间。

    import location="Service1.wsdl" namespace="http://webservice1.com/
    import location="Service2.wsdl" namespace="http://webservice2.com/
    

    其他问题似乎与错误的变量名有关。

    Service1PLRequest 不存在...

    【讨论】:

    • 嗨。对不起,我不够清楚。每个服务(Service1,Service2)都有自己的命名空间,并且是不同的。但是这两个服务都使用部分相同的模式和相同的命名空间。例如:我们可能有命名空间 stack.com/customers 的服务客户和命名空间 stack.com/organizations 的服务组织。它们都使用带有命名空间 info.com/address 的架构 address.xsd。 Service1PLRequest 确实存在,但由于命名空间问题而无法识别(我认为)。通过在其中一项服务中重新组织命名空间解决了问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-01
    • 1970-01-01
    • 2014-09-27
    • 1970-01-01
    • 2010-11-15
    • 2016-09-16
    • 1970-01-01
    相关资源
    最近更新 更多