Announcement

Collapse
No announcement yet.

Web Services Integration HP Service Center 6.1 and remedy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Web Services Integration HP Service Center 6.1 and remedy

    Hi,

    It is the first time Im integrating Service Center 6.1 using web services. Does someone have a javascript example of how to build an integration between Service Center and Remedy?

    I created an integration between service center development environment and test environment and I understand how it works but the javascript library generated from remedy WSDL is a little diferent and Im not getting to build the javascript library to invoke this new library generated from remedy wsdl.

    Thank you

  • #2
    Well I thought I could program in JavaScript to use web services (SC to SC, SC - mainframe, SC to external parties) but with Remedy I am stuck.
    I can use and program the Remedy web services in VB.Net 2010 for creating and retrieving incidents. For example this would create an incident by providing 3 parameters (Action, TemplateID, LoginId)

    Code:
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
            Dim user As String = "auto"
            Dim password As String = "otua"
            Dim strSubmitIncidentID As String = String.Empty
    
            Dim HelpDesk_Create_Service As New WebReference_Create.HPD_IncidentInterface_Create_WSService
            Dim AuthenticationCreate As New WebReference_Create.AuthenticationInfo
    
            ' // Define Authentication Parameters for Submit and Query/Modify WS
            AuthenticationCreate.userName = user
            AuthenticationCreate.password = password
    
            ' // Pass Authentication Info into Header in WS Query/Modify Call
            HelpDesk_Create_Service.AuthenticationInfoValue = AuthenticationCreate
            Try
                strSubmitIncidentID = HelpDesk_Create_Service.HelpDesk_Submit_Service(Assigned_Group:="", Assigned_Group_Shift_Name:="",
                                                                                  Assigned_Support_Company:="", Assigned_Support_Organization:="",
                                                                                  Assignee:="", Categorization_Tier_1:="", Categorization_Tier_2:="",
                                                                                  Categorization_Tier_3:="", CI_Name:="", Closure_Manufacturer:="",
                                                                                  Closure_Product_Category_Tier1:="", Closure_Product_Category_Tier2:="",
                                                                                  Closure_Product_Category_Tier3:="", Closure_Product_Model_Version:="",
                                                                                  Closure_Product_Name:="", Department:="", First_Name:="",
                                                                                  Impact:=WebReference_Create.ImpactType.Item4MinorLocalized, Last_Name:="",
                                                                                  Lookup_Keyword:="", Manufacturer:="", Product_Categorization_Tier_1:="",
                                                                                  Product_Categorization_Tier_2:="", Product_Categorization_Tier_3:="",
                                                                                  Product_Model_Version:="", Product_Name:="",
                                                                                  Reported_Source:=WebReference_Create.Reported_SourceType.Web,
                                                                                  Resolution:="", Resolution_Category_Tier_1:="",
                                                                                  Resolution_Category_Tier_2:="", Resolution_Category_Tier_3:="",
                                                                                  Service_Type:=WebReference_Create.Service_TypeType.InfrastructureEvent,
                                                                                  Status:=WebReference_Create.StatusType.Assigned, Action:="CREATE",
                                                                                  Create_Request:=WebReference_Create.Create_RequestType.No, Summary:="",
                                                                                  Notes:="", Urgency:=WebReference_Create.UrgencyType.Item4Low,
                                                                                  Work_Info_Summary:="", Work_Info_Notes:="",
                                                                                  Work_Info_Type:=WebReference_Create.Work_Info_TypeType.General,
                                                                                  Work_Info_Date:=Nothing, Work_Info_DateSpecified:=False,
                                                                                  Work_Info_Source:=WebReference_Create.Work_Info_SourceType.Other,
                                                                                  Work_Info_Locked:=WebReference_Create.Create_RequestType.No,
                                                                                  Work_Info_View_Access:=WebReference_Create.Work_Info_View_AccessType.Public,
                                                                                  Middle_Initial:="",
                                                                                  Status_Reason:=WebReference_Create.Status_ReasonType.CustomerFollowUpRequired,
                                                                                  Direct_Contact_First_Name:="", Direct_Contact_Middle_Initial:="",
                                                                                  Direct_Contact_Last_Name:="", TemplateID:="PWRESET", ServiceCI:="",
                                                                                  ServiceCI_ReconID:="", HPD_CI:="", HPD_CI_ReconID:="", HPD_CI_FormName:="",
                                                                                  WorkInfoAttachment1Name:="", WorkInfoAttachment1Data:=Nothing,
                                                                                  WorkInfoAttachment1OrigSize:=0, WorkInfoAttachment1OrigSizeSpecified:=False,
                                                                                  LoginID:="610657", Corporate_ID:="")
                MsgBox(strSubmitIncidentID)
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
        End Sub

    But if I want to translate the VB code to SC Javascript it doen't work.
    My try was
    Code:
    function create_IM(record) {
    	print( " ********************************************** " ); 
    	print( " **** Start of the incident create service **** " ); 
      	print( " ********************************************** " );
    
    	var strImNumber = "";
    	
    	var webservice = new lib.HPD_IncidentInterface_Create_WSService.HPD_IncidentInterface_Create_WSService()
    	
    	var authheader = new lib.HPD_IncidentInterface_Create_WSService.AuthenticationInfo();
    	authheader.userName.setValue(username);
    	authheader.password.setValue(password);
    	
    	webservice.AuthenticationInfoValue = authheader;
    	
    	var request = lib.HPD_IncidentInterface_Create_WSService.HelpDesk_Submit_Service();
    			
    	request.HelpDesk_Submit_Service.Action.setValue("CREATE");
    	request.HelpDesk_Submit_Service.TemplateID.setValue("REINIT");
    	request.HelpDesk_Submit_Service.LoginID.setValue("610657");
    	
    	
    	try {
    		var response = webservice.invoke(request,authheader);
    		//print(response);
    	}
    	catch(e) {
    		print("invoke error: " + e.toString());
    	}
    }
    Err: Script 'WS_REMEDY' line 72: ERROR TypeError: request has no properties at char 1

    Did anybody already do something similar? A example of your code or pointers obn how to proceed would be appreciated.

    Thx,
    Kind regards,
    fid509
    https://boincstats.com/signature/-1/user/38933/sig.png

    Comment


    • #3
      My guess is that these 3 lines:
      request.HelpDesk_Submit_Service.Action.setValue("C REATE");
      request.HelpDesk_Submit_Service.TemplateID.setValu e("REINIT");
      request.HelpDesk_Submit_Service.LoginID.setValue(" 610657");

      should be:
      request.Action.setValue("CREATE");
      request.TemplateID.setValue("REINIT");
      request.LoginID.setValue("610657");

      request is already a HelpDesk_Submit_Service object, so it wouldn't have that as a child. it's children would be HelpDesk_Submit_Service members, which I'm assuming are Action, TemplateID, LoginID, etc.

      Comment


      • #4
        Your suggestion was one of my first tries because you are correct in your assumption.
        But whatever I tried as variations, most of the times it fails with the same error message: request has no properties at char1

        The strange thing is that in VB the HelpDesk_Submit_Service function takes in a whole lot of parameters of type string and a lot of other datatypes and results in a string with only the new incidentnumber. This is nothing like the usual web services I worked with where you build your request and header followed by "invoking" the request to the webservice to get the response.
        Kind regards,
        fid509
        https://boincstats.com/signature/-1/user/38933/sig.png

        Comment


        • #5
          Can you post the ScriptLibrary HPD_IncidentInterface_Create_WSService?

          Comment


          • #6
            I attached the generated javascript and the WSDL.
            Attached Files
            Kind regards,
            fid509
            https://boincstats.com/signature/-1/user/38933/sig.png

            Comment


            • #7
              Now I see it
              var request = lib.HPD_IncidentInterface_Create_WSService.HelpDes k_Submit_Service();
              should be
              var request = new lib.HPD_IncidentInterface_Create_WSService.HelpDes k_Submit_Service();

              Comment


              • #8
                How could I miss that blunder but still it doesn't work.

                function create_BP2I() {
                print( " ********************************************** " );
                print( " **** Start of the incident create service **** " );
                print( " ********************************************** " );


                var webservice = new lib.HPD_IncidentInterface_Create_WSService.HPD_Inc identInterface_Create_WSService()

                var authheader = new lib.HPD_IncidentInterface_Create_WSService.Authent icationInfo();
                authheader.userName.setValue(username);
                authheader.password.setValue(password);



                var request = new lib.HPD_IncidentInterface_Create_WSService.HelpDes k_Submit_Service();

                request.Assigned_Group.setValue("");
                request.Action.setValue("CREATE");
                request.TemplateID.setValue("REINIT");
                request.LoginID.setValue("610657");

                try {
                var response = webservice.invoke(request,authheader);
                }
                catch(e) {
                print("invoke error: " + e.toString());
                }
                }
                results in the error Script 'BP2I_REMEDY' line 46: ERROR TypeError: request.Assigned_Group has no properties at char 1

                and if I try to send over an empty request by commenting out the following lines:

                //request.Assigned_Group.setValue("");
                //request.Action.setValue("CREATE");
                //request.TemplateID.setValue("REINIT");
                //request.LoginID.setValue("610657");
                the error becomes: invoke error: TypeError: requestObj.getName is not a function

                I included also the expected request and response SOAP for Remedy.
                request.txtresponse.txt

                Any help in how to solve this would be appriciated.

                Thank you,
                fid509
                Kind regards,
                fid509
                https://boincstats.com/signature/-1/user/38933/sig.png

                Comment


                • #9
                  Turns out that the ScriptLibrary SOAP from SC 6.2.8 is spitting out the wrong code when running wsdl2js. I used the one from SM7.10 and SM 9.30 and it works like a charm now.
                  Kind regards,
                  fid509
                  https://boincstats.com/signature/-1/user/38933/sig.png

                  Comment

                  Working...
                  X