2012-03-13 31 views
3

Coldfusion 8を使用したBullhorn SOAP Webサービスの統合に取り掛かりました。認証に問題があり、セッションを取得しています。誰かがhere行ったように私はそれをやってみました :Coldfusionを使用したBullhorn SOAP WebサービスAPIとの統合

<cfset session_arg = structnew()> 
<cfset session_arg.username = 'xxxxxx'> 
<cfset session_arg.password = 'xxxxxxx'> 
<cfset session_arg.apiKey  = 'xxxxxxxxxxxxxxxxxxxxxxx'> 

<cfinvoke 
      webservice   = "https://api.bullhornstaffing.com/webservices-2.0/?wsdl" 
      method   = "startSession" 
      returnvariable  = "bhSession" 
      argumentcollection = "#session_arg#"> 
</cfinvoke> 

私は、2.0 Webサービスのエンドポイントと1.1エンドポイントを交換しました。 startSession()は正常に動作しますが、getSession()を使用してセッション値を取得するはずですが、返されたオブジェクトでは使用できません。親クラスの関数です。

enter image description here

私はbhSession.super.getSessionを使ってみた()が、それはどちらか動作しませんでした。

私はこの統合にアプローチする方法任意の提案に感謝するだろう:

  • は、私は完全にはcfinvoke/CREATEOBJECTを残し、手で CFHTTPとSOAPエンベロープを作成し続けるべき?

  • または多分統合を行うためにいくつかのJavaライブラリを使用しますか?

  • またはAPIの1.1バージョンを使用していますか?


SOAPレスポンス私はあるsoapUIを使用して取得:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> 
    <S:Body> 
     <ns2:startSessionResponse xmlns:ns2="http://apiservice.bullhorn.com/"> 
     <return> 
      <session>THE_SESSION_VAR</session> 
      <corporationId>COPRPORATION_ID</corporationId> 
      <userId>USER_ID</userId> 
     </return> 
     </ns2:startSessionResponse> 
    </S:Body> 
</S:Envelope> 

すべてが大丈夫です。手動の方法が適切な解決策であると思われます。

ありがとうございました。
ルーカス

答えて

2

最終的にそれを示します。

GetSOAPResponseを使用して実際の応答を取得する必要があります。

例のコード誰かが興味を持っている場合:

<cfscript> 
    webservice = createObject("webservice", "https://api.bullhornstaffing.com/webservices-2.0/?wsdl"); 
    webservice.startSession(myUsername, myPassword, myAPIKey); 
    sessionResult = GetSOAPResponse(webservice); 
</cfscript> 

sessionResultは、必要なXMLが含まれています。

関連する問題