2016-10-10 6 views
2

私はdetergentを使用してsalesforce soap apiに電話をかけます。 私はその関数の呼び出し/ 4を呼びたいが、それは失敗します。erlang洗剤ライブラリでsoapコールのoauthヘッダを渡す

:detergent.call("metadata.wsdl", "describeMetadata", ["37.0"], [{'sessionId',token.access_token}]) 


** (exit) an exception was raised: 
** (FunctionClauseError) no function clause matching in :erlsom_write.processAnyAttributes/4 
    src/erlsom_write.erl:501: :erlsom_write.processAnyAttributes('ok', [], [{:ns, 'http://schemas.xmlsoap.org/soap/envelope/', 'soap', :unqualified}, {:ns, 'http://soap.sforce.com/2006/04/metadata', 'p', :qualified}, {:ns, 'http://www.w3.org/2001/XMLSchema', 'xsd', :qualified}], {[{'soap', 'http://schemas.xmlsoap.org/soap/envelope/'}], 0}) 
    src/erlsom_write.erl:325: :erlsom_write.processAlternativeValue/8 

トークン渡すヘッダー構文の期待されるフォーマットは何ですか?

答えて

3

detergent.call/4を使用していますが、最後のパラメータは#call_optsであると想定しています。あなたは[単一タプルからなる]リストを渡しており、関数節は一致しませんでした。

私は(、#call_opts definition参照)あなたがそこに合格している正確に何がわからないのですが、私は以下のようなものは、トリックを行う必要があると考えている。その1つの下に4`/

は別の `の呼び出しあります
:detergent.call(
    "metadata.wsdl", 
    "describeMetadata", 
    ["37.0"], 
    #call_opts{http_client_options=[{'sessionId',token.access_token}]} 
) 
+0

をおそらくOPが呼びたいもので、 'call_opts'のものではないでしょう(行113)。 (また、貼り付けたコードはErlangスタイルのレコード構文を使用します)。 – Dogbert

+0

@Dogbert 1組のタプルのリストは、 'Msg'と呼ばれるもののようには見えません。また、OPがerlangでライブラリがerlangなので、erlangの構文を使用しました。 – mudasobwa

+0

@ mudasobwa、多くのありがとうございました!できます! – Natallia

関連する問題