gpt4 book ai didi

asp.net - CA 服务台 Web 服务视觉基础专家

转载 作者:行者123 更新时间:2023-12-02 16:06:36 24 4
gpt4 key购买 nike

我正在开发一个使用 CA 服务台 Web 服务请求系统的表单,但无法使用 ASP.NET 和 Visual Basic 找到该服务的任何帮助或编码示例。我联系了他们的技术支持,但他们的员工中没有人有使用它的经验。你知道我可以在哪里获得帮助吗?

最佳答案

刚刚完成对 CA 服务台的 vb.net Web 服务。希望下面的一些代码可以在您的项目中使用。

Imports System.Xml
Imports Microsoft.Web.Services3
Imports Microsoft.Web.Services3.Messaging
Imports Microsoft.Web.Services3.Addressing

Partial Class _Default
Inherits System.Web.UI.Page
Dim ws1 As New USD_WebService.USD_WebService
Public sid As Integer

Public userhandle, username, password As String
Public summary, description, incident, MH, SUN As String
Public group, category, uammsg, handle As String
Dim attrVal(5), attr(1), prop(1) As String
Public requestHandle, requestNumber As String

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click

ws1.Url = "http://"YOUR SERVER":8080/axis/services/USD_R11_WebService?wsdl"

'Get the Field values for the ticket (Could be done connecting to LDAP server)
username = userid1.Value 'Name from form field
password = pass1.Value 'Windows Password from form field
summary = Summary1.Value 'Summary from form field
description = desc1.Value 'Description from form field

'Get the SID from the CA Server
sid = ws1.login(username, password)

If (sid <= 0) Then
Response.Write("login failed")
Else
Response.Write("login succeeded")
End If

'Get the User ID from the CA Server
userhandle = ws1.getHandleForUserid(sid, username)

'Set the Field values to create the ticket.
'The AttrVal must be in pairs or the call will fail
'e.g. header & header details
attrVal = New String() {"customer", userhandle, "category", category, "group", group, "description", description, "summary", summary, "ZReporting_Method", "400001", "impact", "5", "type", "R"}
prop = New String() {""}
attr = New String() {"persistent_id"}

'Returned data from the CA server
requestHandle = ""
requestNumber = ""

'Send the request with the details from the form
ws1.createRequest(sid, userhandle, attrVal, prop, "", attr, requestHandle, requestNumber)
Response.Write("Ticket Number: " + requestNumber + " Created Successfully.")
'MsgBox("Ticket Number: " + requestNumber + " Created Successfully.")
MsgBox(requestHandle, 3)
'Log off the server using the SID
ws1.logout(sid)

请记住,属性需要成对出现,标签和标签数据,例如“摘要”和“摘要文本”。您需要将 CA WebService 导入到项目中。我正在使用 MS Visual Web Developer 2008 Express 来创建我的项目。

关于asp.net - CA 服务台 Web 服务视觉基础专家,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8990660/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com