Consume Web Services with VB.Net 2005
Hello;
Here is an example of consuming web services with VB 2005.. IT creates a new SR with authentication.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | Dim maximoSvc As New Maximo.MXSR() Dim maximoSRArr(0) As Maximo.MXSR_SRType Dim maximoSR As New Maximo.MXSR_SRType() Dim changeDate As New Maximo.MXDateTimeType Dim DESCRIPTION_LONGDESCRIPTION As New Maximo.MXStringType Dim REPORTEDBY As New Maximo.MXStringType Dim IMPACT As New Maximo.MXLongType Dim reply(0) As Maximo.SRKeyType Dim cred As New System.Net.NetworkCredential Dim actLabCost As New Maximo.MXDoubleType cred.UserName = "maxadmin" cred.Password = "maxadmin" maximoSvc.Credentials = cred DESCRIPTION_LONGDESCRIPTION.Value = "longdesc" REPORTEDBY.Value = "USER" IMPACT.Value = 4 maximoSR.DESCRIPTION_LONGDESCRIPTION = DESCRIPTION_LONGDESCRIPTION maximoSR.REPORTEDBY = REPORTEDBY maximoSR.AFFECTEDPERSON = REPORTEDBY maximoSR.IMPACT = IMPACT changeDate.Value = System.DateTime.Now maximoSR.CHANGEDATE = changeDate maximoSR.URGENCY = IMPACT actLabCost.Value = 0 maximoSR.ACTLABCOST = actLabCost maximoSRArr(0) = maximoSR reply = maximoSvc.CreateMXSR(maximoSRArr, System.DateTime.Now, True, "", "EN", "11111", "7.0") Dim MaximoTicketid As String MaximoTicketid = reply(0).TICKETID.Value |
Have a good day…
Tags: Maximo 7, Web Services
May 3rd, 2010 at 7:17 pm
Hi Boris,
Great Job! I just did the same via Rad/Java. Unfortunately, I’m stumped with the update of a Service Request. It basically doesn’t recognize the service request I am wanting to update. Have you tried this yet?
Any help is appreciated.
Thanks!! Keep posting as I’m reading