Overview:
We use CA Service Desk for our ticketing system. I'm developing an InfoPath form to collect information from the requestor and then to obtain approval before a ticket would be created in our CA Service Desk system.
The CA Service Desk system provides a Web Service so that you can automate the creation of tickets in this system.
The Goal:
When the Approve button is clicked in the InfoPath form, a ticket is created in the CA Service Desk system automatically via the Web Service.
So far, I have figured out how to create a submit data connection in the InfoPath form to the CA Service Desk Web Service. But I cannot figure out how to set the variables in the connection. I found the following information which describes how to do this if we were writing a VB application:
Step1: Create a web reference in the front end.
- Start the front end.
- Go to Website menu and click “Add web reference”.
- In the URL box provide the web service URL and click go. http://<hostname>:8080/axis/services/USD_R11_WebService?wsdl'''
- We can find the methods being pulled out.
- Add the webreference with the name “WebReference”.
Step 2: Create an Object of the web reference
Dim ws As New WebReference.USD_WebService
Step 3: Specify the Correct web service URL
ws.Url = "http://<hostname>:8080/axis/services/USD_R11_WebService?wsdl"
Step 4: Provide the username and password to get the sid value
Dim username, password As String
Dim sid As Integer
username = "analyst1"
password = "123"
sid = ws.login(username, password)
where login is the method used to get the sid.
Step 5: Get the User Handle
Dim userhandle As String
userhandle = ws.getHandleForUserid(sid, username)
Where getHandleForUserid is the method
Step 6: Create a Request
Dim attrVal(5), attr(1), prop(1), persistent_id As String
Dim requestHandle, requestNumber As String
attrVal = New String() {"customer", userhandle, "category", "<category id>", "description", "Description here"}
prop = New String() {""}
attr = New String() {persistent_id}
requestHandle = ""
requestNumber = ""
ws.createRequest(sid, userhandle, attrVal, prop, "", attr, requestHandle, requestNumber)
However, when I setup the data connection to the Web Service in InfoPath, It seems to be looking for field mappings or a string for the variables "attrVal", "prop", "attr", etc. per the examples above. I'm not sure how to accomplish creating this connection successfully. I would like for it to use the username of the logged in user (logged into SharePoint 2010) and the other field values would be hard coded because they do not come from fields within the form.
Thank you for your help!