Scripted SOAP Error : com.glide.processors.soap.SOAPProcessingException: Insufficient rights to invoke script

cc11
Tera Contributor

Hi,

I have a scripted SOAP web service (Inbound). 

When it is invoked with a user having soap roles + web_service_admin role, it throws exception.

com.glide.processors.soap.SOAPProcessingException: Insufficient rights to invoke script

Thank you,

Yogesh

try{
	var gr = new GlideRecord('incident');
	gr.addQuery('sys_id',request.sys_id);
	gr.query();
	while (gr.next()) {
		//update incident work_notes, if present
		if(request.work_notes){
			gr.work_notes = request.work_notes;
		}
		//update incident status
		gr.state = request.status;
		/* Status values:
		New - 1
		In Progress - 2
		On Hold - 3
		Resolved - 6
		Closed - 7
		Canceled - 8 */
		//If resolving or closing, must set close_code & close_notes
		if(request.status === '6' || request.status == '7' ){
			gr.close_code = 'Solved (Parmanently)';
			gr.close_notes = gr.close_notes+'\n'+'Updated by SAP SolMan Web Service.';
		}
		/* hold_reason values:
		Awaiting Caller - 1
		Awaiting Problem - 3
		Awaiting Vendor - 4
		Awaiting Change - 5
 		*/
		//If setting Status to On Hold, must set hold_reason
		if(request.status === '3' ){
			if(!gr.hold_reason){
				gr.hold_reason = 1;
			}
		}
		gr.update();
		response.response = gr.number + ' was updated. If you have access, you may review your changes here > ' + gs.getProperty('glide.servlet.uri')+'nav_to.do?uri='+encodeURIComponent('/'+ gs.generateURL('incident', request.sys_id));
	}
	
}
catch(err){
	response.response = err;
}

 

 

1 ACCEPTED SOLUTION

Yes you are right that soap_script is required. Please close this thread so that it can be helpful for others.

 

Regards

Ujjawal

View solution in original post

4 REPLIES 4

Ujjawal Vishnoi
Mega Sage
Mega Sage

Hi,

 

Create a import set table(create a new table which extends import set row) and then transform data to incident table.

 

Hope this will resolve your issue.

 

Regards

Ujjawal

Thank you Ujjwal,

 

I think I should try that.

I am curious to know if Scripted Web Services work without providing Admin access.

If not, I dont see much use of such a powerful feature.

 

Thank you,

Yogesh

cc11
Tera Contributor

For Scripted Web Service (SOAP), just found out that soap_script role is required.

Working for me.

Reference -

https://docs.servicenow.com/bundle/kingston-application-development/page/integrate/inbound-soap/concept/c_ScriptedWebServices.html

 

Hope this helps someone,

Thank you,

Yogesh

Yes you are right that soap_script is required. Please close this thread so that it can be helpful for others.

 

Regards

Ujjawal