Cypresslogic SOAP Toolkit
Home

 

Catalog
Standard Edition
Professional Edition
XML Mapper
XML Parser
SOAP Toolkit

 

 

S O A P   C o n n e c t  .  .  .

Cypresslogic SoapConnect provides an easy interface to add XML Web service functionality to any .NET application. 

SoapConnect allows developers to dynamically call Web services using simple APIs. For example, the following C# code shows how to call the LocalTimeByZipCode method in http://www.alethea.net/webservices/LocalTime.asmx :

string[] outputs = SoapConnect.InvokeMethod(
    "http://www.alethea.net/webservices/LocalTime.asmx?WSDL", // Specify WSDL
    "LocalTimeByZipCode",                                     // Specify method
    new string[] {"98052"});                                  // Specify set of inputs

System.Diagnostics.Debug.WriteLine(outputs[0]);               // Check the set of outputs

In addition to simple Web service invocations, SoapConnect also supports:

  • Network credentials and password based authentication schemes such as as basic, digest, NTLM, and Kerberos authentication.

  • Web proxies

  • Sessions

  • Timeouts

  • Custom SOAP requests, SOAP Action and Location

Requirements
SoapConnect
is built using Microsoft .NET platform. Only the following platforms with .NET Framework installed are supported:

  • Microsoft® Windows® 98
  • Microsoft® Windows NT® 4.0 (SP 6a required)
  • Microsoft® Windows Millennium Edition (Windows Me)
  • Microsoft® Windows® 2000 (SP2 Recommended)
  • Microsoft® Windows XP Professional
  • Microsoft® Windows XP Home Edition

You can add a reference to SoapConnect from within Visual Studio.NET in all .NET languages (i.e., C#, Managed C++, VB.NET etc).

SoapConnect Members

Public Constructors

SoapConnect Initializes a new instance of SoapConnect class with a specified WSDL

 

 

Public Properties

Request {get;} Gets SOAP Request message generated by SoapConnect
Response {get;} Gets SOAP Response message returned by the Web service invocation
Session{get; set;} Gets or Sets Sessions. true if Sessions are enabled (applies only to Web services that support sessions)
Timeout{get; set;} Gets or Sets the number of milliseconds to wait before the request to the Web service times out
Location{get; set;} Gets or Sets the Location of the Web service
SoapAction{get; set;} Gets or Sets the SOAP Action of the Web service

 

 

Public Static Methods

static InvokeMethod Static method used to invoke simple Web services
static SetWebProxy Static method used to set proxy server information

 

 

Public Methods

InvokeMethod Invokes a method in the Web service with the specified inputs
CreateRequest Creates a SOAP request for the specified method and inputs
SetAuthentication Sets the network credentials and password authentication information
InvokeMethodDirect Invokes a method in the Web service with the user-specified SOAP request, Location, SOAP Action and time outs.

 

 

 

 

SoapConnect.InvokeMethod

Invokes a method in the Web service with the specified inputs

 

public string[] InvokeMethod(

    string strMethod, 

    string[] astrInputs)

Parameters

strMethod - Name of the Web service method that is being invoked

astrInputs - Array of strings specifying the input values

Return value

Returns an array of strings that contain the array of output values

 

Example:

using System;
using SoapConnect;
class LocalTimeTestClass
{

    public static void Main() 
    {
        SoapConnect sc = new SoapConnect("http://www.alethea.net/webservices/LocalTime.asmx?WSDL");
        string[] outputs = sc.InvokeMethod("LocalTimeByZipCode", new string[] {"98052"});
        System.Diagnostics.Debug.WriteLine(outputs[0]);
    }
}

 

 

SoapConnect.CreateRequest

Creates a SOAP request for the specified method and inputs

 

public string CreateRequest(

    string strMethod, 

    string[] astrInputs)

Parameters

strMethod - Name of the Web service method

astrInputs - Array of strings specifying the input values

Return value

Returns the SOAP Request message

 

Example:

using System;
using SoapConnect;
class LocalTimeTestClass
{
    public static void Main()
    {
        SoapConnect sc = new SoapConnect("http://www.alethea.net/webservices/LocalTime.asmx?WSDL");
        string strRequest = sc.CreateRequest("LocalTimeByZipCode", new string[] {"98052"});
        if (sc.InvokeMethodDirect(strRequest, sc.Location, sc.SoapAction, 100000))
        {
            System.Diagnostics.Debug.WriteLine("The SOAP response returned is:");
            System.Diagnostics.Debug.WriteLine(sc.Response);
        }
    }
}

 

 

 

SoapConnect.SetAuthentication

Sets the network credentials and password authentication information

 

public void SetAuthentication(

    string strUsername,

    string strPassword,

    string strDomain,

    bool bPreAuthenticate)

Parameters

strUsername - Name of the Web service method

strPassword - Name of the Web service method

strDomain - Name of the Web service method

bPreAuthenticate - Name of the Web service method

Return value

This method has no return value.

 

Example:

using System;

using SoapConnect;

class MappointTestClass

{

   public static void Main()

   {

          // Invoke a Mappoint web service

        SoapConnect sc = new SoapConnect("http://staging.mappoint.net/standard-30/mappoint.wsdl");

        sc.SetAuthentication ("user", "pass", null, true);        // Set authentication

        string[] outputs = sc.InvokeMethod("GetMap", new string[] {... GetMap input ...});

   }

}

 

 

 

 

SoapConnect.InvokeMethodDirect

Invokes a method in the Web service with the specified SOAP request,

 

public bool InvokeMethodDirect(

    string strRequest,

    string strLocation,

    string strSoapAction,

    int nTimeOut)

Parameters

strRequest - SOAP request specified by the user

strLocation - Location of the Web service

strSoapAction - SOAP Action of the Web service

nTimeout - Timeout of the Web service request

Return value

Returns true if the method succeeds; else false.

 

Example:

using System;

using SoapConnect;

class LocalTimeTestClass

{
    public static void Main() 

    {
        SoapConnect sc = new SoapConnect("http://www.alethea.net/webservices/LocalTime.asmx?WSDL"); 

        string strRequest = sc.CreateRequest("LocalTimeByZipCode", new string[] {"98052"});

        if (sc.InvokeMethodDirect(strRequest, sc.Location, sc.SoapAction, 100000))
        { 

            System.Diagnostics.Debug.WriteLine("The SOAP response returned is:");
            System.Diagnostics.Debug.WriteLine(sc.Response);
        }
    }
}


 

All contenl © 2001 - 2003 Cypresslogic Systems Inc. Patent Pending unless otherwise stated. All rights reserved.