Highlighted
Absent Member.
Absent Member.
7298 views

Calling a web service through HPSM

URGENT ISSUE:
I am trying to integrate HP Service Manager with external vendor application. When a ticket is created / modified, I would like to call the external webservice passing some of the HP Service Manager attributes to create tickets into that external tool. The vendor has already exposed the WSDL file.
Is there a documentation / forum link on how this can be accomplished. Please let me know as soon as possible as this is kind of urgent for me.

I have tried using the link: RUNtoJS. . A javascript file with all the methods has been generated. Please let me know what needs to be done next.
(1) How should i call to the web service now? Do i need to write code to consume the web service.
(2) If i write code to consume the web service, when should my code be triggered?
(3) At present, I just have the HPSM installed, would I need the code of HPSM as well to call the web service?

PLEASE HELP as I need to do this on urgent basis.
0 Likes
12 Replies
Highlighted
Absent Member.
Absent Member.

Re: Calling a web service through HPSM

Hi,

You need to write your own Java script code in Script Library to call the generated Java Scripts of webserives.

And then call this java script when you want to create the record in external system.

You may take the reference from the attached pdf file from sample demo code to consume the java script.
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Calling a web service through HPSM

Hi Manish,

Thanks for sharing such a wonderful PDF, i was also exploring web services in SM and able to generate tickets through cmd prompt.

This PDF was good to understand forward.

@Diti:

Kindly assign him good points.


Thanks for sharing once again.


Thanks and regards,
Abhjit

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Calling a web service through HPSM

In short answer of your questions are :

1) Yes you need to write a JS to call the script you have from WSDLtoJS.

2)You can trigger in different ways scheduling the script can be one of those or i think in your case you can have a trigger to call the JS so that same action can be performed at the external tool.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Calling a web service through HPSM

Hi Manish,

I tried to generate JS for this wsdl

 

http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl

http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL

 

But it gives the following error:

 

Error calling method: doHttpRequest in class:com/hp/ov/sm/server/utility/HttpClient Exception (java.net.SocketTimeoutException: connect timed out)
WSDL request failed with exception Error calling method: doHttpRequest in class:com/hp/ov/sm/server/utility/HttpClient Exception (java.net.SocketTimeoutExceptio
n: connect timed out)

 

Any idea on this?

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Calling a web service through HPSM

Dear all, 

I faced a problem when consuming webservice of ITSM.

When I use .Net webservice Studio or SOAPUI to retrieve Incident, I get this message: "Fault string, and possibly fault code, not set".

I used ITSM 9.21 , my wsdl URL: http://192.168.0.137:13080/SM/7/IncidentManagement.wsdl (It works)

Can any one help me.


Thank you so much.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Calling a web service through HPSM

Here is the entire message in .Net Webservice Studio:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Web.Services.Protocols.SoapHeaderException: Fault string, and possibly fault code, not set
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at IncidentManagement.RetrieveIncidentKeysList(RetrieveIncidentKeysListRequest RetrieveIncidentKeysListRequest)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at WebServiceStudio.MainForm.InvokeWebMethod()
at WebServiceStudio.MainForm.buttonInvoke_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Calling a web service through HPSM

Hi,

what is the error your are facing when trying to debug in SOAPUI?


Thanks and regards,
abhijit
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Calling a web service through HPSM

Hj, thanks for your reply:)

When I used SoapUI, I got the response like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Fault string, and possibly fault code, not set</faultstring>
<faultactor>Server</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

regards,

 

0 Likes
Highlighted
Valued Contributor.
Valued Contributor.

Re: Calling a web service through HPSM

Hello Manish,

I fond this post very helpful for my requirement.

In my case, I need to call external web service having it's URL starting with HTTPS instead of regular http. 

I tried calling the web service however i am getting certification exception as mentioned below.

"Error calling method: doHttpRequest in class: com/hp/ov/sm/server/utility/HttpClient Exception (javax.net.ssl.SSLHandshakeException: java.security.cert.Certifi
cateException: No subject alternative names present)"

I need your suggestion to fix this issue. To call external web service from HPSM, i believe i need to import ssl certificate of that portal in HPSM but I don't know how and where to import and which parameters I need to set in sm.ini to validate the external certificate and consume response successfully.

Regards,

SB

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

Re: Calling a web service through HPSM

Same probelm  i have face when calling HTTPs

Thanks,
Mohamed Shahboub

ITSM Consultant
0 Likes
Highlighted
Respected Contributor.. Respected Contributor..
Respected Contributor..

Re: Calling a web service through HPSM

Did some one figure it out, how to call external webservice using HTTPS within SM?

Thanks

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.