Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1  
Old 04-23-2004, 12:46 PM
tdc tdc is online now
Registered User
 
Join Date: 04-01-2003
Posts: 4
Consuming Web Services

Is there any way I can consume a web service directly from Visual Build? I'd like to be able to convert values returned from the web service into Visual Build macros.
Reply With Quote
  #2  
Old 04-23-2004, 01:28 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
You should be able to use the MS SOAP 3.0 toolkit and some vbscript to do what you are requesting.

You can download the MS SOAP 3.0 toolkit at http://download.microsoft.com/downlo...39/soapsdk.exe

Here is a function (untested) to get you started. You could add a function similar to the following example to your project script, then just add a Set Macro step with [GetSOAPValue()] as the value.

Function GetSOAPValue()
' (Using MS SOAP Toolkit 3.0)

' SOAP client object
Set clientACH = CreateObject("MSSOAP.SoapClient30")
' Output variables
Dim Result
' Initializing the SOAP client
clientACH.MSSoapInit "http://soap.example.com/soap-url"
' soap method
Result = clientACH.ConnectionCheck("Parameter1", "Parameter2")
GetSOAPValue = Result
End Function
Reply With Quote
  #3  
Old 10-04-2005, 11:05 AM
James James is online now
Registered User
 
Join Date: 10-04-2005
Posts: 1
Lightbulb Another method

Here is another method of consuming web services from a Visual Build script. This method uses the HTTP action rather than using VB Script and the MS SOAP toolkit.

Let's assume you have the following web service:

Code:
<WebService()> _
Public Class MyWebService
	Inherits System.Web.Services.WebService

	<WebMethod()> _
	Public Function MyWebMethod(ByVal param1 As String, ByVal param2 As Integer) As Boolean
		' Perform web service logic here
		Return True
	End Function
End Class
To consume this web service using Visual Build Pro, simply create an HTTP action and set its properties as follows:

HTTP Server: The name of the server (e.g. "localhost")

Command: Post form data

Macro Name: The name of a temporary macro that will hold the result of the web method

URL: The path of the web method (e.g. "/MyWebService.asmx/MyWebMethod")

Transfer Type: ASCII

Form data: The parameters to pass to the web service, in the format Param1Name=Param1Value&Param2Name=Param2Value (e.g. "param1=hello world&param2=5")


That's it! Now you can execute the step to call the web service, and the return value will be stored in the macro you specified. So, for the sample web service shown above, the macro would hold the following value:
Code:
<?xml version="1.0" encoding="utf-8"?>
<boolean xmlns="http://Hilton.com/OnQHome/OnQConfiguration">true</boolean>
Keep in mind that you can use macros in the "Form data" field to dynamically pass values to the web service.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 08:19 AM.


Copyright © 1999-2023 Kinook Software, Inc.