Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# xmlsocket.com到sql_C#_Sql_Asp.net_Xml - Fatal编程技术网

C# xmlsocket.com到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

我正在尝试从'xmlsocket.com解析XML

使用这个例子

我创建了SQL表,没有出错。我复制了整个代码,但此代码仅适用于完全访问用户,但我使用的是演示服务

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");`