Java SOAP客户端,动态更改服务器,无法解释的错误

Java SOAP客户端,动态更改服务器,无法解释的错误,java,soap,wsdl,jax-ws,soap-client,Java,Soap,Wsdl,Jax Ws,Soap Client,我正在尝试实现一个访问多个服务器的SOAP客户机。但是,服务器不使用相同的WSDL。它们在绑定名称和服务名称上有所不同,例如: namespace="http://www.standards.org/" <wsdl:service name="vendorA_ep"> <wsdl:port name="vendorA_svc_pt" binding="tns:InventoryBinding"> <soap:address location

我正在尝试实现一个访问多个服务器的SOAP客户机。但是,服务器不使用相同的WSDL。它们在绑定名称和服务名称上有所不同,例如:

namespace="http://www.standards.org/"

<wsdl:service name="vendorA_ep">
    <wsdl:port name="vendorA_svc_pt" binding="tns:InventoryBinding">
        <soap:address location="http://vendorA.com/InventoryService/inventory_ep"/>
    </wsdl:port>
</wsdl:service>
(是的,META-INF可以工作,只要它隐藏在WEB-INF/classes目录中)

然后我在我的客户中调用它:

InventoryService_Service endPoint = new InventoryService_Service();
InventoryService inventoryService = endPoint.getInventoryServiceBinding();
Reply reply = inventoryService.getInventoryLevels(request);
一切都很好。现在我想切换到来自vendorB的数据:

InventoryService_Service endPoint = new InventoryService_Service();
InventoryService inventoryService = endPoint.getInventoryServiceBinding();

BindingProvider bp = (BindingProvider) inventoryService;
// Below is the trouble line!
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://vendorB.com/InventoryService/customerInventory.svc");

Reply reply = inventoryService.getInventoryLevels(request);
在执行GetInventoryLevel()时,我会收到以下错误消息:

javax.xml.ws.soap.SOAPFaultException: The <from> value is invalid.
The result of from-spec is null.
Either the from node value or the xpath query in the from node value was invalid.
According to BPEL4WS spec 1.1 section 14.3, the from node value should not be empty. Verify the from node value at line number 79 in the BPEL source.
javax.xml.ws.soap.SOAPFaultException:该值无效。
from spec的结果为空。
from节点值或from节点值中的xpath查询无效。
根据BPEL4WS规范1.1第14.3节,from节点值不应为空。验证BPEL源中第79行处的from节点值。
我不知道为什么不同的端点会产生一条模糊的错误消息。我想我错过了一些秘密超级酱,但不知道是什么

蒂亚,
Jerome。

可能您应该
验证BPEL源代码第79行处的from节点值。
Konstantin,因为您似乎知道它在哪里,请告诉我在哪里可以找到此BPEL源代码。
InventoryService_Service endPoint = new InventoryService_Service();
InventoryService inventoryService = endPoint.getInventoryServiceBinding();

BindingProvider bp = (BindingProvider) inventoryService;
// Below is the trouble line!
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://vendorB.com/InventoryService/customerInventory.svc");

Reply reply = inventoryService.getInventoryLevels(request);
javax.xml.ws.soap.SOAPFaultException: The <from> value is invalid.
The result of from-spec is null.
Either the from node value or the xpath query in the from node value was invalid.
According to BPEL4WS spec 1.1 section 14.3, the from node value should not be empty. Verify the from node value at line number 79 in the BPEL source.