2011-10-28 13 views
0

私はVisual Basic 6でmagento-Soap-Inferfaceと「話す」ツールを作成しようとしています。Visual Basic 6.0とMagentoSoapの問題

私は、以下のバージョンを使用しています: - Magentoのを バージョン1.5.0.0に - マイクロソフトソープTookit 3.0のVisual Basic 6

はここのようにVBでのコーディングのために:

Private Sub Command1_Click() 
    Dim paramstring As String 
    Dim soapClient, sessionID 
    Dim attributeSets() As returnData 

    Set soapClient = CreateObject("MSSOAP.SoapClient30") 
    soapClient.MSSoapInit "http://localhost/magento/index.php/api/soap/?wsdl" 
    sessionID = soapClient.login("dede", "1q2w3e4r5t6y7u") 
    attributeSets = soapClient.call(sessionID, "product_attribute_set.list", 0)  
End Sub 

私が実行していますとエラー

実行時エラー '-2147467259(80004004) SoapMapper:スキーマの定義wのSoapMapper Mapのターゲットネームスペースが見つかりません。HRESULT = 0x80004005:指定されていないエラー - Soap Mapper:ネームスペースhttp://xml.apache.org/xml-soapにMapタイプの配列要素のマッパーを作成できません。 HRESULT = 0x80004005:指定されていないエラー - SoapMapper:SoapMapperへのデータの復元anyType Failed。

どのように記述しましたか?問題は、anyTypeまたはfixedArrayを取得したときにのみ発生します。

私を助けてください。

+0

VB6からWebサービスを呼び出す簡単な方法は、COMインターフェイスとしてサービスの機能を公開する.NetでプロキシCOMオブジェクトを作成することです。それはあなたの問題を解決するだろうか? – GTG

答えて

0

これは、xmlリクエストスキーマが期待どおりに一致しないことを示しています。 プロキシCOMはマイクロソフトXML、バージョン2.0以降

方法URLサービスで

Public Function PostRequest(urlService As String, soapAction As String, xmlRequest As String) As String 

    Dim oHttReq As XMLHTTPRequest 
    Dim Log  As Logger 
    Dim w  As w32 
    Dim filepath As String 
    Dim response As String 

    Set oHttReq = New XMLHTTPRequest 

    oHttReq.open "POST", urlService, False 
    oHttReq.setRequestHeader "Content-Type", "text/xml; charset=utf-8" 
    oHttReq.setRequestHeader "SOAPAction", soapAction 
    oHttReq.send xmlRequest  

    PostRequest = oHttReq.responseText 

    If Not oHttReq Is Nothing Then 
    Set oHttReq = Nothing 
    End If  

End Function 

がASMX WebサービスのURLを入れていることを確認への参照を追加します。ここでは例

必要はありません:いくつかの方法http://myserver/serviceinterface/serviceinterface.asmx

石鹸アクションでは、あなたのサービスでいくつかの方法を改訂して、定義を参照してください。 "のhttp:// localhost /をcommonxmlschemas /技術/ createcharge"(例のみ)

あなたも

からのSOAPリクエスト

POST /myserver/serviceinterface/serviceinterface.asmx HTTP/1.1 
Host: myserver 
Content-Type: text/xml; charset=utf-8 
Content-Length: length 
SOAPAction: "http://localhost/commonxmlschemas/technology/createcharge" 

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Header> 
    <RequestHeader xmlns="http://localhost/commonxmlschemas/technology/"> 
     <Headers> 
     <anyType /> 
     <anyType /> 
     </Headers> 
    </RequestHeader> 
    </soap:Header> 
    <soap:Body> 
    <createcharge xmlns="http://localhost/commonxmlschemas/technology/"> 
     <chargeRequest xmlns="http://localhost/commonxmlschemas/technology/chargeRequest.xsd"> 
     <charge> 
      <creditcard xmlns="http://localhost/commonxmlschemas/technology/Charge.xsd">string</creditcard> 
      <amount xmlns="http://localhost/commonxmlschemas/technology/Charge.xsd">int</amount> 
     </charge> 
     <Tag>string</Tag> 
     </chargeRequest> 
    </createcharge> 
    </soap:Body> 
</soap:Envelope> 

コピーを見ているようでは、タグの呼び出しSOAPACTION、いくつかの方法のSOAPActionを存在

<?xml to </soap:Envelope> 

それはxmlRequestパラメータは、今だけでxmlRequestにパラメータを記入していない、

シンプルPostRequestメソッドに送信しているのですか?

関連する問題