C# xmlsocket.com到sql
我正在尝试从'xmlsocket.com解析XML 使用这个例子 我创建了SQL表,没有出错。我复制了整个代码,但此代码仅适用于完全访问用户,但我使用的是演示服务C# xmlsocket.com到sql,c#,sql,asp.net,xml,C#,Sql,Asp.net,Xml,我正在尝试从'xmlsocket.com解析XML 使用这个例子 我创建了SQL表,没有出错。我复制了整个代码,但此代码仅适用于完全访问用户,但我使用的是演示服务 private XDocument GetLiveScoreDocument() { XMLSoccerCOM.FootballDataSoapClient serviceClient = new XMLSoccerCOM.FootballDataSoapClient(); var node = serviceClie
private XDocument GetLiveScoreDocument()
{
XMLSoccerCOM.FootballDataSoapClient serviceClient = new XMLSoccerCOM.FootballDataSoapClient();
var node = serviceClient.GetLiveScore(apiKey);
XDocument xmlDoc = new XDocument();
xmlDoc = XDocument.Load(new XmlNodeReader(node));
return xmlDoc;
}
我将FootballDataSoapClient
更改为FootballDataDemoSoapClient
并运行网站
XMLSoccerCOM.FootballDataDemoSoapClient serviceClient = new XMLSoccerCOM.FootballDataDemoSoapClient();
var node = serviceClient.GetLiveScore("My Api");
XDocument xmlDoc = new XDocument();
xmlDoc = XDocument.Load(new XmlNodeReader(node));
return xmlDoc;
程序抛出异常
无法加载协定“XMLSoccerCOM.FootballDataDemoSoap”的终结点配置节,因为找到了该协定的多个终结点配置。请按名称指明首选端点配置部分
我不知道怎么修理它。如果您有从
xmlscore.com
解析分数的经验,请帮助我为该web服务添加服务引用时,它会创建两个可能的绑定供使用。例如,当我尝试它时,在我的app.config中,我得到以下信息:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="FootballDataDemoSoap" />
</basicHttpBinding>
<customBinding>
<binding name="FootballDataDemoSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://www.xmlsoccer.com/FootballDataDemo.asmx"
binding="basicHttpBinding" bindingConfiguration="FootballDataDemoSoap"
contract="ServiceReference1.FootballDataDemoSoap" name="FootballDataDemoSoap" />
<endpoint address="http://www.xmlsoccer.com/FootballDataDemo.asmx"
binding="customBinding" bindingConfiguration="FootballDataDemoSoap12"
contract="ServiceReference1.FootballDataDemoSoap" name="FootballDataDemoSoap12" />
</client>
</system.serviceModel>
或
FootballDataDemoSoapClient client = new FootballDataDemoSoapClient("FootballDataDemoSoap");
FootballDataDemoSoapClient client = new FootballDataDemoSoapClient("FootballDataDemoSoap12");`