Você está na página 1de 16

Using BMC ITSM OOB Web Services

The BMC Remedy ITSM Suite is shipped with a number of OOB Web Services that can be used to Create !uery and Modify re"uests #see $igure %& at end of document'& The most common integration is with the Incident Modu(e a(though the other Web Services are a(so fre"uent(y used and fo((ow the same princip(es& More information on the content of these p(ease refer to the #White )aper' BMC Remedy IT Service Management *&+ Integrations guide& Incident Management Web Services There are , associated Web Services with IM& These areHPD_IncidentInterface_Create_WS HPD_IncidentInterface _WS They can be accessed from the fo((owing (in.shttp-//0midtier1server2/arsys/WS34/pub(ic/0servername2/5)31IncidentInterface1Create1WS http-// 0midtier1server2/arsys/WS34/pub(ic/0servername2/5)31IncidentInterface 1WS 6ach Web Service contains one or more functions& These areHPD_IncidentInterface_Create_WS 5e(p3es.1Submit1Service HPD_IncidentInterface _WS 5e(p3es.1Modify1Service 7 5e(p3es.1!uery1Service 7 5e(p3es.1!uery4ist1Service7 Modify a re"uest in Incident Management !uery a re"uest in Incident Management !uery and return a (ist of re"uests in Incident Management 7 Submit a re"uest into Incident Management

Table 1-1: Web service function mapping Web service name unctions !it"in t"e !eb service HPD_IncidentInterface_Create_W S HPD_IncidentInterface_WS CH#_C"angeInterface_Create_W S CH#_C"angeInterface_WS P$%_ProblemInterface_Create_ WS P$%_ProblemInterface_WS P$%_&no!n'rrorInterface_WS P$%_SolutionInterfaceWS 5e(p3es.1Submit1Service 5e(p3es.1Modify1Service 5e(p3es.1!uery1Service 5e(p3es.1!uery4ist1Service Change1Submit1Service Change1Modify1Service Change1!uery1Service Change1!uery4ist1Service )rob(em1Submit1Service 8nown6rror1Submit1Service So(ution1Submit1Service )rob(em1Modify1Service )rob(em1!uery1Service )rob(em1!uery4ist1Service 8nown6rror1Modify1Service 8nown6rror1!uery1Service 8nown6rror1!uery4ist1Service So(ution1Modify1Service So(ution1!uery1Service So(ution1!uery4ist1Service So(ution19dd8eyword1Service Update1)O1Confirmation :et1Specific1)O :et14ist1Of1;ew1)os

(ST_Purc"ase)rder_WS

Common integrations to these Web Services are from third party app(ications that can consume these Web Services and functions to create "uery and modify re"uests& Interfaces can be written in a number of (anguages such as <ava 9S) C &;6T etc to interact with these Web Services& There are a few things to remember when using these Web Services& Some fo((ow the norma( integration form ru(es%& When creating a re"uest (** the fie(ds that are mapped into the WS34 need to be provided even if they are ;U44& These are e+pected in the SO9) re"uest and therefore a(( the fie(ds need to be provided& ,& The re"uired fie(ds a(ong with 9uthentication Information must be provided as a minimum these are$ie(d (ction *ast_+ame irst_+ame Status Service_T,pe Impact -rgenc, Summar, .eported_Source $ie(d =a(ue CR69T6 ;otes 8eyword triggers wor.f(ow that initiates the submit operation& Used to popu(ate the customer information section on the 5)3-5e(p 3es. form&

Maps to Summary on the 5)3-5e(p 3es. form&

>& 9uto 9ssignment needs to be configured& If there is no 9uto 9ssignment ru(e #this ru(e can be off(ine' or no 9ssignment va(ues provided the re"uest creation wi(( fai(& This is because wor.f(ow uses the 9uto 9ssignment record to retrieve the 9ssignment :roup I3 7 this is not documented and you can modify the defau(t wor.f(ow to (oo. up the correct form if needed& ?& 3ate va(ues are @M4 based format 2 AAAA7MM733Thh-mmTB3 #e&g& 1997-07-16T19:20+01:00'

Testing Web Services One of the most common ways to test Web Services is to use a free too( ca(( CSoapUID& This a((ows you to consume the Web Services and test the associated functiona(ity& Using soapUI Creating a Request %& Open a new proEect in soapUI& )rovide a proEect name and paste the UR4 of the Web Service into the CInitia( WS34/W934-D fie(d& This wi(( search for the Web Service and return a (ist of functions on the (eft& ,& 6+pand out the tree under the Web Service to e+pose the functions

>& 3oub(e C(ic. on the CRe"uest %D #SO9) 3efinition' under the 5e(p3es.1Submit1Service function& This wi(( open the SO9) 6nve(ope in the right hand window&

?& Aou wi(( notice that soapUI puts the va(ue C/D where it is e+pecting an input& FF ;OT6- These wi(( be transmitted when submitting the re"uest if not removed& This wi(( a(so cause errors bac. from Remedy due to incorrect data types etc FF

G& 6nter in the 9uthenticationInfo& Aou need to provide a va(id Remedy Username and )assword with appropriate permissions for the modu(e& H& )rovide va(ues for the minimum fie(ds and submit the re"uest by pressing the green p(ay button #top (eft'& 9ny errors re(ating to va(ues etc wi(( be disp(ayed in the far right hand window& If successfu( you wi(( be provided with an Incident number& FF ;OT6- 9(though you may have been supp(ied an Incident ;umber this number comes from the 5)3-IncidentInterface1Create form wor.f(ow and may not be va(id if the re"uest was not successfu( in some of the fie(d va(idations &&& FF

Querying a Request (It is assumed that you have loaded in the correct Web Service > HPD IncidentInter!ace WS" %& 3oub(e C(ic. on the CRe"uest %D #SO9) 3efinition' under the 5e(p3es.1!uery1Service function& This wi(( open the SO9) 6nve(ope in the right hand window& ,& 6nter in the 9uthenticationInfo& Aou need to provide a va(id Remedy Username and )assword with appropriate permissions for the modu(e& >& 6nter in a va(id Incident ;umber and submit the re"uest by pressing the green p(ay button #top (eft'&

?& 9 response wi(( be shown in the far right hand window&

Interfacing 6+amp(e The fo((owing shows a typica( Web Services ca(( from =B&;6T (isting a(( the re"uired va(ues and showing an e+amp(e of what is re"uired in the Web Service ca((& This wi(( return the Incident I3 where successfu(& In =isua( Studio ma.e a reference to the Web Service that you are attempting to consume& FF ;ote- 9s mentioned a(( the fie(ds need to be inc(uded in the Web Service re"uest FF
' // Add a Web Reference via Project > Add Web Reference to the Remedy Web Services ' // As the WS Reference is set to dynamic, include the .config file ith .e!e and u"date the reference to "oint to the correct "ath ' // #ote$ %ou need to have visibility/connection to the WS as it is set to dynamic &m"orts System &m"orts System.&' &m"orts System.#et (odule ARWebservices Sub (ain)*y+al ,md-ineArgs). As String. ' // /his "rogram ill "erform the follo ing$ ' // 0. ,reate a ne &ncident Re1uest via the 2P3$&ncident&nteface4,reate4WS form ' // 5. 6uery the 2P3$&ncident&nteface4,reate4WS form for &ncident #umber ' // 7. 6uery the 2P3$&ncident&nteface4WS form for 8ntry &3 for use ith the modify function )#ot Returning +alues. ' // 9. Send a (odify command and "arameters the 2P3$&ncident&nteface4WS form to ,lose the &ncident Re1uest ' // ' // ' // ' // offline.. ' // ' // &n"ut Parameters are$ :s ARServer, :u AR;ser, :" ARPass ord, :t ARServerPort, :f Re1uester<irst#ame, :l Re1uester-ast#ame == Pass ord cannot be blan> == ;sage$ ar ebservicescreatetic>et :u 3emo :" "ass ord :f *ob :l *a!ter /he ,reate ;ses Auto Assignment. <ill in the re1uired fields to use manual Assignment along ith an Auto Assignment rule )can be 8!tra cmd line Parameters ill be needed for ,om"any, 'rg, Su""ort ?rou" if manual assignment re1uired. AR;ser must be someone ith &ncident (odify "ermission )e.g. &ncident (aster. and be in the same Su""ort ?rou" as Assignment.

' // &n"ut Parameters 3im 8rr(sg As String @ String.8m"ty

3im 3im 3im 3im

str<irst#ame As String @ String.8m"ty str-ast#ame As String @ String.8m"ty AR;ser As String @ String.8m"ty ARPass ord As String @ String.8m"ty

3im strS6- As String @ String.8m"ty ' 3eclare variables for the 2P34&ncident&nterface4,reate4WS 3im Authentication&nfo As #e 2P34&ncident&nterface4,reate.Authentication&nfo 3im 2el"3es>4Submit4Service As #e 2P34&ncident&nterface4,reate.2P34&ncident&nterface4,reate4WSService 3im strSubmit&ncident&3 As String @ String.8m"ty ' 3eclare variables for the 2P34&ncident&nterface4WS 3im Authentication&nfo46uery As #e 2P34&ncident&nterface4WS.Authentication&nfo 3im 2el"3es>4(odify46uery4Service As #e 2P34&ncident&nterface4WS.2P34&ncident&nterface4WSService ' // 2olds the returned values of the 6uery to the 2el" 3es> form. 3im 6uery4'ut"ut(a"). As 2P34&ncident&nterface4WS.?et-ist'ut"ut(a"?et-ist+alues /ry ' // 8!tract "arameters from cmd line. AR;ser @ ?etArg+alue),md-ineArgs, A:uA, 8rr(sg. ARPass ord @ ?etArg+alue),md-ineArgs, A:"A, 8rr(sg. str<irst#ame @ ?etArg+alue),md-ineArgs, A:fA, 8rr(sg. str-ast#ame @ ?etArg+alue),md-ineArgs, A:lA, 8rr(sg. ' // 3efine Authentication Parameters for Submit and 6uery/(odify WS Authentication&nfo.user#ame @ AR;ser Authentication&nfo."ass ord @ ARPass ord Authentication&nfo46uery.user#ame @ AR;ser Authentication&nfo46uery."ass ord @ ARPass ord ' // Pass Authentication &nfo into 2eader in WS Submit ,all 2el"3es>4Submit4Service.Authentication&nfo+alue @ Authentication&nfo

' // Pass Authentication &nfo into 2eader in WS 6uery/(odify ,all 2el"3es>4(odify46uery4Service.Authentication&nfo+alue @ Authentication&nfo46uery ' // Webservices Submit ,all for ARS B.C.7 strSubmit&ncident&3 @ 2el"3es>4Submit4Service.2el"3es>4Submit4Service)Assigned4?rou"$@AA, Assigned4?rou"4Shift4#ame$@AA, Assigned4Su""ort4,om"any$@AA, 4 Assigned4Su""ort4'rganiDation$@AA, Assignee$@AA, ,ategoriDation4/ier40$@AA, ,ategoriDation4/ier45$@AA, 4 ,ategoriDation4/ier47$@AA, ,&4#ame$@AA, ,losure4(anufacturer$@AA, ,losure4Product4,ategory4/ier0$@AA, 4 ,losure4Product4,ategory4/ier5$@AA, ,losure4Product4,ategory4/ier7$@AA, ,losure4Product4(odel4+ersion$@AA, 4 ,losure4Product4#ame$@AA, 3e"artment$@AA, <irst4#ame$@str<irst#ame, &m"act$@2P34&ncident&nterface4,reate.&m"act/y"e.&tem9(inor-ocaliDed, 4 -ast4#ame$@str-ast#ame, -oo>u"4Eey ord$@AA, (anufacturer$@AA, Product4,ategoriDation4/ier40$@AA, Product4,ategoriDation4/ier45$@AA, 4 Product4,ategoriDation4/ier47$@AA, Product4(odel4+ersion$@AA, Product4#ame$@AA, Re"orted4Source$@2P34&ncident&nterface4,reate.Re"orted4Source/y"e.'ther, 4 Resolution$@AA, Resolution4,ategory4/ier40$@AA, Resolution4,ategory4/ier45$@AA, Resolution4,ategory4/ier47$@AA, 4 Service4/y"e$@2P34&ncident&nterface4,reate.Service4/y"e/y"e.&nfrastructure8vent, Status$@2P34&ncident&nterface4,reate.Status/y"e.#e , Action$@A,R8A/8A, 4 ,reate4Re1uest$@2P34&ncident&nterface4,reate.,reate4Re1uest/y"e.#o, Summary$@A/est /ic>et : Web ServicesA, #otes$@AA, 4 ;rgency$@2P34&ncident&nterface4,reate.;rgency/y"e.&tem9-o , Wor>4&nfo4Summary$@A,reated <rom Web &nterfaceA, Wor>4&nfo4#otes$@AA, 4 Wor>4&nfo4/y"e$@2P34&ncident&nterface4,reate.Wor>4&nfo4/y"e/y"e.?eneral, Wor>4&nfo43ate$@#othing, 4 Wor>4&nfo4Source$@2P34&ncident&nterface4,reate.Wor>4&nfo4Source/y"e.'ther, 4 Wor>4&nfo4-oc>ed$@2P34&ncident&nterface4,reate.,reate4Re1uest/y"e.#o, 4 Wor>4&nfo4+ie 4Access$@2P34&ncident&nterface4,reate.Wor>4&nfo4+ie 4Access/y"e.&nternal, (iddle4&nitial$@AA. ' // Webservices Submit ,all for B.C.0 ARS B.0 no Patch : #o Wor> &nfo )as a""ears to have issues on this version. or (iddle &nitial

'strSubmit&ncident&3 @ 2el"3es>4Submit4Service.2el"3es>4Submit4Service)Assigned4?rou"$@AA, Assigned4?rou"4Shift4#ame$@AA, Assigned4Su""ort4,om"any$@AA, 4 ' Assigned4Su""ort4'rganiDation$@AA, Assignee$@AA, ,ategoriDation4/ier40$@AA, ,ategoriDation4/ier45$@AA, 4 ' ,ategoriDation4/ier47$@AA, ,&4#ame$@AA, ,losure4(anufacturer$@AA, ,losure4Product4,ategory4/ier0$@AA, 4 ' ,losure4Product4,ategory4/ier5$@AA, ,losure4Product4,ategory4/ier7$@AA, ,losure4Product4(odel4+ersion$@AA, 4 ' ,losure4Product4#ame$@AA, 3e"artment$@AA, <irst4#ame$@str<irst#ame, &m"act$@2P34&ncident&nterface4,reate.&m"act/y"e.&tem9(inor-ocaliDed, 4 ' -ast4#ame$@str-ast#ame, -oo>u"4Eey ord$@AA, (anufacturer$@AA, Product4,ategoriDation4/ier40$@AA, Product4,ategoriDation4/ier45$@AA, 4 ' Product4,ategoriDation4/ier47$@AA, Product4(odel4+ersion$@AA, Product4#ame$@AA, Re"orted4Source$@2P34&ncident&nterface4,reate.Re"orted4Source/y"e.'ther, 4 ' Resolution$@AA, Resolution4,ategory4/ier40$@AA, Resolution4,ategory4/ier45$@AA, Resolution4,ategory4/ier47$@AA, 4 ' Service4/y"e$@2P34&ncident&nterface4,reate.Service4/y"e/y"e.&nfrastructure8vent, Status$@2P34&ncident&nterface4,reate.Status/y"e.,losed, Action$@A,R8A/8A, 4 ' ,reate4Re1uest$@2P34&ncident&nterface4,reate.,reate4Re1uest/y"e.#o, Summary$@ASentinel /est /ic>et Web ServicesA, #otes$@AA, 4 ' ;rgency$@2P34&ncident&nterface4,reate.;rgency/y"e.&tem9-o , Wor>4&nfo4Summary$@AA, 4 ' Wor>4&nfo4#otes$@AA, Wor>4&nfo4/y"e$@2P34&ncident&nterface4,reate.Wor>4&nfo4/y"e/y"e.?eneral, Wor>4&nfo43ate$@#othing, 4 ' Wor>4&nfo4Source$@2P34&ncident&nterface4,reate.Wor>4&nfo4Source/y"e.'ther, 4 ' Wor>4&nfo4-oc>ed$@2P34&ncident&nterface4,reate.,reate4Re1uest/y"e.#o, 4 ' Wor>4&nfo4+ie 4Access$@2P34&ncident&nterface4,reate.Wor>4&nfo4+ie 4Access/y"e.&nternal. ,onsole.Write-ine)strSubmit&ncident&3. ' // #'/8$ 6uery re1uired for 2P3$&ncident&nterface differs from above as e are s"ecifying a "articular field by name ' // 8!am"le S6- 6uery == #ote$ &nverted ,ommas #eeded or S6- Will <ail== ' // strS6- @ A'&ncident #umber' @ AA&#,CCCCCCCCCCF7AAA

' // e.g. '&ncident #umber' -&E8 A&#,44444444444BA : /his only 'str&ncident&3 @ strSubmit&ncident&3 'strS6- @ A'&ncident #umber' -&E8 AAA G str&ncident&3 G AAAA strS6- @ A'<irst #ame' @ A G AAA*obAAA 'strS6- @ A'B' @ A G AAA,losedAAA

or>s

ith last number, does not li>e the full &3.

' // &nitate the WS 6uery using above 1ualification to generate a time. 6uery4'ut"ut(a" @ 2el"3es>4(odify46uery4Service.2el"3es>46uery-ist4Service)strS6-, 0C, 0CC. ' // ,annot retrieve the values as it e!ecuting but returing an em"ty )nothing. variable so <or/#e!t generates and error. '<or 8ach get-ist+alues &n 6uery4'ut"ut(a" ' ,onsole.Write-ine)get-ist+alues.&ncident4#umber. '#e!t ' // Pause for 0C seconds to allo Auto Assignment to occur ,onsole.Write-ine)APausing for 0C seconds to allo Auto Assignment to occurA. System./hreading./hread.Slee")0CCCC. ' // ,lose out the Re1uest 2el"3es>4(odify46uery4Service.2el"3es>4(odify4Service),ategoriDation4/ier40$@AA, ,ategoriDation4/ier45$@AA, ,ategoriDation4/ier47$@AA, ,losure4(anufacturer$@AA, ,losure4Product4,ategory4/ier0$@AA, 4 ,losure4Product4,ategory4/ier5$@AA, ,losure4Product4,ategory4/ier7$@AA, ,losure4Product4(odel4+ersion$@AA, ,losure4Product4#ame$@AA, 4 ,om"any$@A,albro <inancial ServicesA, Summary$@A/est /ic>et : Web ServicesA, #otes$@AA, &m"act$@2P34&ncident&nterface4WS.&m"act/y"e.&tem9(inor-ocaliDed, 4 (anufacturer$@AA, Product4,ategoriDation4/ier40$@AA, Product4,ategoriDation4/ier45$@AA, Product4,ategoriDation4/ier47$@AA, Product4(odel4+ersion$@AA, 4 Product4#ame$@AA, Re"orted4Source$@2P34&ncident&nterface4WS.Re"orted4Source/y"e.'ther, Resolution$@AAutomatic ,losure <rom WSA, 4 Resolution4,ategory$@AA, Resolution4,ategory4/ier45$@AA, Resolution4,ategory4/ier47$@AA, Resolution4(ethod$@AA, Service4/y"e$@2P34&ncident&nterface4WS.Service4/y"e/y"e.&nfrastructure8vent, 4

Status$@2P34&ncident&nterface4WS.Status/y"e.,losed, ;rgency$@2P34&ncident&nterface4WS.;rgency/y"e.&tem9-o , Action$@A('3&<%A, Wor>4&nfo4Summary$@AA, Wor>4&nfo4#otes$@AA, Wor>4&nfo4/y"e$@#othing, 4 Wor>4&nfo43ate$@#othing, Wor>4&nfo4Source$@#othing, Wor>4&nfo4-oc>ed$@#othing, Wor>4&nfo4+ie 4Access$@#othing, &ncident4#umber$@strSubmit&ncident&3. 'str&ncident&3 @ 2el"3es>4(odify46uery4Service.2el"3es>46uery4Service)&ncident4#umber$@A&#,CCCCCCCCCCC0A, Assigned4?rou"4Shift4#ame$@AA, Assigned4Su""ort4,om"any$@AA, 4 ' Assigned4Su""ort4'rganiDation$@AA, Assignee$@AA, ,ategoriDation4/ier40$@AA, ,ategoriDation4/ier45$@AA, ,ategoriDation4/ier47$@AA, 4 ' ,ity$@AA, ,losure4(anufacturer$@AA, ,losure4Product4,ategory4/ier0$@AA, ,losure4Product4,ategory4/ier5$@AA, 4 ' ,losure4Product4,ategory4/ier7$@AA, ,losure4Product4(odel4+ersion$@AA, ,losure4Product4#ame$@AA, ,om"any$@AA, 4 ' ,ontact4,om"any$@AA, ,ontact4Sensitivity$@#othing, ,ountry$@AA, 3e"artment$@AA, <irst4#ame$@AA, &m"act$@#othing, -ast4#ame$@AA, 4 ' (anufacturer$@AA, (iddle4&nitial$@AA, #otes$@AA, 'rganiDation$@AA, Phone4#umber$@AA, Priority$@#othing, Priority4Weight$@#othing, 4 ' Product4,ategoriDation4/ier40$@AA, Product4,ategoriDation4/ier45$@AA, Product4,ategoriDation4/ier47$@AA, Product4(odel4+ersion$@AA, 4 ' Product4#ame$@AA, Region$@AA, Re"orted4Source$@#othing, Resolution$@AA, Resolution4,ategory$@AA, Resolution4,ategory4/ier45$@AA, 4 ' Resolution4,ategory4/ier47$@AA, Service4/y"e$@#othing, Site$@AA, Site4?rou"$@AA, Status$@#othing, Status4Reason$@#othing, Summary$@AA, ;rgency$@#othing, +&P$@#othing. ,atch e! As 8!ce"tion '/hro #e System.8!ce"tion)e!.(essage, e!.&nner8!ce"tion. ,onsole.Write-ine)e!.(essage, e!.&nner8!ce"tion. 8nd /ry 8nd Sub <unction ?etArg+alue)*yRef ArgArray). As String, *y+al S itch+alue As String, *yRef 8rr(sg As String. As String

' // Return s itch values from command line. ' // S itches and values must only come in "airs, ie. :u ;ser :" Pass ord :s Server /ry <or i As &nteger @ C /o ;*ound)ArgArray. Ste" 5 &f ArgArray)i. @ S itch+alue /hen Return ArgArray)i G 0. 8nd &f #e!t ,atch e! As 8!ce"tion 8rr(sg @ e!.(essage 8nd /ry Return String.8m"ty 8nd <unction 8nd (odule

$igure %&

Você também pode gostar