使用SOAP使用Java调用Web服务

使用SOAP使用Java调用Web服务,java,web-services,soap,Java,Web Services,Soap,我收到了以下示例请求,但我不知道如何实际执行它 POST /InfoTransit/userservices.asmx HTTP/1.1 Host: 10.0.2.52 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://miz.it/infotransit/GetBusStopsList" <?xml version="1.0" encoding="utf-8"?> &l

我收到了以下示例请求,但我不知道如何实际执行它

POST /InfoTransit/userservices.asmx HTTP/1.1
Host: 10.0.2.52
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://miz.it/infotransit/GetBusStopsList"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetBusStopsList xmlns="http://miz.it/infotransit">
      <auth>
        <user>..of course, I have this..</user>
        <password>..and this..</password>
      </auth>
    </GetBusStopsList>
  </soap:Body>
</soap:Envelope>
但是,我的连接超时。此外,输出SOAP消息的信封与示例请求的信封不完全匹配

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">


客户有什么问题吗?还是服务提供商?

您可以在代码中尝试以下内容:

SOAPElement getBusStopsList = soapBody.addChildElement("GetBusStopsList", "", "http://miz.it/infotransit");
编辑:在
getBusStopsList
中,第一个字母是小写。因此,请尝试
GetBusStopsList

以下是新代码:

SOAPElement GetBusStopsList = soapBody.addChildElement("GetBusStopsList", "", "http://miz.it/infotransit");

你能解决这个问题吗?
SOAPElement GetBusStopsList = soapBody.addChildElement("GetBusStopsList", "", "http://miz.it/infotransit");