2016-08-22 9 views
0

WSO2 API-Mをインストールしてユーザーの役割を更新しようとしました。WSO2:Webサービス経由でユーザーの役割を更新する

マイリクエストボディ:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.axis2/xsd"> 
    <soap:Header/> 
    <soap:Body> 
     <xsd:addRemoveRolesOfUser> 
     <!--Optional:--> 
     <xsd:userName>tom</xsd:userName> 
     <!--Zero or more repetitions:--> 
     <xsd:newRoles>internal/subscriber</xsd:newRoles> 
     <!--Zero or more repetitions:--> 
     <xsd:deletedRoles>admin</xsd:deletedRoles> 
     </xsd:addRemoveRolesOfUser> 
    </soap:Body> 
</soap:Envelope> 

私の応答:

<?xml version='1.0' encoding='UTF-8'?> 
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> 
    <soapenv:Body> 
     <soapenv:Fault> 
      <soapenv:Code> 
       <soapenv:Value>soapenv:Receiver</soapenv:Value> 
      </soapenv:Code> 
      <soapenv:Reason> 
       <soapenv:Text xml:lang="en-US">Error occurred while getting 
        database type from DB connection</soapenv:Text> 
      </soapenv:Reason> 
      <soapenv:Detail /> 
     </soapenv:Fault> 
    </soapenv:Body> 
</soapenv:Envelope> 

私は唯一の役割は大丈夫です削除しようとするが、新しいロールを追加することはできません。

何が起こったのか知っていますか?

2016年8月23日更新:

updateRolesOfUserの要求:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.axis2/xsd"> 
    <soap:Header/> 
    <soap:Body> 
     <xsd:updateRolesOfUser> 
     <!--Optional:--> 
     <xsd:userName>?</xsd:userName> 
     <!--Zero or more repetitions:--> 
     <xsd:newRoleList>?</xsd:newRoleList> 
     </xsd:updateRolesOfUser> 
    </soap:Body> 
</soap:Envelope> 

おかげ

トム

答えて

1

これは、あなたが成功/更新を追加するためにリクエストを送信する方法です/削除ユーザーの役割のみに

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <xsd:addRemoveRolesOfUser> 
     <!--Optional:--> 
     <xsd:userName>Tom</xsd:userName> 
     <!--Zero or more repetitions:--> 
     <xsd:newRoles>admin</xsd:newRoles> 
     <!--Zero or more repetitions:--> 
     <xsd:deletedRoles>test</xsd:deletedRoles>  
     </xsd:addRemoveRolesOfUser> 
    </soapenv:Body> 
</soapenv:Envelope> 

を新しい役割(deletedRoles要素を削除)を追加:新しいロールを更新するには

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <xsd:addRemoveRolesOfUser> 
     <!--Optional:--> 
     <xsd:userName>Tom</xsd:userName> 
     <!--Zero or more repetitions:--> 
     <xsd:newRoles>admin</xsd:newRoles>  
     </xsd:addRemoveRolesOfUser> 
    </soapenv:Body> 
</soapenv:Envelope> 

を:同じ応じて役割を追加および削除するには

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <xsd:updateRolesOfUser> 
     <!--Optional:--> 
     <xsd:userName>Tom</xsd:userName> 
     <!--Zero or more repetitions:--> 
     <xsd:newRoleList>test</xsd:newRoleList> 
     <xsd:newRoleList>admin</xsd:newRoleList> 
     <xsd:newRoleList>Internal/subscriber</xsd:newRoleList> 
     </xsd:updateRolesOfUser> 
    </soapenv:Body> 
</soapenv:Envelope> 

注:0以上の繰り返しがある場合は、値を渡さない場合は要素全体を削除してください。

+0

ありがとうございます。 updateRolesOfUserを試してみてください。私は上記に投稿します。エラーは同じです。ありがとうございます。 –

+0

試したupdateRolesOfUser。新しい役割リストに1つの役割だけが追加されている場合に機能します。私はあなたの正確な要件を知っていますか? – Dilini

+0

私の要件は次のとおりです。管理者は、WebサービスAPIを介してユーザーの役割を変更できます。私のAPI-Mバージョンは1.10.0です。私はupdateRolesOfUserを試しましたが、失敗してしまいました。私はaddRemoveRolesOfUserを試してみました...失敗しました。 –

関連する問題