{"id":304,"date":"2013-06-18T13:38:40","date_gmt":"2013-06-18T20:38:40","guid":{"rendered":"http:\/\/www.ossintegrators.com\/blog\/?p=304"},"modified":"2013-06-19T11:46:42","modified_gmt":"2013-06-19T18:46:42","slug":"working-with-impact-web-services-an-introduction","status":"publish","type":"post","link":"http:\/\/www.ossintegrators.com\/blog\/working-with-impact-web-services-an-introduction\/","title":{"rendered":"Working with Impact Web Services \u2013 an Introduction"},"content":{"rendered":"<div style=\"padding-bottom:20px; padding-top:10px;\" class=\"hupso-share-buttons\"><!-- Hupso Share Buttons - http:\/\/www.hupso.com\/share\/ --><a class=\"hupso_toolbar\" href=\"http:\/\/www.hupso.com\/share\/\"><img decoding=\"async\" src=\"http:\/\/static.hupso.com\/share\/buttons\/share-small.png\" border=\"0\" style=\"padding-top:5px; float:left;\" alt=\"Share\"\/><\/a><script type=\"text\/javascript\">var hupso_services_t=new Array(\"Twitter\",\"Facebook\",\"Google Plus\",\"Linkedin\",\"Digg\",\"Reddit\");var hupso_toolbar_size_t=\"small\";var hupso_counters_lang = \"en_US\";var hupso_url_t=\"\";var hupso_title_t=\"Working with Impact Web Services \u2013 an Introduction\";<\/script><script type=\"text\/javascript\" src=\"http:\/\/static.hupso.com\/share\/js\/share_toolbar.js\"><\/script><!-- Hupso Share Buttons --><\/div><p>&nbsp;<\/p>\n<p>In this post I will be going through how to use Impact Web Services with a real example showing how to create an impact policy that uses Web Services to connect and retrieve information from an external system. To begin we need a WSDL file. Here is a sample WSDL file for getting a weather forecast: <a href=\"http:\/\/www.webservicex.net\/weatherforecast.asmx?wsdl\">http:\/\/www.webservicex.net\/weatherforecast.asmx?wsdl<\/a><br \/>\n<!--more--><\/p>\n<h2>Creating the Policy<\/h2>\n<p>Here are the steps to create a policy that uses the above WSDL file and retrieve the weather information.<\/p>\n<p>In Impact 5.1.1, launch by clicking on Web Services wizard.<\/p>\n<p>In Impact 6.1, in the TIP URL click on the System Configuration-&gt;Event Automation-&gt; Policies-&gt; drop-down menu of the Create New Policy-&gt;Use Wizard-&gt;Web Services<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services Wizard\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith1.png\" width=\"542\" height=\"433\" \/><span style=\"font-size: 10pt;\"><br \/>\n<\/span><\/p>\n<p>Name your policy and click &#8220;Next&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services WSDL Screen\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith2.png\" width=\"542\" height=\"433\" \/><span style=\"font-size: 10pt;\"><br \/>\n<\/span><\/p>\n<p>Specify the URL for the WSDL file or if it is saved on your local disk then specify the path on the local disk<\/p>\n<p>Select the compiled jar file if the WSDL is already compiled or give the name to the jar file and Impact will compile and create the Jar file. To create the Jar file for the given WSDL in advance use the following command (creates the &#8220;.jar&#8221; file in $IMPACT_HOME\/wslib\/):<\/p>\n<pre><code>$IMPACT_HOME\/bin\/nci_compilewsdl &lt;wsdl URL&gt;\r\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services Wizard General Info\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith3.png\" width=\"542\" height=\"433\" \/><span style=\"font-size: 10pt;\"><br \/>\n<\/span><\/p>\n<p>Once you provide the Jar file and the WSDL location, Impact compiles the WSDL file and reads all the classes, methods available in the WSDL\/jar file. Select which method or function you want your policy to use to request the data. In this Example, the weather WSDL file has two different methods &#8211; <em>GetWeatherByZipCode<\/em> and <em>GetWeatherByPlaceName<\/em>. We&#8217;ll use the zip code method.<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services Wizard Parameters\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith4.png\" width=\"542\" height=\"433\" \/><span style=\"font-size: 10pt;\"><br \/>\n<\/span><\/p>\n<p>The method we selected needs an input parameter i.e. we need to provide the Zip code for which we are requesting weather info.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services Wizard Endpoint Screen\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith5.png\" width=\"542\" height=\"433\" \/><span style=\"font-size: 10pt;\"><br \/>\n<\/span><br \/>\nImpact automatically reads the End point URL from the WSDL file (shown in the picture with an &#8220;.asmx&#8221; extension).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services Wizard End Screen\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith6.png\" width=\"542\" height=\"433\" \/><span style=\"font-size: 10pt;\"><br \/>\n<\/span><\/p>\n<p>The above steps will create a policy as shown below and then you can modify the policy as per your needs!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services Wizard Policy Source Code\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith7.png\" width=\"624\" height=\"273\" \/><\/p>\n<h2><em>Usage<br \/>\n<\/em><\/h2>\n<p>From the above web service call, we get the weather information for the given zip code (the Classof() function determines the type of information returned if it is String type or Object type).<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services Calling Example 1\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith8.png\" width=\"624\" height=\"50\" \/><\/p>\n<p>If you just want to extract a particular attribute from the weather forecast, here is the example on retrieving temperature from the weather information retrieved:<em><br \/>\n<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Netcool Impact Web Services Calling Example\" src=\"http:\/\/www.ossintegrators.com\/blog\/wp-content\/uploads\/2013\/06\/061813_2038_Workingwith9.png\" width=\"624\" height=\"29\" \/><\/p>\n<p>I will be adding more examples on Web Services and how to extract the data from complicated WSDL files in the upcoming posts.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div style=\"padding-bottom:20px; padding-top:10px;\" class=\"hupso-share-buttons\"><!-- Hupso Share Buttons - http:\/\/www.hupso.com\/share\/ --><a class=\"hupso_toolbar\" href=\"http:\/\/www.hupso.com\/share\/\"><img src=\"http:\/\/static.hupso.com\/share\/buttons\/share-small.png\" border=\"0\" style=\"padding-top:5px; float:left;\" alt=\"Share\"\/><\/a><script type=\"text\/javascript\">var hupso_services_t=new Array(\"Twitter\",\"Facebook\",\"Google Plus\",\"Linkedin\",\"Digg\",\"Reddit\");var hupso_toolbar_size_t=\"small\";var hupso_counters_lang = \"en_US\";var hupso_url_t=\"\";var hupso_title_t=\"Working with Impact Web Services \u2013 an Introduction\";<\/script><script type=\"text\/javascript\" src=\"http:\/\/static.hupso.com\/share\/js\/share_toolbar.js\"><\/script><!-- Hupso Share Buttons --><\/div><p>&nbsp; In this post I will be going through how to use Impact Web Services with a real example showing how to create an impact policy that uses Web Services to connect and retrieve information from an external system. To begin we need a WSDL file. Here is a sample WSDL file for getting a [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[7],"tags":[34,54,28,35,37,36],"class_list":["post-304","post","type-post","status-publish","format-standard","hentry","category-netcool","tag-impact","tag-netcool","tag-netcool-impact","tag-web-services","tag-web-services-dsa","tag-wsdl"],"_links":{"self":[{"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/posts\/304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/comments?post=304"}],"version-history":[{"count":7,"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/posts\/304\/revisions"}],"predecessor-version":[{"id":312,"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/posts\/304\/revisions\/312"}],"wp:attachment":[{"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/media?parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/categories?post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ossintegrators.com\/blog\/wp-json\/wp\/v2\/tags?post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}