0

Oracle Fusion Middleware 12.1.3を使用しており、基本認証が必要なリモートRESTサービスを起動する必要があるBPELプロセスを開発しています。Basic認証を使用してOracle SOAのBPELからRESTサービスを呼び出す方法は?

私は休憩サービスへ外部参照を作成し、そして私のcomposite.xmlで、それは次のようになります。このコードで

.... 
<component name="MyCompositeBASProcess" version="2.0"> 
    <implementation.bpel src="BPEL/MyCompositeBASProcess.bpel"/> 
    <componentType> 
     <service name="mycompositebasprocess_client" ui:wsdlLocation="WSDLs/MyCompositeBASProcess.wsdl"> 
      <interface.wsdl interface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/MyCompositeBASProcess#wsdl.interface(MyCompositeBASProcess)" 
        callbackInterface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/MyCompositeBASProcess#wsdl.interface(MyCompositeBASProcessCallback)"/> 
     </service> 
     <reference name="CMProxyRS" ui:wsdlLocation="WSDLs/CMProxyRS.wsdl"> 
      <interface.wsdl interface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/CMProxyRS#wsdl.interface(CMProxyRS_ptt)"/> 
     </reference> 
    </componentType> 
    <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string" many="false">async.persist</property> 
</component> 

<reference name="CMProxyRS" ui:wsdlLocation="WSDLs/CMProxyRS.wsdl"> 
    <interface.wsdl interface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/CMProxyRS#wsdl.interface(CMProxyRS_ptt)"/> 
    <binding.rest config="Adapters/CMProxyRS.wadl" location="http://server_WITHOUT_basic-auth/cmproxy/resources/v2/" /> 
</reference> 
.... 

私はBASIC_AUTHで保護されていないRESTサービスを呼び出すと、それはうまく動作します。

ここで、基本認証が必要なリモート環境に切り替えると、成功することはできませんでした。

基本認証を使用してSOAPサービスを呼び出す例がいくつか見つかりましたが、RESTサービスにとって本当に面白いものはありません。しかし、Oracle Fusionスタック12.1.3では、RESTサービスが使用される前にSOAPサービスに「適合」されているため、私が見つけたサンプルを使用できると考えました。

だから、私は、ユーザー/パスワードとポリシーを追加するために私composite.xmlを更新:あなたが見ることができるように

.... 
<reference name="CMProxyRS" ui:wsdlLocation="WSDLs/CMProxyRS.wsdl"> 
    <interface.wsdl interface="http://xmlns.oracle.com/myPartitionSOA/MyCompositeBAS/CMProxyRS#wsdl.interface(CMProxyRS_ptt)"/> 
    <binding.rest config="Adapters/CMProxyRS.wadl" location="http://server_WITH_basic-auth/cmproxy/resources/v2/"> 
     <wsp:PolicyReference URI="oracle/wss_username_token_client_policy" orawsp:category="security" orawsp:status="enabled"/> 
     <!-- <property name="oracle.webservices.auth.username">weblogic</property>      --> 
     <!-- <property name="oracle.webservices.auth.password">password</property> --> 
     <property name="oracle.webservices.preemptiveBasicAuth">true</property> 
     <property name="javax.xml.ws.security.auth.username" many="false" override="may">weblogic</property> 
     <property name="javax.xml.ws.security.auth.password" many="false" override="may">password</property> 
    </binding.rest>  
</reference> 
.... 

が、私はjavax.xml.ws.security.auth.特性を持つとoracle.webservices.auth.プロパティでみました。しかし、どちらも失敗しました。リモートでは、要求に基本認証がありません。

HTTP HeaderAuthorizationキーを追加するようにCMProxyRS.wadlを更新しました。例:

<resources> 
    <resource path="/documents"> 
    <method name="GET" soa:wsdlOperation="searchDocument"> 
     <request> 
      <param name="Authorization" style="header" soa:expression="$msg.request/tns:Authorization" default="" type="xsd:string"/> 
      <param name="queryText" style="query" soa:expression="$msg.request/tns:queryText" default="" type="xsd:string"/> 
      <param name="fields" style="query" soa:expression="$msg.request/tns:fields" default="id,name,originalName,originalFormat,originalExtension,alternateFormat,alternateExtension,revision" type="xsd:string"/> 
      <param name="waitForIndexing" style="query" soa:expression="$msg.request/tns:waitForIndexing" default="false" type="xsd:boolean"/> 
     </request> 
     <response status="200"> 
.... 

そして、このAuthorizationはWSDLに「複製」されています。 CMProxyRS.wsdl

<element name="searchDocument_params"> 
    <complexType> 
     <sequence> 
      <element name="Authorization" type="string"/> 
      <element name="queryText" type="string"/> 
      <element name="fields" type="string"/> 
      <element name="waitForIndexing" type="boolean"/> 
     </sequence> 
    </complexType> 
</element> 

これは役に立たなかった。実際、SOAエンジンは、composite.xml(プロパティのusername、password、preemptiveBasicAuth)で追加した内容がRESTリクエストを作成するために使用されているかどうかは実際には分かりません。

(私はそれがユーザー/パスワードの問題がないことを指定したい:私はポストマンから同じユーザー/パスワードを使用してこのRESTクエリをテストするとき、それが正常に動作)

にはどうすれば起動するために管理することができますsoa-compositeからの基本認証付きのRESTサービス?

答えて

0

あなたはOWSMオラクル/ http_jwt_token_client_policyが要求に必要なヘッダを渡すことを試みることができます。

関連する問題