简体   繁体   中英

assigning role in wso2 using admin service

Im trying to assign a role to a user in wso2 using admin service. Below is request stored in setuser.xml. Im using wso2 apim manager 1.10

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://service.ws.um.carbon.wso2.org" xmlns:xsd="http://common.mgt.user.carbon.wso2.org/xsd">
  <soap:Header/>
   <soap:Body>
  <ser:setUserClaimValues>
     <!--Optional:-->
     <ser:userName>test123</ser:userName>

      <ser:claims>
        <!--Optional:-->
        <xsd:claimURI>http://wso2.org/claims/role</xsd:claimURI>
        <!--Optional:-->
        <xsd:value>Internal/publisher</xsd:value>
     </ser:claims>

  </ser:setUserClaimValues>

Above is my post request.Im getting 202 status after executing curl, but role is not added. Could you tell me where im doing wrong.

curl -i -k --header "Content-Type: application/soap+xml" -H "Authorization: 
Basic xxxxxxxxxx" -X POST 
https://xxxxx:9443/services/RemoteUserStoreManagerService -d @setuser.xml
HTTP/1.1 202 Accepted
Set-Cookie: JSESSIONID=83C74EE8FC35CAE7D015FA32803440BE; Path=/; Secure; 
HttpOnly
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked

Date: Wed, 12 Jul 2017 15:03:08 GMT Server: WSO2 Carbon Server

您缺少SOAPAction标头

curl -k -H "Content-Type: application/soap+xml;charset=UTF-8;"  -H "SOAPAction:urn:setUserClaimValues" --basic -u "admin:admin" --data @setuser.xml https://localhost:9443/services/RemoteUserStoreManagerService

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM