Web Service Import Sets use the same security mechanisms as SOAP Web
Services.
Basic authentication requires a Web Service user provide a valid user name and
password.
Contextual security requires a Web Service user meet the access control rule of the queried
table.
If your instance uses high security settings, the Web Service user may also need the
soap role.
Web service import sets related links
When displaying a mapped web service table, you have the following related links.
Import Sets — The import sets related to this web service import set.
Transform Maps — A list of transform maps related to this web service.
Transform History — The transformation history.
Edit Web Service — Edit the web service.
The following image shows a record that was inserted into the web service import set
Notification. The target record is the resulting creation or modification to the Incident table
record as a result of the transform.Figure 1. Soap Notification
Web service import sets example
This example demonstrates the WSDL, SOAP envelope and response, Perl invocation, and result of
a SOAP web service import.
<?xmlversion="1.0"encoding="UTF-8"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><insertResponse><sys_id>b54aafbfc0a8006f0058db95daa5b88d</sys_id><table>incident</table><display_name>number</display_name><display_value>INC10008</display_value><status>ignored</status><status_message>No field values changed</status_message></insertResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
Example Invocation using Perl
The following example script uses the Notification web service to create an
Incident as the itil user. It uses the Perl language
and the SOAP::Lite
package.
#!/usr/bin/perl -w
#use SOAP::Lite ( +trace => all, maptype => {} );use SOAP::Lite;
sub SOAP::Transport::HTTP::Client::get_basic_credentials{return'itil'=>'itil';// set basic auth credentials for the itil user
}
my$soap= SOAP::Lite->proxy('http://localhost:8080/glide/imp_notification.do?SOAP');
my$method= SOAP::Data->name('insert')->;attr({xmlns =>'http://www.service-now.com/'});
# insert into the web servicemy@params=( SOAP::Data->name(message =>'problem detected for database DB12DG'));push(@params, SOAP::Data->name(source =>'DB12DG'));push(@params, SOAP::Data->name(uuid =>'HGAF76251HGF2'));
my$result=$soap->call($method=>@params);
print_fault($result);//print any SOAP faults
print_result($result);//print any results
sub print_result {my($result)=@_;if($result->body&&$result->body->{'insertResponse'}){my%keyHash=%{$result->body->{'insertResponse'}};foreachmy$k(keys%keyHash){print"name=$k value=$keyHash{$k}\n";}}}
sub print_fault {my($result)=@_;if($result->fault){print"faultcode=".$result->fault->{'faultcode'}."\n";print"faultstring=".$result->fault->{'faultstring'}."\n";print"detail=".$result->fault->{'detail'}."\n";}}
The following is the result printed by the Perl script on the
console.
We use cookies on this site to improve your browsing experience, analyze individualized usage and website traffic, tailor content to your preferences, and make your interactions with our website more meaningful. To learn more about the cookies we use and how you can change your preferences, please read our Cookie Policy and visit our Cookie Preference Manager. By clicking “Accept and Proceed,” closing this banner or continuing to browse this site, you consent to the use of cookies.
<?xmlversion="1.0"encoding="UTF-8"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><insertResponse><sys_id>b54aafbfc0a8006f0058db95daa5b88d</sys_id><table>incident</table><display_name>number</display_name><display_value>INC10008</display_value><status>ignored</status><status_message>No field values changed</status_message></insertResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
How was this response?
Code explanation using AI
Explain this code
#!/usr/bin/perl -w
#use SOAP::Lite ( +trace => all, maptype => {} );use SOAP::Lite;
sub SOAP::Transport::HTTP::Client::get_basic_credentials{return'itil'=>'itil';// set basic auth credentials for the itil user
}
my$soap= SOAP::Lite->proxy('http://localhost:8080/glide/imp_notification.do?SOAP');
my$method= SOAP::Data->name('insert')->;attr({xmlns =>'http://www.service-now.com/'});
# insert into the web servicemy@params=( SOAP::Data->name(message =>'problem detected for database DB12DG'));push(@params, SOAP::Data->name(source =>'DB12DG'));push(@params, SOAP::Data->name(uuid =>'HGAF76251HGF2'));
my$result=$soap->call($method=>@params);
print_fault($result);//print any SOAP faults
print_result($result);//print any results
sub print_result {my($result)=@_;if($result->body&&$result->body->{'insertResponse'}){my%keyHash=%{$result->body->{'insertResponse'}};foreachmy$k(keys%keyHash){print"name=$k value=$keyHash{$k}\n";}}}
sub print_fault {my($result)=@_;if($result->fault){print"faultcode=".$result->fault->{'faultcode'}."\n";print"faultstring=".$result->fault->{'faultstring'}."\n";print"detail=".$result->fault->{'detail'}."\n";}}