-1

我的 wsdl 中的肥皂地址位置为"<soap:address location="http://localhost:8080/rpc/soap/helloworldsoap"/>"

在我的网络服务方法中,我有以下路径。

@HttpResource(location="/{name}")

我想获取 SOAP 响应对象。

我尝试了以下网址。

http://localhost:8080/rpc/soap/helloworldsoap/abcd

WSDL

<?xml version='1.0' encoding='UTF-8'?>

<wsdl:definitions name="HelloWorldImplService" targetNamespace="some name space" xmlns:ns1="http://test.com/webservices" xmlns:ns2="http://cxf.apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="some name space" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <wsdl:import location="http://localhost:8080/rpc/soap/helloworldsoap?wsdl=HelloWorld.wsdl" namespace="http://test.com/webservices">
    </wsdl:import>
  <wsdl:binding name="HelloWorldImplServiceSoapBinding" type="ns1:HelloWorld">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="getHelloWorldAsString">
      <soap:operation soapAction="" style="rpc" />
      <wsdl:input name="getHelloWorldAsString">
        <soap:body namespace="http://test.com/webservices" use="literal" />
      </wsdl:input>
      <wsdl:output name="getHelloWorldAsStringResponse">
        <soap:body namespace="http://test.com/webservices" use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="HelloWorldImplService">
    <wsdl:port binding="tns:HelloWorldImplServiceSoapBinding" name="HelloWorldImplPort">
      <soap:address location="http://localhost:8080/rpc/soap/helloworldsoap" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

肥皂:

    <soap:Envelope>
       <soap:Body>
        <soap:Fault>
       <faultcode>soap:Server</faultcode>
      <faultstring>No such operation:  (HTTP GET PATH_INFO: /soap/helloworldsoap)     
      </faultstring>
    </soap:Fault>
  </soap:Body>
  </soap:Envelope>

但我没有得到响应对象。

谁能告诉我如何实现这一目标。

提前致谢。

4

2 回答 2

0

你没有提供太多信息。但是试试

telnet 到 localhost 8080,查看服务是否正在运行

如果是,则从命令行使用 curl 来检查 WSDL 是否实际可用。

于 2013-01-07T07:04:50.357 回答
0

我很困惑我们是否可以将资源位置用于 SOAP。对于 REST,它很好,而且由于您的错误,它在服务器端(您的输入很好)也给出了关于位置的错误。

尝试这样的事情...

删除资源位置,使用@WebMethod。

发布您的接口定义以及 SOAP 输入。

例子 :

界面:

@WebService
public interface Service {

public Address validate(Address address);

@WebMethod
public String sayHi(
    @WebParam(mode = WebParam.Mode.IN)
    String msg);
}

执行:

package com.example;

导入 javax.jws.WebService;

@WebService(endpointInterface = "com.example.AddressService" )
public class AddressServiceImpl implements AddressService {

@Override
public Address validateAdress(Address address) {
     return  address;
    }

    @Override
    public String sayHi(String msg) {
        return "Vinay";
    }
}

希望这个例子有帮助

于 2013-01-07T07:32:25.907 回答