xml 从 WSDL 文件确定端点
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13931090/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Determining endpoint from a WSDL file
提问by jezzipin
I'm new to web services and have been tasked with trying to write some packages in PL/SQL that make requests to an external web service to allow customers to view their current support tickets and the status of where we are at in terms of supporting the ticket. I have been given the WSDL location for the service I am trying to use and I have used SOAPUI to inspect the WSDL to form some requests. However, when I try and run a login request it always fails (I think because the endpoint defined in SOAP UI in incorrect.
我是 Web 服务的新手,我的任务是尝试在 PL/SQL 中编写一些包,这些包向外部 Web 服务发出请求,以允许客户查看他们当前的支持票以及我们在支持方面所处的状态门票。我已获得我尝试使用的服务的 WSDL 位置,并且我已使用 SOAPUI 检查 WSDL 以形成一些请求。但是,当我尝试运行登录请求时,它总是失败(我认为是因为 SOAP UI 中定义的端点不正确。
Here is the WSDL file I am trying to use: http://www.visionproject.se/api/docs/service.wsdl
这是我尝试使用的 WSDL 文件:http: //www.visionproject.se/api/docs/service.wsdl
And the API for the service: http://www.visionproject.se/api/docs/soap_service_VisionProjectWebServiceService.html#login2
以及该服务的 API:http: //www.visionproject.se/api/docs/soap_service_VisionProjectWebServiceService.html#login2
And here is the request I am trying to form (shown below). Can anyone point me in the right direction as to why this is failing? I believe it may be to do with the endpoint at the top but I'm not sure.
这是我试图形成的请求(如下所示)。任何人都可以指出我为什么会失败的正确方向吗?我相信这可能与顶部的端点有关,但我不确定。
As I said, I'm new to web services and indeed PL/SQL (I'm from a PHP background and have never done this stuff before) so I apologise if I haven't included enough information.
正如我所说,我是 Web 服务和 PL/SQL 的新手(我来自 PHP 背景,以前从未做过这些东西)所以如果我没有包含足够的信息,我深表歉意。


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:vis="http://www.visionproject.se/service/VisionProjectService-v2">
<soapenv:Header/>
<soapenv:Body>
<vis:login2>
<!--Optional:-->
<username>?</username>
<!--Optional:-->
<password>?</password>
<!--Optional:-->
<visionProjectVersion>?</visionProjectVersion>
</vis:login2>
</soapenv:Body>
</soapenv:Envelope>
采纳答案by Robert Strauch
There are some sample test clients available in the API documentation link you have provided. These make use of the following endpoint URL:
您提供的 API 文档链接中提供了一些示例测试客户端。这些使用以下端点 URL:
http://www.visionproject.se/service/VisionProject-v2/VisionProjectWebServiceService
http://www.visionproject.se/service/VisionProject-v2/VisionProjectWebServiceService
When pasting this to a browser it returns "Invalid SOAP request" so it seems as if there is a service running on this URL.
将其粘贴到浏览器时,它会返回“无效的 SOAP 请求”,因此似乎此 URL 上正在运行一项服务。
Give this a try.
试试这个。
回答by Chris Thornton
The endpoint looks like it's probably correct. A WSDL can have a "suggested" endpoint, but isn't guaranteed to be the actual endpoint. i.e. at the bottom of your WSDL there's an entry for: (StackOverflow didn't like me posting the actual URL, as it contains localhost and is clearly bogus.)
端点看起来可能是正确的。WSDL 可以有一个“建议的”端点,但不能保证是实际的端点。即在您的 WSDL 的底部有一个条目:(StackOverflow 不喜欢我发布实际的 URL,因为它包含 localhost 并且显然是伪造的。)
Your request is likely failing because you haven't replaced the ? placeholders with actual values. Replace those and send it again.
您的请求可能会失败,因为您尚未替换 ? 具有实际值的占位符。更换那些并再次发送。

