WSO2 BPEL导入具有不同名称空间但使用相同模式名称空间的wsdl服务



我使用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是有效的,一切看起来都很好,直到我尝试部署进程。
然后得到exception:

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重命名模式命名空间(删除一个webservice也可以:))。
但是这两个服务使用相同的第三方模式和名称空间重命名是不合适的。如何解决这个难题?有没有最佳实践?

Thanks in advance

edward Nickel.

对不起,我没听懂。

你说两个web服务共享相同的命名空间…但是您提供了不同的名称空间。

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

另一个问题似乎与错误的变量名有关。

最新更新