我想获取Web服务的WSDL文件,我唯一拥有的是它的URL(如webservice.example/foo).
如果我直接使用URL,则仅传递错误响应.
Alf*_*gon 107
通过postfixing URL ?WSDL
如果URL是例如:
http://webservice.example:1234/foo
Run Code Online (Sandbox Code Playgroud)
你用:
http://webservice.example:1234/foo?WSDL
Run Code Online (Sandbox Code Playgroud)
wsdl将被交付.
Jor*_*sys 19
WSDL(Web Service Description Language).可以从SOAP Web服务:
http://www.w3schools.com/xml/tempconvert.asmx
Run Code Online (Sandbox Code Playgroud)
获取我们只需要添加的WSDL ?WSDL,例如:
http://www.w3schools.com/xml/tempconvert.asmx?WSDL
Man*_*och 10
如果将webservice配置为提供它,则只能获取WSDL.因此,您必须指定serviceBehavior并启用httpGetEnabled:
<serviceBehaviors>
<behavior name="BindingBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
Run Code Online (Sandbox Code Playgroud)
如果只能通过https访问webservice,则必须启用http s GetEnabled而不是httpGetEnabled.
要使用Visual Studio 的开发人员命令提示符从 url 下载 wsdl ,请在管理员模式下运行它并输入以下命令:
svcutil /t:metadata http://[your-service-url-here]
Run Code Online (Sandbox Code Playgroud)
您现在可以根据需要在项目中使用下载的 wsdl。
| 归档时间: |
|
| 查看次数: |
280427 次 |
| 最近记录: |