Highlighted
Acclaimed Contributor.
Acclaimed Contributor.
4651 views

Send request to IM wsdl through java script..

Jump to solution

Hi All,

 

Check the following Javascript which uses doSOAPRequest():

 

var url = "http://172.25.2.5:13080/SM/7/IncidentManagement.wsdl";
var action = "http://172.25.2.5:13080/SM/7/RetrieveIncident";
var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xmime=\"http://www.w3.org/2005/05/xmlmime\" xmlns:ns=\"http://schemas.hp.com/SM/7\" xmlns:cmn=\"http://schemas.hp.com/SM/7/Common\"><soap:Body><ns:RetrieveIncidentRequest ignoreEmptyElements=\"true\"><ns:model><ns:keys/><ns:instance query=\"\" uniquequery=\"\" recordid=\"\"><ns:IncidentID type=\"\" mandatory=\"\" readonly=\"\">IM10181</ns:IncidentID></ns:instance><ns:messages/></ns:model></ns:RetrieveIncidentRequest></soap:Body></soap:Envelope>";

 //print ("The return value for xml: " + xml);

var uid ="falcon";
var pass ="falcon";
var attachments = new Array();
var quote = doSOAPRequest( url, action, xml, uid, pass, 10, 10, 10, attachments );
print( "The return value is: " + quote );

 

 

but it's not working i guess error with XML parsing kindly advice.

 

Kinldy advice on this..

 

re,

abhijit

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Send request to IM wsdl through java script..

Jump to solution
  var uid = "falcon";
   var pas = null;
   var att = null;

   var url = "http://comp.xx.yy.uk:27388/SM/7";  // fully qualified !
   var act = "Retrieve";      
          
   var xml = "<?xml version='1.0' encoding='UTF-8'?>"+ 
             "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">"+      
             "<soapenv:Body>"+         
             "<RetrieveIncidentRequest xmlns=\"http://schemas.hp.com/SM/7\" attachmentData=\"false\" attachmentInfo=\"true\" ignoreEmptyElements=\"true\">"+            
             "<model>"+               
             "<keys>"+                  
             "<IncidentID>IM10193</IncidentID>"+               
             "</keys>"+               
             "<instance />"+            
             "</model>"+         
             "</RetrieveIncidentRequest>"+      
             "</soapenv:Body>"+   
             "</soapenv:Envelope>";
          

  var quote = doSOAPRequest( url, act, xml, uid, pas, 5, 5, 5, att).toString();
  print( "quote = "+ quote);

 just did this test from servicecenter 6 -> servicemanager 9 oob.

give it a try.  you have to adjust IncidentId !!

View solution in original post

16 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Send request to IM wsdl through java script..

Jump to solution

sorry wrong file attched.

 

 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Send request to IM wsdl through java script..

Jump to solution
Hi All,

Kindly suggest anything...

re,
abhijit
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Send request to IM wsdl through java script..

Jump to solution
Hi,

Kindly advice on this issue.

re,
abhijit
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Send request to IM wsdl through java script..

Jump to solution
<?xml version='1.0' encoding='UTF-8'?>   
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">      
      <soapenv:Body>         
         <RetrieveIncidentRequest xmlns="http://schemas.hp.com/SM/7/ws" attachmentData="false" attachmentInfo="true" ignoreEmptyElements="true">            
            <model>               
               <keys>                  
                  <IncidentID>IM3956365</IncidentID>               
               </keys>               
               <instance />            
            </model>         
         </RetrieveIncidentRequest>      
      </soapenv:Body>   
   </soapenv:Envelope>

 

this soap-envelope is working. 

 

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Send request to IM wsdl through java script..

Jump to solution

never tried to consume servicemanager webservice/s from inside servicemanager, only from outside

 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Send request to IM wsdl through java script..

Jump to solution

hi hge,

Thanks for sharing this.but sorry it didn't work in my case.
same error as attached in second file.

I made it work through javascript call by IncidentManagement() method.

Yes this wrong way.We are integrating HPSM with external tool using web services, so they are going to consume HPSM wsdl but before that i am trying to identify ideal SOAP request format.

 

re,

abhijit

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Send request to IM wsdl through java script..

Jump to solution
  var uid = "falcon";
   var pas = null;
   var att = null;

   var url = "http://comp.xx.yy.uk:27388/SM/7";  // fully qualified !
   var act = "Retrieve";      
          
   var xml = "<?xml version='1.0' encoding='UTF-8'?>"+ 
             "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">"+      
             "<soapenv:Body>"+         
             "<RetrieveIncidentRequest xmlns=\"http://schemas.hp.com/SM/7\" attachmentData=\"false\" attachmentInfo=\"true\" ignoreEmptyElements=\"true\">"+            
             "<model>"+               
             "<keys>"+                  
             "<IncidentID>IM10193</IncidentID>"+               
             "</keys>"+               
             "<instance />"+            
             "</model>"+         
             "</RetrieveIncidentRequest>"+      
             "</soapenv:Body>"+   
             "</soapenv:Envelope>";
          

  var quote = doSOAPRequest( url, act, xml, uid, pas, 5, 5, 5, att).toString();
  print( "quote = "+ quote);

 just did this test from servicecenter 6 -> servicemanager 9 oob.

give it a try.  you have to adjust IncidentId !!

View solution in original post

Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Send request to IM wsdl through java script..

Jump to solution
  replace
  var quote = doSOAPRequest( url, act, xml, uid, pas, 5, 5, 5, att).toString();
  with
  var quote = doSOAPRequest( url, act, xml, uid, pas, 5, 5, 5, att).toXMLString();

 

Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Send request to IM wsdl through java script..

Jump to solution

hi hge,

 

It worked like Potter's MAGIC-WAND.

 

I have been also able to produce Ticket using Create method.

 

thanks for sharing and your precesious time.

 

kudos assigned.

 

thanks and regards,

abhijit

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Send request to IM wsdl through java script..

Jump to solution

thank you Abhijit.  try this too:

 

   var act = "RetrieveList";      
          
   var xml = "<?xml version='1.0' encoding='UTF-8'?>"+
             "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">"+      
             "<soapenv:Body>"+         
             "<RetrieveIncidentListRequest xmlns=\"http://schemas.hp.com/SM/7\" attachmentData=\"false\" attachmentInfo=\"true\" ignoreEmptyElements=\"true\">"+            
             "<keys query=\"flag=&quot;true&quot; and OpenedBy=&quot;falcon&quot;\"/>"+                  
             "</RetrieveIncidentListRequest>"+      
             "</soapenv:Body>"+   
             "</soapenv:Envelope>";

should retrieve all open incidents opened by falcon.

bye. hge

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Send request to IM wsdl through java script..

Jump to solution

if working with act="RetrieveList"

a) returns incident IM10161

b) returns all incident starting with IM1016

 

a) "<keys query=\"number=&quot;IM10161&quot;\"/>"+ 
b) "<keys query=\"number#&quot;IM1016&quot;\"/>"+  

 have fun.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.