Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Getting 415-Unsupported Media Type error for GRC SOAP connector

AAR
New Contributor III
New Contributor III

 

 

Hi Team,

 

When we try to process the create account task for SAP GRC using the SOAP, getting the error saying 415-Unsupported Media Type.

Error:

2024-05-17T14:27:41+05:30-ecm-provisoning.SoapProvisioningService-http-nio-8080-exec-530-mhgwm-ERROR-Error in connecting to webservice: https://XXXXXXXXXXXXXXX:XXXX/sap/bc/srt/rfc/sap/grac_user_acces_ws/300/grd_user_acces_ws/grd_user_ac... - Response Code: 415, Response Message: Unsupported Media Type

Connections tried with:

1.

{
"authentications": {
"login": {
"properties": {
"SOAP_ENDPOINT": "https://XXXXXXXXXXXX:XXX/sap/bc/srt/rfc/sap/grac_user_acces_ws/300/grd_user_acces_ws/grd_user_acces_...",
"USERNAME": "XXX",
"PASSWORD": "************"
}
},
"ticketlogin": {
"properties": {
"SOAP_ENDPOINT": "https://XXXXXXXXXXXX:XXX/sap/bc/srt/rfc/sap/grac_request_status_ws/300/grd_request_status_ws/grd_req...",
"USERNAME": "XXX",
"PASSWORD": "************"
}
}
}
}

===========================================================

2.

{
"authentications": {
"login": {
"properties": {
"SOAP_ENDPOINT": "https://XXXXXXXXXXXX:XXX/sap/bc/srt/rfc/sap/grac_user_acces_ws/300/grd_user_acces_ws/grd_user_acces_...",
"USERNAME": "XXX",
"PASSWORD": "************",
"CONTENT-TYPE": "application/xml; charset=utf-8"
}
},
"ticketlogin": {
"properties": {
"SOAP_ENDPOINT": "https://XXXXXXXXXXXX:XXX/sap/bc/srt/rfc/sap/grac_request_status_ws/300/grd_request_status_ws/grd_req...",
"USERNAME": "XXX",
"PASSWORD": "************",
"CONTENT-TYPE": "application/xml; charset=utf-8"
}
}
}
}

 

Payloads tried with:

1. 

 

[
 
  {
 
    "CONNECTION": "login",
 
    "REQUESTXML": "<soapenv:Envelope
xmlns:urn=\"urn:sap-com:document:sap:soap:functions:mc-style\">
<soapenv:Header></soapenv:Header>
<soapenv:Body>
<urn:GracIdmUsrAccsReqServices>
            <RequestHeaderData>
                <Reqtype>001</Reqtype>
                <Priority>009</Priority>
                <ReqInitSystem>GRDCLNT300</ReqInitSystem>
                <Requestorid>${if(task?.requestKey.equals(null)){'I_SAVIYNT'} else {com.saviynt.ecm.identitywarehouse.domain.Users.get(task?.requestedBy).systemUserName}}</Requestorid>
                <RequestReason>SIGA REQUEST ID- ${if(task?.requestKey.equals(null)){'BIRTHRIGHT'} else{task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.') + 1, task.requestKey?.processinstanceid?.length())}}</RequestReason>
            </RequestHeaderData>
<RequestedLineItem>${String rolesStrSys  = '';String startDate=new java.text.SimpleDateFormat('yyyyMMdd').format(user.startdate);String endDate=new java.text.SimpleDateFormat('yyyyMMdd').format(user.enddate);List lstItemName = ['GRDCLNT300'];int size = lstItemName.size();int i = 0;for (String ItemId : lstItemName){rolesStrSys=rolesStrSys+'
<item>
<Connector>'+ItemId+'</Connector>
<ProvItemType>SYS</ProvItemType>
<ItemName>'+ItemId+'</ItemName>
<ProvAction>001</ProvAction>
<ValidFrom>'+startDate+'</ValidFrom>
<ValidTo>'+endDate+'</ValidTo>
</item>';i++;if(i == size){return rolesStrSys;}}}${String rolesStr = '';for (def task : entTaskSet) {String startDate=task?.requestKey != null ? new java.text.SimpleDateFormat('yyyyMMdd').format(task?.startDate) : '';String endDate=task?.requestKey != null ? new java.text.SimpleDateFormat('yyyyMMdd').format(task?.endDate) : '';String comnts = task?.requestKey !=null ? task?.requestKey?.request_accesss?.comments?.get(0) : 'X';String ent = task.entitlement_valueKey.entitlement_value;String tempEnt = ent.indexOf('&') > 0 ? ent.substring(0, ent.indexOf('&') + 1).toUpperCase().concat('amp;').concat(ent.substring(ent.indexOf('&')+1).toUpperCase()) : ent.toUpperCase();
rolesStr=rolesStr+'
<item>
<ProvItemType>ROL</ProvItemType>
<ProvType>SYS</ProvType>
<ItemName>'+tempEnt+'</ItemName>
<ProvAction>006</ProvAction>
<RoleType>BUS</RoleType>
<ValidFrom>'+startDate+'</ValidFrom>
<ValidTo>'+endDate+'</ValidTo>
<Comments>'+comnts+'</Comments>
</item>';};return rolesStr;}
</RequestedLineItem>
<UserGroup>${String groups  = '';List lstItemName = ['GRDCLNT300'];String groupSelected='SIGA';int size = lstItemName.size();int i = 0;for (String ItemId : lstItemName){groups=groups+'
<item>
<UserGroup>'+groupSelected+'</UserGroup>
<UserGroupDesc>'+ItemId+'</UserGroupDesc>
</item>';i++;if(i == size){return groups;}}}
</UserGroup>
<UserInfo>
<item>
<Userid>${(task.accountName.toUpperCase())}</Userid>
<ValidFrom>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.startdate)}</ValidFrom>
<ValidTo>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.enddate)}</ValidTo>
<Fname>${user.firstname}</Fname>
<Lname>${user.lastname}</Lname>
<SncName>p:${user.customproperty60}@domain.com</SncName>
<Email>${user.email}</Email>
<Printer></Printer>
<CommMethod>INT</CommMethod>
<LogonLang>EN</LogonLang>
<DateFormat>5</DateFormat>
<UserType>A</UserType>
</item>
</UserInfo>
        </urn:GracIdmUsrAccsReqServices>
    </soap:Body>
</soap:Envelope>","RESPONSEMAPPING": {
 
      "task.provisioningcomments": "Body.GracIdmUsrAccsReqServicesResponse.MsgReturn.MsgStatement",
 
      "TASK.TICKETID": "Body.GracIdmUsrAccsReqServicesResponse.RequestNo",
 
      "SUCCESSMSG": "Body.GracIdmUsrAccsReqServicesResponse.MsgReturn.MsgType"
 
    },"SUCCESSCRITERIA": "SUCCESSMSG=SUCCESS","REQUESTPARAMS": {
 
      "Content-Type": "text/xml;charset=UTF-8",
 
      "SOAPAction ": "urn:sap-com:document:sap:soap:functions:mc-style:GRAC_USER_ACCES_WS:GracIdmUsrAccsReqServicesRequest"
 
    }
 
  }
 
]

 

2.

 
[
  {
    "CONNECTION": "login",
    "REQUESTXML": "<soapenv:Envelope
xmlns:urn=\"urn:sap-com:document:sap:soap:functions:mc-style\">
<soapenv:Header></soapenv:Header>
<soapenv:Body>
<urn:GracIdmUsrAccsReqServices>
            <RequestHeaderData>
                <Reqtype>001</Reqtype>
                <Priority>009</Priority>
                <ReqInitSystem>GRDCLNT300</ReqInitSystem>
                <Requestorid>I_SAVIYNT</Requestorid>
                <RequestReason>TEST</RequestReason>
            </RequestHeaderData>
            <RequestedLineItem>
<item>
<Connector>GRDCLNT300</Connector>
<ProvItemType>SYS</ProvItemType>
<ItemName>GRDCLNT300</ItemName>
<ProvAction>001</ProvAction>
<ValidFrom>20160215</ValidFrom>
<ValidTo>99991231</ValidTo>
</item>
                <item>
                    <ItemName>${task.entitlement_valueKey.entitlement_value}</ItemName>
                    <Connector>GRDCLNT300</Connector>
                    <ProvItemType>ROL</ProvItemType>
                    <ValidFrom>20160215</ValidFrom>
                    <ValidTo>99991231</ValidTo>
                    <Comments>X</Comments>
                    <ProvAction>006</ProvAction>
                    <RoleType>SIN</RoleType>
                </item>
            </RequestedLineItem>
            <UserGroup>
                <item>
                    <UserGroup>SIGA</UserGroup>
                    <UserGroupDesc>SIGA</UserGroupDesc>
                </item>
            </UserGroup>
            <UserInfo>
                <item>
                    <Userid>${(task.accountName.toUpperCase())}</Userid>
<ValidFrom>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.startdate)}</ValidFrom>
<ValidTo>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.enddate)}</ValidTo>
<Fname>${user.firstname}</Fname>
<Lname>${user.lastname}</Lname>
<SncName>p:${user.customproperty60}@domain.com</SncName>
<Email>${user.email}</Email>
<Printer></Printer>
<CommMethod>INT</CommMethod>
<LogonLang>EN</LogonLang>
<DateFormat>5</DateFormat>
<UserType>A</UserType>
                </item>
            </UserInfo>
        </urn:GracIdmUsrAccsReqServices>
    </soap:Body>
</soap:Envelope>",
    "RESPONSEMAPPING": {
      "task.provisioningcomments": "Body.GracIdmUsrAccsReqServicesResponse.MsgReturn.MsgStatement",
      "TASK.TICKETID": "Body.GracIdmUsrAccsReqServicesResponse.RequestNo",
      "SUCCESSMSG": "Body.GracIdmUsrAccsReqServicesResponse.MsgReturn.MsgType"
    },
    "SUCCESSCRITERIA": "SUCCESSMSG=SUCCESS",
    "REQUESTPARAMS": {
      "Content-Type": "text/xml;charset=UTF-8",
      "SOAPAction ": "urn:sap-com:document:sap:soap:functions:mc-style:GRAC_USER_ACCES_WS:GracIdmUsrAccsReqServicesRequest"
    }
  }
]
 
---------------------------------------------------------------
 
3.
 
[
  {
    "CONNECTION": "login",
    "REQUESTXML": "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
    <soap:Header>
        <wsse:Security soap:mustUnderstand=\"1\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\"/>
    </soap:Header>
    <soap:Body>
        <n0:GracIdmUsrAccsReqServices xmlns:n0=\"urn:sap-com:document:sap:soap:functions:mc-style\">
            <RequestHeaderData>
                <Reqtype>001</Reqtype>
                <Priority>009</Priority>
                <ReqInitSystem>GRDCLNT300</ReqInitSystem>
                <Requestorid>I_SAVIYNT</Requestorid>
                <RequestReason>TEST</RequestReason>
            </RequestHeaderData>
            <RequestedLineItem>
<item>
<Connector>GRDCLNT300</Connector>
<ProvItemType>SYS</ProvItemType>
<ItemName>GRDCLNT300</ItemName>
<ProvAction>001</ProvAction>
<ValidFrom>20160215</ValidFrom>
<ValidTo>99991231</ValidTo>
</item>
                <item>
                    <ItemName>${task.entitlement_valueKey.entitlement_value}</ItemName>
                    <Connector>GRDCLNT300</Connector>
                    <ProvItemType>ROL</ProvItemType>
                    <ValidFrom>20160215</ValidFrom>
                    <ValidTo>99991231</ValidTo>
                    <Comments>X</Comments>
                    <ProvAction>006</ProvAction>
                    <RoleType>SIN</RoleType>
                </item>
            </RequestedLineItem>
            <UserGroup>
                <item>
                    <UserGroup>SIGA</UserGroup>
                    <UserGroupDesc>SIGA</UserGroupDesc>
                </item>
            </UserGroup>
            <UserInfo>
                <item>
                    <Userid>${(task.accountName.toUpperCase())}</Userid>
<ValidFrom>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.startdate)}</ValidFrom>
<ValidTo>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.enddate)}</ValidTo>
<Fname>${user.firstname}</Fname>
<Lname>${user.lastname}</Lname>
<SncName>p:${user.customproperty60}@domain.com</SncName>
<Email>${user.email}</Email>
<Printer></Printer>
<CommMethod>INT</CommMethod>
<LogonLang>EN</LogonLang>
<DateFormat>5</DateFormat>
<UserType>A</UserType>
                </item>
            </UserInfo>
        </n0:GracIdmUsrAccsReqServices>
    </soap:Body>
</soap:Envelope>",
    "RESPONSEMAPPING": {
      "task.provisioningcomments": "Body.GracIdmUsrAccsReqServicesResponse.MsgReturn.MsgStatement",
      "TASK.TICKETID": "Body.GracIdmUsrAccsReqServicesResponse.RequestNo",
      "SUCCESSMSG": "Body.GracIdmUsrAccsReqServicesResponse.MsgReturn.MsgType"
    },
    "SUCCESSCRITERIA": "SUCCESSMSG=SUCCESS",
    "REQUESTPARAMS": {
      "Content-Type": "text/xml;charset=UTF-8",
      "SOAPAction ": "urn:sap-com:document:sap:soap:functions:mc-style:GRAC_USER_ACCES_WS:GracIdmUsrAccsReqServicesRequest"
    }
  }
]

==============================================

 

SOAP_OR_XML: tried with both SOAP and XML, but no luck.

Content-Type's tried: 

1. "text/xml;charset=UTF-8"

2. "application/xml;charset=UTF-8"

3. "text/xml;charset=UTF-8"

4. "application/soap+xml;charset=UTF-8"

 

We have tried with postman, and it is working fine without any issue.

Sample Payload tried in postman:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

    <soap:Header>

        <wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>

    </soap:Header>

    <soap:Body>

        <n0:GracIdmUsrAccsReqServices xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">

            <RequestHeaderData>

                <Reqtype>002</Reqtype>

                <Priority>009</Priority>

                <ReqInitSystem>GRDCLNT300</ReqInitSystem>

                <Requestorid>I_SAVIYNT</Requestorid>

                <RequestReason>TEST</RequestReason>

            </RequestHeaderData>

            <RequestedLineItem>

                <item>

                    <ItemName>GDQYMENUXXSTSTEA</ItemName>

                    <Connector>GRDCLNT300</Connector>

                    <ProvItemType>ROL</ProvItemType>

                    <ValidFrom>20160215</ValidFrom>

                    <ValidTo>99991231</ValidTo>

                    <Comments>X</Comments>

                    <ProvAction>006</ProvAction>

                    <RoleType>SIN</RoleType>

                </item>

            </RequestedLineItem>

            <UserGroup>

                <item>

                    <UserGroup>SIGA</UserGroup>

                    <UserGroupDesc>SIGA</UserGroupDesc>

                </item>

            </UserGroup>

            <UserInfo>

                <item>

                    <Userid>Z_TEST</Userid>

                    <Fname>SIGA</Fname>

                    <Lname>TEST</Lname>

                    <Email>SIGA_TEST@domain.com</Email>

                </item>

            </UserInfo>

        </n0:GracIdmUsrAccsReqServices>

    </soap:Body>

</soap:Envelope>

 

Can someone let me know what the issue could be here?

 

Thanks,

Anush

 

 

 

14 REPLIES 14

Raghu
Honored Contributor
Honored Contributor

@AAR  try below same as small letters:

Content-Type: text/xml; charset=utf-8

or

Content-Type: application/soap+xml; charset=utf-8

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

rushikeshvartak
All-Star
All-Star

Refer https://forums.saviynt.com/t5/saviynt-knowledge-base/using-saviynt-as-a-ticketing-system-for-sap-grc...


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

AAR
New Contributor III
New Contributor III

Hi @Raghu  & @rushikeshvartak ,

 

We have gone through the links and also tried with the suggested content types, however it is still giving the same error.

Does it works from postman?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

AAR
New Contributor III
New Contributor III

Hi @rushikeshvartak ,

Yes, it is working only when the content type is set as text/xml; charset=utf-8 in any case.

AAR_0-1716212843546.png

 

for other types it is giving the 415 or 500 error.

 

Thanks,

Anush

 

 

 

Please share postman  curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]


⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

AAR
New Contributor III
New Contributor III

Hi @rushikeshvartak ,

Please find the Curl command:

curl --location 'https://xxxxxxxxxx:xxxx/sap/bc/srt/rfc/sap/grac_user_acces_ws/xxx/grd_user_acces_ws/grd_user_acces_ws ' \
--header 'Content-Type: text/xml; charset=utf-8' \
--header 'SOAPAction: urn:sap-com:document:sap:soap:functions:mc-style:GRAC_USER_ACCES_WS:GracIdmUsrAccsReqServicesRequest' \
--header 'Authorization: ••••••' \
--header 'Cookie: sap-usercontext=sap-client=300' \
--data-raw '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
</soap:Header>
<soap:Body>
<n0:GracIdmUsrAccsReqServices xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
<RequestHeaderData>
<Reqtype>001</Reqtype>
<Priority>009</Priority>
<ReqInitSystem>xxxxxx</ReqInitSystem>
<Requestorid>I_SAVIYNT</Requestorid>
<RequestReason>TEST</RequestReason>
</RequestHeaderData>
<RequestedLineItem>
<item>
<ItemName>xxxxxx</ItemName>
<Connector>xxxxxx</Connector>
<ProvItemType>SYS</ProvItemType>
<ValidFrom>20160215</ValidFrom>
<ValidTo>99991231</ValidTo>
<ProvAction>001</ProvAction>
</item>
<item>
<ItemName>GDQYMENUXXSTSTEA</ItemName>
<Connector>xxxxxx</Connector>
<ProvItemType>ROL</ProvItemType>
<ValidFrom>20160215</ValidFrom>
<ValidTo>99991231</ValidTo>
<Comments>X</Comments>
<ProvAction>006</ProvAction>
<RoleType>SIN</RoleType>
</item>
</RequestedLineItem>
<UserGroup>
<item>
<UserGroup>SIGA</UserGroup>
<UserGroupDesc>SIGA</UserGroupDesc>
</item>
</UserGroup>
<UserInfo>
<item>
<Userid>Z_TEST2</Userid>
<Fname>SIGA</Fname>
<Lname>TEST2</Lname>
<Email>SIGA_TEST2@domain.COM</Email>
</item>
</UserInfo>
</n0:GracIdmUsrAccsReqServices>
</soap:Body>
</soap:Envelope>'

[This message has been edited by moderator to mask email]

AAR
New Contributor III
New Contributor III

Hi @rushikeshvartak ,

Is there any way to print or see the prepared final payload being sent to target application in the EIC version logs?

 

Thanks,

Anush

showlogs = true in config jSON in case of REST Connector


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

AAR
New Contributor III
New Contributor III

But in our case, it is SOAP connector.

 

Thanks,

Anush

Dhruv_S
Saviynt Employee
Saviynt Employee

Hi @AAR 

The payload which you are passing has lot of binding variables and customized code. It seems that some of the binding variable might not be evaluating. Please test with a simple payload with hardcoded values similar to what you have tried in the postman or bare minimum values. Also keep the content-Type exactly same as working sample of the postman.

Regards,

Dhruv Sharma

AAR
New Contributor III
New Contributor III

Hi All,

 

Issue got resolved after I keep the payload (with binding variables) in a single line and removing all spaces in it with the Content-Type: text/xml; charset=utf-8

 

Thanks,

Anush

Can you share working configs


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

AAR
New Contributor III
New Contributor III

Please find below:

[
{
"CONNECTION": "login",
"REQUESTXML": "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header></soap:Header><soap:Body><n0:GracIdmUsrAccsReqServices xmlns:n0=\"urn:sap-com:document:sap:soap:functions:mc-style\"><RequestHeaderData><Reqtype>001</Reqtype><Priority>009</Priority><ReqInitSystem>XXXXXXXX</ReqInitSystem><Requestorid>I_SAVIYNT</Requestorid><RequestReason>SIGA GRC TEST</RequestReason></RequestHeaderData><RequestedLineItem><item><ItemName>XXXXXXXX</ItemName><Connector>XXXXXXXX</Connector><ProvItemType>SYS</ProvItemType><ValidFrom>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.startdate)}</ValidFrom><ValidTo>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.enddate)}</ValidTo><ProvAction>001</ProvAction></item><item><ItemName>GDQYMENUXXSTSTEA</ItemName><Connector>XXXXXXXX</Connector><ProvItemType>ROL</ProvItemType><ValidFrom>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.startdate)}</ValidFrom><ValidTo>${new java.text.SimpleDateFormat('yyyyMMdd').format(user.enddate)}</ValidTo><Comments>X</Comments><ProvAction>006</ProvAction><RoleType>SIN</RoleType></item></RequestedLineItem><UserGroup><item><UserGroup>SIGA</UserGroup><UserGroupDesc>SIGA</UserGroupDesc></item></UserGroup><UserInfo><item><Userid>${(task.accountName.toUpperCase())}</Userid><Fname>${user.firstname}</Fname><Lname>${user.lastname}</Lname><Email>${user.customproperty60}@domain.com</Email></item></UserInfo></n0:GracIdmUsrAccsReqServices></soap:Body></soap:Envelope>",
"RESPONSEMAPPING": {
"task.provisioningcomments": "Body.GracIdmUsrAccsReqServicesResponse.MsgReturn.MsgStatement",
"TASK.TICKETID": "Body.GracIdmUsrAccsReqServicesResponse.RequestNo",
"SUCCESSMSG": "Body.GracIdmUsrAccsReqServicesResponse.MsgReturn.MsgType"
},
"SUCCESSCRITERIA": "SUCCESSMSG=SUCCESS",
"REQUESTPARAMS": {
"Content-Type": "text/xml;charset=UTF-8",
"SOAPAction ": "urn:sap-com:document:sap:soap:functions:mc-style:GRAC_USER_ACCES_WS:GracIdmUsrAccsReqServicesRequest"
}
}
]