0

https://myclient.com/api/v2_soap/index/wsdl/1から.netコンソールテストアプリケーションにmagentoWebサービスをロードしようとしています。サービス参照を追加すると、エンドポイントを使用してapp.configファイルにbasichttpbindingが生成されました。

ただし、ログインしようとすると、次のエラーが発生しました: "SOAP-ERROR:Parsing WSDL:Could n't load from'http://myclient.com/index.php/api/v2_soap/index/wsdl/1/':開始タグが必要です、「<」が見つかりません」

何か案は?

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)

app.config:

<?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>

program.cs:

 using (Mage_Api_Model_Server_V2_HandlerPortTypeClient proxy = new Mage_Api_Model_Server_V2_HandlerPortTypeClient())
            {
                proxy.login("username", "apikey");
            }
4

2 に答える 2

0

エラー「」のこのフレーズによるとStart tag expected, '<' not found、基本的な問題は、おそらくMagentoファイル「wsdl.xml」にXML開始タグがないことであるに違いありません。

私は実際に最も簡単な解決策を知りませんが、ブラウザにWSDLを正常にロードした後は、各行を手動で確認できます。エラーの行に基づいて、Magentoモジュールを特定し、この欠陥を修正する必要があります。

それが役に立てば幸い。

于 2012-08-21T19:17:56.413 に答える
0

それは、ほとんどのマシンにインストールされていないSSLの追加レイヤーを追加したWebホストであることが判明しました。それはブラウザがそれを閲覧できるがVSはできないときです。

于 2012-08-22T14:02:13.977 に答える