你知道在 asp.net 中调用 http(不是 https)网络服务(使用用户名和密码进行身份验证)*吗?它不是 SOAP 网络服务。 Web服务是用java开发的。因此 wsdl.exe 将无法通过引用调用。
这是 SOAP UI 提取的 SOAP 信封
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ak="http://linkaddress">
<soapenv:Header>
<ak:password>?</ak:password>
<ak:username>?</ak:username>
</soapenv:Header>
<soapenv:Body>
<ak:Vehicle>
<chassisNo>?</chassisNo>
<plateNo>?</plateNo>
<plateCode>?</plateCode>
</ak:Vehicle>
</soapenv:Body>
</soapenv:Envelope>
最佳答案
使用 Add Web Service Reference 而不是 Add Web Reference 来自 Visual Studio。
关于c# - 如何在 Asp.Net 中调用基于 HTTP 的 Java Web 服务(Servlet)。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7874943/