Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/306.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#SOAP-ERROR:解析WSDL:cand';t从_C#_Asp.net_Wcf_Magento - Fatal编程技术网

C#SOAP-ERROR:解析WSDL:cand';t从

C#SOAP-ERROR:解析WSDL:cand';t从,c#,asp.net,wcf,magento,C#,Asp.net,Wcf,Magento,我尝试将MagentoWeb服务从加载到.net控制台测试应用程序中。我添加了服务引用,它在app.config文件中使用端点生成了basichttpbinding 但是,当我尝试登录时,出现了以下错误:“SOAP-error:解析WSDL:无法从加载”http://myclient.com/index.php/api/v2_soap/index/wsdl/1/“:Start tag expected,”根据这个错误短语“Start tag expected,”它原来是web主机添加了SSL的额

我尝试将MagentoWeb服务从加载到.net控制台测试应用程序中。我添加了服务引用,它在app.config文件中使用端点生成了basichttpbinding


但是,当我尝试登录时,出现了以下错误:“SOAP-error:解析WSDL:无法从加载”http://myclient.com/index.php/api/v2_soap/index/wsdl/1/“:Start tag expected,”根据这个错误短语“
Start tag expected,”它原来是web主机添加了SSL的额外层,而大多数机器都没有安装它。这时浏览器可以浏览,但不能浏览。如果您更改为https怎么办?您可以使用浏览器访问wsdl吗?一些代码/配置文件如何?很难看出有什么问题。@Kaido如果我改为https,它会抛出“无法识别的消息版本”。是的,我可以使用浏览器访问它,只需一个xmlfile@retslig:config file attachedSo您附加的配置会抛出无法识别的消息版本?我想这通常是由404引起的。http和https在浏览器中都工作吗?配置中的地址与SOAP错误中的地址不匹配。我们收到了相同的错误消息:“需要开始标记,”
System.ServiceModel.FaultException was unhandled
  HResult=-2146233087
  Message=SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://myclient.com/index.php/api/v2_soap/index/wsdl/1/' : Start tag expected, '<' not found

  Source=mscorlib
  StackTrace:
    Server stack trace: 
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="Mage_Api_Model_Server_V2_HandlerBinding" closeTimeout="00:01:00"
           openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"      
           maxBufferPoolSize="524288000" maxBufferSize="65536000" maxReceivedMessageSize="65536000">
          <security mode="Transport" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>

      <endpoint address="https://myclient.com/api/v2_soap/index/wsdl/1"
          binding="basicHttpBinding" bindingConfiguration="Mage_Api_Model_Server_V2_HandlerBinding"
          contract="TattyService.Mage_Api_Model_Server_V2_HandlerPortType"
          name="Mage_Api_Model_Server_V2_HandlerPort" />
    </client>
  </system.serviceModel>
</configuration>
 using (Mage_Api_Model_Server_V2_HandlerPortTypeClient proxy = new Mage_Api_Model_Server_V2_HandlerPortTypeClient())
            {
                proxy.login("username", "apikey");
            }