A web service is a method of communicating over the Internet.
It uses a standardized messaging system that allows data to be pushed and pulled from service to service.
DriveWorks utilizes either XML or JSON to communicate with other Web Services.
Most web based vendors such as Google, Amazon, Twitter and Salesforce provide some level of Web Services.
Web Services can be categorized into 3 levels:
A DriveWorks Project can be set up that communicates with the DriveWorks Web Service Connector.
This Project should use the Specification Flow Task - Send HTTP Request.
This task sends a request over the web to the listen URI, so although in this case it is our own Autopilot, it could be any open web service URI.
To apply the correct information to the properties of the Send HTTP Request Task the following information is required:
The Request Body contains all of the information that the Web Service needs in order to create a new Specification.
This includes the information to:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CreateSpecification> <projectName>MyProject</projectName> <transitionName>Release</transitionName> <values> <KeyValueOfstringstring xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <Key>[ControlName]</Key> <Value>[ControlValue]</Value> </KeyValueOfstringstring> <KeyValueOfstringstring xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <Key>[ControlName]</Key> <Value>[ControlValue]</Value> </KeyValueOfstringstring> </values> </CreateSpecification> </soap:Body> </soap:Envelope>
When the Request Body is built in the Rule Builder it will look like the image below:
Also replace the values given for projectName and transitionName with the required values from your Project.
And replace each instance of [ControlName] and [ControlValue] with the controls from your project and their required values.
The Request Body can also specify an existing Specification you want the connector to run on.
To do this:
Under the <CreateSpecification> Element, create a new Element called <SpecificationID> or <SpecificationName> and pass the corresponding value of the Specification you want run the connector on.
For example:
<SpecificationName>MySpecification 0019</SpecificationName>
The Request Header instructs the Web Service how to treat the data.
The content is specified as text/xml, the character set to process is utf-8, and it should also contain the instruction to Create a Specification.
content-type:text/xml; charset=utf-8|SOAPAction: "urn:IHttpConnectorService/CreateSpecification"
When the Request Header is built in the Rule Builder it will look like the image below:
Constants in the Project can be used to store the Response Body and Header.
The response will allow the success of the request to be determined.
The task can be added to a Specification Macro or the Specification Flow within a Project.
See Send HTTP Request for more information.
Enter the values applied in the Project to the properties of the Task.
The Request URL may not be known until the connector has been set up in DriveWorks Autopilot. See the Create the Connector section below for more information on this.
Once the Task has been applied it should look like one of the images below:
Specification Macro |
---|
Specification Flow |
If the task is to be run as a Specification Macro you will need to create a Macro Button on a user form in the Project.
If the task is to be run as part of the Specification Flow the task should be added to an appropriate Event or Transition on an existing State.
To set DriveWorks up as a Web Service a new Web Service Connector must be added to DriveWorks Autopilot.
Please refer to the topic Connectors for information to Add a New Connector.
Once the Web Service connector has been added please refer to the topic Connectors - Web Service for information on the settings to apply.
"content-type:text/xml; charset=utf-8|SOAPAction: """&"urn:IHttpConnectorService/EditSpecification"""
"<?xml version=""1.0"" encoding=""utf-8""?> <soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> <soap:Body> <EditSpecification> <projectName>WebConnectorProject</projectName> <transitionName>Another</transitionName> <specificationName>WebConnectorProject 0038</specificationName> <specificationId>0038</specificationId> <operationName></operationName> <values> </values> </EditSpecification> </soap:Body> </soap:Envelope>"
Knowledge Base Article Ref: | KB18090401 |
---|