WSUtil Class Reference

Used by OSSolverAgent client for help in invoking a remote solver.. More...

#include <OSWSUtil.h>

List of all members.

Public Member Functions

 WSUtil ()
 Default constructor.
 ~WSUtil ()
 Class destructor.

Static Public Member Functions

static std::string sendSOAPMessage (std::string theSOAP, std::string serviceIP, unsigned int servicePortNumber)
 open a socket and send a SOAP message to the solver Web Service
static std::string SOAPify (std::string theXmlString, bool useCDATA)
 prepare XML to be put into a SOAP envelop, replace < with < replace > with > replace " and ' with
static std::string deSOAPify (std::string theXmlString, bool useCDATA)
 take the XML from a SOAP envelop and replace < with < replace > with > replace &quot with ";
static std::string createSOAPMessage (int numInputs, std::string solverAddress, std::string postURI, std::string smethod, std::string *msInputs, std::string *msInputNames, std::string sSoapAction)
 create the SOAP message that is send to the solver Web Service
static std::string createFormDataUpload (std::string solverAddress, std::string postURI, std::string fileName, std::string theFile, std::string boundaryName)
 create the SOAP message that is send to the solver Web Service
static std::string getOSxL (std::string soapstring, std::string serviceMethod)
 extract the appropriate OSxL protocol from the SOAP envelop


Detailed Description

Used by OSSolverAgent client for help in invoking a remote solver..

Remarks:
The following key utilities invoked:
  1. Open a TCP socket and send a message
  2. Modify XML to use in a SOAP message
  3. Modify the result of a SAOP message to be valid XML
  4. Extract an OSxL from the SOAP

Definition at line 43 of file OSWSUtil.h.


Constructor & Destructor Documentation

WSUtil::WSUtil (  ) 

Default constructor.

Parameters:
solverURI is the location of remote solver or scheduler

Definition at line 46 of file OSWSUtil.cpp.

WSUtil::~WSUtil (  ) 

Class destructor.

Definition at line 49 of file OSWSUtil.cpp.


Member Function Documentation

static std::string WSUtil::sendSOAPMessage ( std::string  theSOAP,
std::string  serviceIP,
unsigned int  servicePortNumber 
) [static]

open a socket and send a SOAP message to the solver Web Service

Parameters:
theSOAP is a string that SOAP message sent to the Web service
servIP is a string with IP address or domain name of the server
solverPortNumber is a string with the port number of Web server (assume 80 by default)
Returns:
the reply from the Web service in a SOAP message.

Referenced by OSSolverAgent::fileUpload(), OSSolverAgent::getJobID(), OSSolverAgent::kill(), OSSolverAgent::knock(), OSSolverAgent::retrieve(), OSSolverAgent::send(), and OSSolverAgent::solve().

string WSUtil::SOAPify ( std::string  theXmlString,
bool  useCDATA 
) [static]

prepare XML to be put into a SOAP envelop, replace < with < replace > with > replace " and ' with

Parameters:
theXmlString is the string to modify to out in the SOAP envelop
useCDATA is true if just encase the XML in a CDATA statement
Returns:
the XML string that goes into the SOAP envelop.

Definition at line 231 of file OSWSUtil.cpp.

Referenced by OSSolverAgent::getJobID(), OSSolverAgent::kill(), OSSolverAgent::knock(), OSSolverAgent::retrieve(), OSSolverAgent::send(), and OSSolverAgent::solve().

string WSUtil::deSOAPify ( std::string  theXmlString,
bool  useCDATA 
) [static]

take the XML from a SOAP envelop and replace < with < replace > with > replace &quot with ";

Parameters:
theXmlString is the string from the SAOP envelop to modify
useCDATA is true if just encase the XML in a CDATA statement
Returns:
the resulting XML string.

Definition at line 269 of file OSWSUtil.cpp.

Referenced by OSSolverAgent::getJobID(), OSSolverAgent::kill(), OSSolverAgent::knock(), OSSolverAgent::retrieve(), OSSolverAgent::send(), and OSSolverAgent::solve().

static std::string WSUtil::createSOAPMessage ( int  numInputs,
std::string  solverAddress,
std::string  postURI,
std::string  smethod,
std::string *  msInputs,
std::string *  msInputNames,
std::string  sSoapAction 
) [static]

create the SOAP message that is send to the solver Web Service

Parameters:
numInputs is the number of OSxL protocols (e.g. osil, osol) in the SOAP message
solverAddress is the address of the scheduler or solver used
postURI is the path to the solver that follows the first / in the solverAddress
smethod is the method invoked, e.g. solve, kill, send, etc.
msInputs is string pointer to an array of strings are the OSxL protocols protocols that go into the message, e.g. osil, osol
msInputNames is string pointer to an array of string names of the OSxL protocols
sSoapAction is the name of the solver service plus the method, e.g. OSSolverService::solve
Returns:
the resulting XML string that is the SAOP message.

Referenced by OSSolverAgent::getJobID(), OSSolverAgent::kill(), OSSolverAgent::knock(), OSSolverAgent::retrieve(), OSSolverAgent::send(), and OSSolverAgent::solve().

std::string WSUtil::createFormDataUpload ( std::string  solverAddress,
std::string  postURI,
std::string  fileName,
std::string  theFile,
std::string  boundaryName 
) [static]

create the SOAP message that is send to the solver Web Service

Parameters:
numInputs is the number of OSxL protocols (e.g. osil, osol) in the SOAP message
solverAddress is the address of the scheduler or solver used
postURI is the path to the solver that follows the first / in the solverAddress
smethod is the method invoked, e.g. solve, kill, send, etc.
msInputs is string pointer to an array of strings are the OSxL protocols protocols that go into the message, e.g. osil, osol
msInputNames is string pointer to an array of string names of the OSxL protocols
sSoapAction is the name of the solver service plus the method, e.g. OSSolverService::solve
Returns:
the resulting XML string that is the SAOP message.

Definition at line 188 of file OSWSUtil.cpp.

Referenced by OSSolverAgent::fileUpload().

static std::string WSUtil::getOSxL ( std::string  soapstring,
std::string  serviceMethod 
) [static]

extract the appropriate OSxL protocol from the SOAP envelop

Parameters:
soapstring the soap envelop returned from the Web service
serviceMethod -- extract the string between the <serviceMethodReturn> and </serviceMethodReturn> tags.
Returns:
the resulting protocol.

Referenced by OSSolverAgent::getJobID(), OSSolverAgent::kill(), OSSolverAgent::knock(), OSSolverAgent::retrieve(), OSSolverAgent::send(), and OSSolverAgent::solve().


The documentation for this class was generated from the following files:
Generated on Tue Mar 30 03:13:49 2010 by  doxygen 1.4.7