如何在 .Net 中使用 Binding Url 连接到 WSDL 服务
How to connect to WSDL service using Binding Url in .Net
我已经获得了一个 Web 服务,我需要在我的 MVC 应用程序中使用它。
用户已提供
WSDL URL :
http://abc.xyz.nirp.com:50000/dir/wsdl?p=ic/310c503c873138a884ddd3ee4a5738e6
我能够使用 WSDL URL 使用 SOAP 凭据添加服务引用,但我还需要将这些添加到 Web 配置和应用程序配置中,我无法理解将其放置在何处。
关于如何使用此绑定的提示 Url 并将其放入 Web Config 和 App Config 中,这对我很有帮助。
检查你的 web.config。添加服务引用后 visual studio 在您的 web.config 中添加端点。你可能有这样的部分:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="DefaultServiceEndpoint">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="ADDRESS_HERE"
binding="wsHttpBinding" bindingConfiguration="DefaultServiceEndpoint"
contract="ServiceReference1.SOME_CLASS" name="DefaultServiceEndpoint" />
</client>
</system.serviceModel>
您可以在此处更改地址。
我已经获得了一个 Web 服务,我需要在我的 MVC 应用程序中使用它。 用户已提供 WSDL URL : http://abc.xyz.nirp.com:50000/dir/wsdl?p=ic/310c503c873138a884ddd3ee4a5738e6
我能够使用 WSDL URL 使用 SOAP 凭据添加服务引用,但我还需要将这些添加到 Web 配置和应用程序配置中,我无法理解将其放置在何处。
关于如何使用此绑定的提示 Url 并将其放入 Web Config 和 App Config 中,这对我很有帮助。
检查你的 web.config。添加服务引用后 visual studio 在您的 web.config 中添加端点。你可能有这样的部分:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="DefaultServiceEndpoint">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="ADDRESS_HERE"
binding="wsHttpBinding" bindingConfiguration="DefaultServiceEndpoint"
contract="ServiceReference1.SOME_CLASS" name="DefaultServiceEndpoint" />
</client>
</system.serviceModel>
您可以在此处更改地址。