Android Emulator上运行的KSOAP2 Web服务错误

Android Emulator上运行的KSOAP2 Web服务错误,android,web-services,wsdl,ksoap2,Android,Web Services,Wsdl,Ksoap2,我试图通过Android Eclipse Emulator调用在本地Tomcat服务器上运行的WSDL Web服务。我正在使用KSOAP2启动服务调用 我在尝试获取响应时看到的错误: SoapFault - faultcode: 'S:Client' faultstring: 'Cannot find dispatch method for {http://localhost:8080/test/}getAllAvailableAssessments' faultactor: 'null' de

我试图通过Android Eclipse Emulator调用在本地Tomcat服务器上运行的WSDL Web服务。我正在使用KSOAP2启动服务调用

我在尝试获取响应时看到的错误:

SoapFault - faultcode: 'S:Client' faultstring: 'Cannot find dispatch method for {http://localhost:8080/test/}getAllAvailableAssessments' faultactor: 'null' detail: null
需要注意的一些事项:

  • 我已经在互联网上批准了这个申请
  • 如果在soapUI上测试,WebService运行良好
  • 我能够看到WSDL文件,只要它的URL指向模拟器的浏览器
这是调用webservice的类:

private static String NAMESPACE = "http://localhost:8080/test/";
private static String URL = "http://10.10.10.55:8080/testwebservices/WebServices/AssessmentListingService?wsdl";
private static String METHOD_NAME = "getAllAvailableAssessments";
private static String SOAP_ACTION = "http://localhost:8080/test/getAllAvailableAssessments";

public static String getAllAvailableAssessments()
{
    String webServiceResult = "";

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    try
    {
        androidHttpTransport.call(SOAP_ACTION, envelope);
        SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
        webServiceResult = response.toString();
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }

    return webServiceResult;
}
这是wsdl文件:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:assessmentListing="http://localhost:8080/test/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="AssessmentListingService" targetNamespace="http://localhost:8080/test/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://localhost:8080/test/AssessmentListing/">
<wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:import namespace="http://localhost:8080/test/AssessmentListing/" schemaLocation="AssessmentListing.xsd"></xsd:import>
    </xsd:schema>
</wsdl:types>
<wsdl:message name="getAllAvailableAssessmentsRequest">
    <wsdl:part name="parameters"
        element="xsd:getAllAvailableAssessmentsRequest">
    </wsdl:part>
</wsdl:message>
<wsdl:message name="getAllAvailableAssessmentsResponse">
    <wsdl:part name="parameters"
        element="xsd:getAllAvailableAssessmentsResponse">
    </wsdl:part>
</wsdl:message>
<wsdl:portType name="AssessmentListingService">
    <wsdl:operation name="getAllAvailableAssessments">
        <wsdl:input message="assessmentListing:getAllAvailableAssessmentsRequest"></wsdl:input>
        <wsdl:output message="assessmentListing:getAllAvailableAssessmentsResponse"></wsdl:output>
    </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AssessmentListingServicePortBinding"
    type="assessmentListing:AssessmentListingService">
    <soap:binding style="document"
        transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="getAllAvailableAssessments">
        <soap:operation
            soapAction="http://localhost:8080/test/AssessmentListingService/getAllAvailableAssessments" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
<wsdl:service name="AssessmentListingService">
    <wsdl:port name="AssessmentListingServicePort" binding="assessmentListing:AssessmentListingServicePortBinding">
        <soap:address location="http://localhost:8080/testwebservices/WebServices/AssessmentListingService" />
    </wsdl:port>
</wsdl:service>


任何想法都将不胜感激。

SOAP\u ACTION变量不必遵循
名称空间+方法名称
模式。这些值可以是任何值,具体取决于WSDL结构

在比较来自SoapUI的请求XML和来自KSOAP2的转储请求XML后,我发现不匹配

特别是在这种情况下,在
SOAP\u操作
变量末尾添加“Request”字符串可以解决这个问题

因此,

private static String NAMESPACE = "http://localhost:8080/test/";
private static String URL = "http://10.10.10.55:8080/testwebservices/WebServices/AssessmentListingService?wsdl";
private static String METHOD_NAME = "getAllAvailableAssessments";
private static String SOAP_ACTION = "http://localhost:8080/test/getAllAvailableAssessmentsRequest";

为什么不在本地运行web服务,并读取两点后面的数字:“;