我通过此 url 获得了 MyService(AXIS 1.4 服务):
curl http://localhost:9999/prefix/services/MyService?wsdl
将它放到浏览器查询行中,我返回了 XML WSDL。
问题是:我应该在代码中使用哪个 URL 来连接到 MyService 以在那里调用特定的方法?
这是我现在的连接代码:
InterfacePortType_Stub stub
= (InterfacePortType_Stub) myService.getPort();
stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:9999/prefix/services/MyService");
this.port = stub;
final MyResponse myResponse = port.myMethod(myRequest);
所以,我用**http://localhost:9999/prefix/services/MyService**
字符串来连接。但它不起作用 - myResponse.status = 失败。
在我生成的文件的顶部,我有一个像这样的标题:
// This class was generated by the JAXRPC SI, do not edit. // Contents subject to change without notice. // JAX-RPC Standard Implementation (1.1.2_01, build R40) // Generated source version: 1.1.2