Chinaunix首页 | 论坛 | 博客
  • 博客访问: 314231
  • 博文数量: 118
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 1163
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-27 12:09
文章分类

全部博文(118)

文章存档

2023年(20)

2022年(3)

2021年(1)

2020年(1)

2019年(7)

2013年(2)

2011年(1)

2010年(37)

2009年(46)

我的朋友

分类:

2009-10-12 18:59:34

How to install .NET API for Remedy (ARSystem)

 

Many of us would like to know how to interact with Remedy ticketing system using .NET framework. This is fairly easy to accomplish following several steps:

  1. Login to BMC Developer Network http://developer.bmc.com/communities/index.jspa
  2. Register accound and download API from this link:
  3.  NOTE: .NET API is backward compatible. So you can use 7.1 with 6.3 server.
  4. Create folder C:\ARAPI.NET
  5. Unzip downloaded files to previously created folder
  6. Create of modify several Environment variables:
    • "C:\ARAPI.NET" -> LIB
    • "C:\ARAPI.NET" -> PATH
  7. Add dll into .NET framework

C:\ARAPI.NET>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\regasm "C:\ARAPI.NET\BMC.ARSystem.dll" /codebaseMicrosoft (R) .NET Framework Assembly Registration Utility 1.1.4322.573Copyright (C) Microsoft Corporation 1998-2002.  All rights reserved. Types registered successfully 

C:\ARAPI.NET>

 

  • Create ARTCPPORTenvironment variable. Assign value "5920". This variable will be used as default port to connect to Remedy system.

  • Add BMC.ARSystem and BMC.arnettoc to Assembly Cache at .Net Configuration menu

 

 

  • Reboot your machine

  • Create sample code: createremedyticket.cs

 


// Create Remedy Ticket

// C#

// Copyright (C) 2008 Paul Grinberg. All Rights Reserved.

//

// Tested under .NET v1.1.4322

using System;
using System.Net;
using System.IO;
using System.Text;
using BMC.ARSystem;

namespace Isrcomputing {
  
 class CreateRemedyRequest {
 
 [STAThread]
 static void Main(string[] args) {

  try {
   BMC.ARSystem.Server server;
        server = new BMC.ARSystem.Server();
   server.Login("remedyserver01", "myusername", "mypassword");  // Change this to your server, username , password
   String formName = "HPD:HelpDesk";
   BMC.ARSystem.FieldValueList fieldValues = new BMC.ARSystem.FieldValueList();
   // Create an entry 
   fieldValues[8] = "C# - Generation II - Ticket that was automatically generated";
   fieldValues[240000007] = "Net Trials....\n\rChecking possibilities";
   // Category Field
   fieldValues[200000003] = "Remedy";
   // Type field
   fieldValues[200000004] = "Import";
   // Item Field
   fieldValues[200000005] = "Assets";
   // Case Type
   fieldValues[260000130] = "Incident";
   // Status
   fieldValues[7] = "New";
   // Priority
   fieldValues[260000126] = "Low";
   // Login+
   fieldValues[240000005] = "myusername";
   // Name+
   fieldValues[240000001] = "Joe Shmo";
   // Agency
   fieldValues[200000012] = "ISRCOMPUTING";
   // Location
   fieldValues[200000007] = "50 Broadway";

   // Department
   fieldValues[200000006] = "Operations";
   
   
   //BMC.ARSystem.EntryIdList entryId = server.CreateEntry(formName, fieldValues);
   string entryId = server.CreateEntry(formName, fieldValues);
   Console.WriteLine("Created Entry: " + entryId.ToString());
   server.Logout();
  } catch(Exception e) {
   Console.WriteLine("ARSystem.Exception caught\n" + e.ToString()); }
  }
 }
}
 


  •  Compile your code: 

"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe" /lib:C:\ARAPI.NET /reference:BMC.ARSystem.dll /define:DEBUG /optimize /out:createremedyticket.exe createremedyticket.cs

阅读(939) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~