Legacy web service examples

This section provides an example of a legacy web service WSDL and SOAP request. 

Legacy web service WSDL example

The WSDL provides details for all active workflows that are exposed as SOAP on a grid. The input and output parameters for the workflows in the grid are included in the WSDL. The WSDL uses minOccurs indicators to identify optional and required parameters:

  • minOccurs="1" indicates that the parameter is required.
  • minOccurs="0" indicates that the parameter is optional.

The web context in the WSDL URL must match the web context used during installation.

  • If you used the default web context of baocdp, you would use the following URL format to access the WSDL for a CDP:

    http://<domain>:<port>/baocdp/ws/workflow/wsdl?grid-name=<gridName>
  • If you used the default web context of baoap, you would use the following URL format to access the WSDL for an AP: 

    http://<domain>:<port>/baoap/ws/workflow/wsdl?grid-name=<gridName>

The following sample shows a WSDL for the Called-Process workflow exposed as SOAP, which has a required element named InputOne. The workflow elements in the WSDL sample are as follows:

  • SampleGrid1 is the name of the grid that contains the activated module. 
  • ModuleOne is the name of the activated module. 
  • DirectoryOne is the name of the workflow directory. 
  • CalledProcess is the name of the workflow exposed as SOAP in ModuleOne. 
  • InputOne and InputTwo are the required input parameters. 
  • OutputOne is an optional output parameter.

<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:realops.com:amp:workflow" xmlns:soapbind="
http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsse="http://docs.oasisopen.
org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:ns2="ModuleOne:DirectoryOne" xmlns:ns1="urn:realops.com:amp:workflow"
name="Workflow" targetNamespace="urn:realops.com:amp:workflow">
<wsdl:types>
		<xsd:schema targetNamespace="ModuleOne:DirectoryOne">
			<xsd:element name="Called-Process-Request">
				<xsd:complexType>
					<xsd:all>
						<xsd:element name="InputOne" type="xsd:anyType" minOccurs="1" />
						<xsd:element name="InputTwo" type="xsd:anyType" minOccurs="1" />
				</xsd:all>
			</xsd:complexType>
		</xsd:element>
		<xsd:element name="Called-Process-Response">
			<xsd:complexType>
				<xsd:all>
					<xsd:element name="OuputOne" type="xsd:anyType" minOccurs="0" />
				</xsd:all>
			</xsd:complexType>
		</xsd:element>
	</xsd:schema>
	<xsd:schema targetNamespace="urn:realops.com:amp:workflow">
		<xsd:element name="grid-name" type="xsd:string" />
	</xsd:schema>
	<xsd:schema elementFormDefault="qualified" targetNamespace="http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
	<xsd:element name="Security" type="wsse:SecurityHeader" />
		<xsd:complexType name="SecurityHeader">
			<xsd:sequence>
				<xsd:element minOccurs="0" maxOccurs="1" name="UsernameToken"type="wsse:UsernameToken" />
			</xsd:sequence>
		</xsd:complexType>
		<xsd:complexType name="UsernameToken">
			<xsd:sequence>
				<xsd:element minOccurs="1" maxOccurs="1" name="Username" type="xsd:string" />
				<xsd:element minOccurs="1" maxOccurs="1" name="Password"type="wsse:Password" />
			</xsd:sequence>
		</xsd:complexType>
		<xsd:complexType name="Password">
			<xsd:simpleContent>
				<xsd:extension base="xsd:string">
					<xsd:attribute name="Type" type="xsd:string" />
				</xsd:extension>
			</xsd:simpleContent>
		</xsd:complexType>
	</xsd:schema>
</wsdl:types>
<wsdl:message name="ModuleOne-DirectoryOne_Called-Process-Request">
	<wsdl:part name="parameters" element="ns2:Called-Process-Request" />
	<wsdl:part name="authentication-header" element="wsse:Security" />
	<wsdl:part name="grid-name" element="ns1:grid-name" />
</wsdl:message>
<wsdl:message name="ModuleOne-DirectoryOne_Called-Process-Response">
	<wsdl:part name="parameters" element="ns2:Called-Process-Response" />
</wsdl:message>
<wsdl:portType name="WorkflowPortType">
	<wsdl:operation name="ModuleOne-DirectoryOne_Called-Process">
		<wsdl:input message="tns:ModuleOne-DirectoryOne_Called-Process-Request" />
		<wsdl:output message="tns:ModuleOne-DirectoryOne_Called-Process-Response" />
	</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WorkflowSoapBinding" type="tns:WorkflowPortType">
	<soap-bind:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
		<wsdl:operation name="ModuleOne-DirectoryOne_Called-Process">
	<soap-bind:operation soapAction="execute-workflow" />
	<wsdl:input>
		<soap-bind:header use="literal" part="authentication-header"
			message="tns:ModuleOne-DirectoryOne_Called-Process-Request" />
		<soap-bind:header use="literal" part="grid-name" message="tns:ModuleOne-DirectoryOne_Called-Process-Request" />
		<soap-bind:body use="literal" parts="parameters" />
	</wsdl:input>
	<wsdl:output>
		<soap-bind:body use="literal" parts="parameters" />
	</wsdl:output>
	</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WorkflowService">
<wsdl:documentation>RealOps AMP™ workflow webservice for "SampleGrid1"grid.</wsdl:documentation>
	<wsdl:port name="WorkflowPort-1" binding="tns:WorkflowSoapBinding">
		<soap-bind:address location="http://localhost:2580/ws/workflow" />
	</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Back to top 

Legacy web service SOAP request example

The following SOAP request example executes the workflow exposed in the WSDL sample shown in Legacy web service WSDL example. When you create a SOAP request, ensure that the Username and Password values in the SOAP request match the credentials for an existing user account on the grid.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
	<soapenv:Header>
		<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
			<wsse:UsernameToken>
				<wsse:Username>admin</wsse:Username>
				<wsse:Password>admin123</wsse:Password>
			</wsse:UsernameToken>
		</wsse:Security>
		<grid-name xmlns="urn:realops.com:amp:workflow">SampleGrid1</grid-name>
	</soapenv:Header>
	<soapenv:Body>
		<Called-Process-Request xmlns="ModuleOne:DirectoryOne">
			<InputOne>abc123</InputOne>
			<InputTwo>abc</InputTwo>
		</Called-Process-Request>
	</soapenv:Body>
</soapenv:Envelope

Back to top 

SOAP request headers specification

The SOAP request must contain the following elements.

  • The first element contains the authentication credentials required to connect to the grid.
  • The second element contains the grid name. 

You must provide the authentication information in plain text.

<soapenv:Header>
		<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
			<wsse:UsernameToken>
				<wsse:Username>USERNAME</wsse:Username>
				<wsse:Password>PASSWORD</wsse:Password>
			</wsse:UsernameToken>
		</wsse:Security>
		<grid-name xmlns="urn:realops.com:amp:workflow">GRIDNAME</grid-name>
	</soapenv:Header>

Back to top 

Workflow information specification

In the legacy web service SOAP request, the <soapenv:Body> tag contains the following workflow elements: workflow name, module name, and directory name. You must format the workflow name in an XML format. The following table demonstrates the formatting rules for workflow names. 

Workflow nameMapped XML valueDescription

ProcessOne

ProcessOne

You can use this workflow name without any mapping changes.

Process One

Process-One

A space in a name maps to a hyphen (-) in XML.

Process:One

Process.One

A colon (:) in a name maps to a dot (.) in XML.

Process-One

Process_-One

An underscore (_) is used to escape hyphens and dots.

process_One

Process__One

An underscore (_) is used to escape underscores.

XML Process

_Xml-Process

Any name that starts with any form of XML will have the first X escaped.

1Process

_1Process

Any name that, as a result of mapping, starts with an illegal character will have the first character of its name escaped.

The format for the <soapenv:Body>tag is:

<ProcessName-Request xmlns="<ModuleName>:<DirectoryName>">


The WSDL sample, shown in the preceding section, contains the following format for the <soapenv:Body> tag:

<Called-Process-Request xmlns="ModuleOne:DirectoryOne">

 Back to top 

Input and output parameter example

The input and output parameters are child elements of the workflow name element. The tag names for the input and output parameters are the input names from the workflow. The element values are the values used for the inputs. You can specify the input parameters in a simple or a complex format.

The complex format in the following sample contains a parent element that contains the name of the parameter, and child elements that contain the values for the parameters.

<Called-Process-Request xmlns="ModuleOne:DirectoryOne">
	<InputOne>
		<value>abc123</value>
	</InputOne>


The simple format contains the input parameter and value in one element, as in the following sample:

<Called-Process-Request xmlns="ModuleOne:DirectoryOne">
			<InputOne>abc123</InputOne>
			<InputTwo>abc</InputTwo>
		</Called-Process-Request>

Back to top 

 

Passing XML input

You might want to pass information in an XML input to a workflow using the Legacy web service. In this case, you must include an extra element inside the parameter element that functions as a root tag. For example, you want to pass the XML input:

<first-name>John</first-name>
<last-name>Doe</last-name>

You must enclose a root tag inside the parameter element. In this case, the root tag is <example>:

<soapenv:Body>
        <Called-Process-Request xmlns="ModuleOne:DirectoryOne">
            <inputname xsi:type="xsd:anyType>
                <example>
                    <first-name>John</first-name>
                    <last-name>Doe</last-name>
                </example>
            </inputname xsi:type="xsd:anyType>
        </Called-Process-Request>
    </soapenv:Body>

The following shows an example of a workflow that accepts both a string as an input and an XML value:

<soapenv:Body>
        <Called-Process-Request xmlns="ModuleOne:DirectoryOne">
            <InputOne>abc123</InputOne>
            <InputTwo xsi:type="xsd:anyType>
                <example>
                    <first-name>John</first-name>
                    <last-name>Doe</last-name>
                </example>
            </InputTwo xsi:type="xsd:anyType>
        </Called-Process-Request>
    </soapenv:Body>

Back to top 

Legacy web service SOAP example

If you specify output parameters for the workflow, the SOAP response contains the workflow output. The output value is always returned in the simple format, without <value> tags. Using the WSDL sample and the SOAP request sample shown in previous sections produces the following SOAP response after the workflow is executed:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<soapenv:Body>
		<Called-Process-Response xmlns="ModuleOne:DirectoryOne">
			<OutputOne>true</OutputOne>
		</Called-Process-Response>
	</soapenv:Body>
</soapenv:Envelope>

 Back to top 

Was this page helpful? Yes No Submitting... Thank you

Comments