Consume Web Services with VB.Net 2005
Author: admin Post Date: November 3 2009Hello;
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…