WSO2 AM curl命令添加角色

WSO2 AM curl command to add roles

我正在尝试使用 curl 将角色和用户添加到 carbon。我按照这里的步骤操作:http://soasecurity.org/2013/12/10/user-role-management-with-wso2-identity-server-apis/

这让我能够使用 soapUI 来完成它。但是当我尝试使用 curl 时,我无法让它工作。这是我的 curl 命令:

curl -k --basic -u "admin:admin" --header "Content-Type: text/xml;charset=UTF-8" --data @soaprole.xml https://localhost:9443/services/RemoteUserStoreManagerService.RemoteUserStoreManagerServiceHttpsSoap11Endpoint

我收到以下错误:

<faultstring>The endpoint reference (EPR) for the Operation not found is https://localhost:9443/services/RemoteUserStoreManagerService.RemoteUserStoreManagerServiceHttpsSoap11Endpoint and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</faultstring>

这是我的 xml 文件:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.um.carbon.wso2.org" xmlns:xsd="http://dao.service.ws.um.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:addRole>
<ser:roleName>creator</ser:roleName>
<ser:permissions>
<xsd:action>ui.execute</xsd:action>
 <xsd:resourceId>/permission/admin/Manage/API</xsd:resourceId>
     </ser:permissions>
     <ser:permissions>
        <xsd:action>ui.execute</xsd:action>
        <xsd:resourceId>/permission/admin/login</xsd:resourceId>
     </ser:permissions>
  </ser:addRole>
</soapenv:Body>
</soapenv:Envelope>

我错过了什么?

您可以访问 RemoteUserStoreManagerService 吗?确保在 carbon.xml 启用 <hideadminservicewsdl> 选项,并尝试从浏览器访问上述服务的 wsdl。

例如:https://localhost:9443/services/RemoteUserStoreManagerService?wsdl 应该显示管理服务 wsdl。

我的 curl 命令中有一个拼写错误导致了这个问题。这就是我现在正在使用的并且它正在工作:

curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -k --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:urn:addRole" -d @soaprole.xml --url https://localhost:9443/services/RemoteUserStoreManagerService.RemoteUserStoreManagerServiceHttpsSoap11Endpoint