Difference between revisions of "Web Services"

From SDU
Jump to: navigation, search
m
m
Line 1: Line 1:
 +
__NOTOC__
 
[[Category:Integration]]
 
[[Category:Integration]]
Requirement: Create a request, change Order and  Contact through Web Services
+
<div align='center'><font color="green">To make corrections or additions to this article, select the ''edit'' tab above.<br>
 
+
To discuss or ask questions about this article, select the ''discussion'' tab above.</font></div>
Scripting- VB
+
  
'''Step1: Create a web reference in the front end.'''
+
== Create a Request, Change Order and Contact through Web Services via VB ==
 +
=== Step1: Create a web reference in the front end. ===
 
#Start the front end.
 
#Start the front end.
 
#Go to Website menu and click “Add web reference”.
 
#Go to Website menu and click “Add web reference”.
Line 11: Line 12:
 
#Add the webreference with the name “WebReference”.
 
#Add the webreference with the name “WebReference”.
  
 
+
=== Step 2: Create an Object of the web reference ===
'''Step 2: Create an Object of the web reference'''
+
 
<source lang="javascript">Dim ws As New WebReference.USD_WebService</source>
 
<source lang="javascript">Dim ws As New WebReference.USD_WebService</source>
  
 
+
=== Step 3: Specify the Correct web service URL ===
'''Step 3: Specify the Correct web service URL.'''
+
 
<source lang="text">ws.Url = "http://<hostname>:8080/axis/services/USD_R11_WebService?wsdl"</source>
 
<source lang="text">ws.Url = "http://<hostname>:8080/axis/services/USD_R11_WebService?wsdl"</source>
  
 
+
=== Step 4: Provide the username and password to get the sid value ===
'''Step 4: Provide the username and password to get the sid value'''
+
 
<source lang="javascript">Dim username, password As String
 
<source lang="javascript">Dim username, password As String
 
Dim sid As Integer
 
Dim sid As Integer
Line 28: Line 26:
 
where login is the method used to get the sid.
 
where login is the method used to get the sid.
  
 
+
=== Step 5: Get the User Handle ===
'''Step 5: Get the User Handle'''
+
 
<source lang="javascript">Dim userhandle As String
 
<source lang="javascript">Dim userhandle As String
 
userhandle = ws.getHandleForUserid(sid, username)</source>
 
userhandle = ws.getHandleForUserid(sid, username)</source>
 
Where getHandleForUserid is the method
 
Where getHandleForUserid is the method
  
 
+
=== Step 6: Create a Request ===
'''Step 6: Create a Request'''
+
 
<source lang="javascript">Dim attrVal(5), attr(1), prop(1), persistent_id As String
 
<source lang="javascript">Dim attrVal(5), attr(1), prop(1), persistent_id As String
 
Dim requestHandle, requestNumber As String
 
Dim requestHandle, requestNumber As String
Line 45: Line 41:
 
ws.createRequest(sid, userhandle, attrVal, prop, "", attr, requestHandle, requestNumber)</source>
 
ws.createRequest(sid, userhandle, attrVal, prop, "", attr, requestHandle, requestNumber)</source>
  
 
+
=== Step 7: Create a Change Order ===
'''Step 7: Create a Change Order'''
+
 
<source lang="javascript">Dim attrVal(5), attr(1), prop(1), persistent_id As String
 
<source lang="javascript">Dim attrVal(5), attr(1), prop(1), persistent_id As String
 
Dim requestHandle, requestNumber As String
 
Dim requestHandle, requestNumber As String
Line 56: Line 51:
 
ws.createChangeOrder(sid, userhandle, attrVal, prop, "", cattr, requestHandle, requestNumber)</source>
 
ws.createChangeOrder(sid, userhandle, attrVal, prop, "", cattr, requestHandle, requestNumber)</source>
 
   
 
   
 
+
=== Step 8: Create a contact ===
'''Step 8: Create a contact'''
+
 
<source lang="javascript">Dim attrVal(5), attr(1), persistent_id As String
 
<source lang="javascript">Dim attrVal(5), attr(1), persistent_id As String
 
Dim contactHandle, contactNumber As String
 
Dim contactHandle, contactNumber As String
Line 63: Line 57:
 
attr = New String() {persistent_id}
 
attr = New String() {persistent_id}
 
ws.createObject(sid, "cnt", attrVal, attr, contactHandle, contactNumber)</source>
 
ws.createObject(sid, "cnt", attrVal, attr, contactHandle, contactNumber)</source>
 
 
 
----
 
<div align='center'><font color="green">To make corrections or additions to this article, select the ''edit'' tab above.<br>
 
To discuss or ask questions about this article, select the ''discussion'' tab above.</font></div>
 

Revision as of 06:00, 26 July 2008

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Create a Request, Change Order and Contact through Web Services via VB

Step1: Create a web reference in the front end.

  1. Start the front end.
  2. Go to Website menu and click “Add web reference”.
  3. In the URL box provide the web service URL and click go. http://<hostname>:8080/axis/services/USD_R11_WebService?wsdl'''
  4. We can find the methods being pulled out.
  5. Add the webreference with the name “WebReference”.

Step 2: Create an Object of the web reference

<source lang="javascript">Dim ws As New WebReference.USD_WebService</source>

Step 3: Specify the Correct web service URL

<source lang="text">ws.Url = "http://<hostname>:8080/axis/services/USD_R11_WebService?wsdl"</source>

Step 4: Provide the username and password to get the sid value

<source lang="javascript">Dim username, password As String Dim sid As Integer username = "analyst1" password = "123" sid = ws.login(username, password)</source> where login is the method used to get the sid.

Step 5: Get the User Handle

<source lang="javascript">Dim userhandle As String userhandle = ws.getHandleForUserid(sid, username)</source> Where getHandleForUserid is the method

Step 6: Create a Request

<source lang="javascript">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)</source>

Step 7: Create a Change Order

<source lang="javascript">Dim attrVal(5), attr(1), prop(1), persistent_id As String Dim requestHandle, requestNumber As String attrVal = New String() {"requestor", userhandle, "category", "category id", "description", "description here"} prop = New String() {""} attr = New String() {cpersistent_id} requestHandle = "" requestNumber = "" ws.createChangeOrder(sid, userhandle, attrVal, prop, "", cattr, requestHandle, requestNumber)</source>

Step 8: Create a contact

<source lang="javascript">Dim attrVal(5), attr(1), persistent_id As String Dim contactHandle, contactNumber As String attrVal = New String() {"first_name","Mike", "last_name", "Tolland", "userid", "mike.tolland", "contact_num", "<Password here>", "email_address", "mike.tolland@abc.co.in", "phone_number", "00989876723"} attr = New String() {persistent_id} ws.createObject(sid, "cnt", attrVal, attr, contactHandle, contactNumber)</source>