1、地址:"http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"
2、vs使用服务引用
Imports ClassLibrary10.ServiceReference1
Public Class Class1
Public Function getWeatherbyCityName(ByVal city As String) As String()
Dim tq As New ServiceReference1.WeatherWebServiceSoapClient()
Return tq.getWeatherbyCityName(city)
End Function
End Class
3、修改Foxble.exe.config
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="WeatherWebServiceSoap" />
</basicHttpBinding>
<customBinding>
<binding name="WeatherWebServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"
binding="basicHttpBinding" bindingC
c name="WeatherWebServiceSoap" />
<endpoint address="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"
binding="customBinding" bindingC
c name="WeatherWebServiceSoap12" />
</client>
</system.serviceModel>
4 FT引用
Dim dl As new ClassLibrary10.Class1()
Dim str() As String = dl.getWeatherbyCityName("杭州")
报错:无法加载协定为“ServiceReference1.WeatherWebServiceSoap”的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分。