HTTP Client DELETE Service
The HTTP Client DELETE service sends HTTP DELETE requests to a trading partner's HTTP server via the perimeter server. This service works with the HTTP Client Begin service and the HTTP Client End service and through an instance of the HTTP Client adapter.
The following table provides an overview of the HTTP Client DELETE service:
System name | HTTP Client DELETE Service |
---|---|
Graphical Process Modeler (GPM) categories | All Services, B2B Protocols > HTTP Client |
Description | The HTTP Client DELETE Service sends HTTP DELETE requests to a trading partner's HTTP server via the perimeter server. This service works with the HTTP Client Begin service and the HTTP Client End service, and through an instance of the HTTP Client adapter. |
Business usage | A business user would use the HTTP Client DELETE Service to place documents on a trading partner's HTTP server. |
Usage example | A Sterling B2B Integrator business process is executed that must delete a specified file from the external trading partner. Sterling B2B Integrator uses the HTTP Client DELETE Service, working through the HTTP Client Adapter, to delete the file from the trading partner's HTTP server. The data is passed to the business process. |
Preconfigured? | No |
Requires third-party files? | No |
Platform availability | All supported platforms for Sterling B2B Integrator |
Related services | Related services:
|
Application requirements | An HTTP server must exist at the external trading partner location. |
Initiates business processes? | No |
Invocation | This service is invoked from a business process. |
Business process context considerations | None |
Returned status values | Returned status values:
|
Restrictions | None |
Persistence level | Default |
Testing considerations | To test this service, run the HTTPClientDemoAllServices business process and verify that it completes successfully. For more information about the HTTPClientDemoAllServices business process, see the HTTP Client adapter. Debug information for this service can be found in the HTTP Client adapter and services log files. |
Implementing the HTTP Client DELETE Service
- Create an HTTP Client DELETE service configuration. For information, see Managing Services and Adapters.
- Configure the HTTP Client DELETE service. For information, see Configuring the HTTP Client DELETE Service.
- Use the HTTP Client DELETE service in a business process.
Configuring the HTTP Client DELETE Service
To configure the HTTP Client DELETE service, you must specify field settings in the Graphical Process Modeler (GPM):
Field | Description |
---|---|
Config | Name of the service configuration. |
DocumentId | A document ID to use with this instance of the HTTP Client DELETE service. Optional. |
RawResponse | Whether to include the HTTP Server response headers in the response document.
Optional. Valid values:
|
ResponseTimeout | Number of seconds the HTTP Client adapter will wait for a response. Optional. Any
numeric value is valid. Note: The value entered for this parameter overrides the Timeout setting in
the HTTP Client adapter configuration.
|
SessionToken | Specifies the identifier for the session established between the HTTP Client Adapter and an HTTP server. Required. |
ShowResponseCode | Whether to include the HTTP response status code as the first line in the primary
document. Optional. Valid values:
|
URI | Uniform Resource Indicator (URI) representing the HTTP server. Required. |
Cookie | Identifies the cookie to use in cases where the previous DELETE needs page redirection (returns 300 range response). The cookie value is passed from the response header Set-Cookie. The DELETE Service uses the Cookie parameter and creates the Cookie header in the next request. Valid values are cookies separated by semi-colon (cookie1;cookie2;cookie3). Optional. |
stripDefaultPortFromRequestHostHeader | Whether to include the port information in the HTTP host header if the port is
the default port (port 80 for HTTP, port 443 for HTTPS). Optional. Valid values:
|
Output from Business Process to Service
The following table contains the parameters passed from the business process to the HTTP Client DELETE service:
Field | Description |
---|---|
DocumentId | A document ID to use with this instance of the HTTP Client DELETE service. Optional. |
RawResponse | Whether to include the HTTP Server response headers in the response document.
Optional. Valid values:
|
ResponseTimeout | Number of seconds the HTTP Client adapter will wait for a response. Optional. Any
numeric value is valid. Note: The value entered for this parameter overrides the Timeout setting in
the HTTP Client adapter configuration.
|
SessionToken | Specifies the identifier for the session established between the HTTP Client Adapter and an HTTP server. Required. |
ShowResponseCode | Whether to include the HTTP response status code as the first line in the primary
document. Optional. Valid values:
|
URI | Uniform Resource Indicator (URI) representing the HTTP server. Required. |
Cookie | Identifies the cookie to use in cases where the previous DELETE needs page redirection (returns 300 range response). The cookie value is passed from the response header Set-Cookie. The DELETE Service uses the Cookie parameter and creates the Cookie header in the next request. Valid values are cookies separated by semi-colon (cookie1;cookie2;cookie3). Optional. |
Business Process Examples
The following example business process illustrates by using commands supported by the HTTP Client DELETE service:
<process name="HTTPClientDELETEServiceExample">
<sequence>
[[Insert Begin session operation here]]
<operation name="HTTP Client DELETE Service">
<participant name="HTTPClientDELETEService"/>
<output message="HTTPClientDeleteServiceTypeInputMessage">
<assign to="DocumentId">DocumentID</assign>
<assign to="RawResponse">true</assign>
<assign to="ResponseTimeout">60</assign>
<assign to="SessionToken">SessionToken</assign>
<assign to="ShowResponseCode">true</assign>
<assign to="URI">URI</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
[[Insert End session operation here]]
</sequence>
</process>
The following business process provides an example of using the Cookie parameter:
<process name="HTTP_To_advancepcsrx">
<!-- Loop Invariant. -->
<rule name="haveMoreCookie1">
<condition> string(counterCookie) <=
count(HTTPClientPostServiceResults/ServerResponse/Headers/
Set-Cookie/node()) </condition>
</rule>
<sequence>
<operation name="HTTP Client Begin Session Service">
<participant name="HTTPClientBeginSession"/>
<output message="HTTPClientBeginSessionServiceTypeInputMessage">
<assign to="CACertificateId">sgmillenia:13582d:10682043f1d:-73bd
</assign>
<assign to="CipherStrength">all</assign>
<assign to="HTTPClientAdapter">HTTPClientAdapter</assign>
<assign to="SSL">Must</assign>
<assign to="RemoteHost">webtransport.advancepcsrx.com</assign>
<assign to="RemotePort">443</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="HTTPClientBeginSessionServiceResults" from="*"></assign>
</input>
</operation>
<!-- Use FSA to pick up the input file -->
<operation name="Import Document Request">
<participant name="TEST_FILE_SYSTEM_ADAPTER"/>
<output message="FileSystemInputMessage">
<assign to="Action">FS_COLLECT</assign>
<assign to="collectionFolder" from="'/ais_local/share/sli'"></assign>
<assign to="filter" from="'AdvancePCS_URI.txt'"></assign>
<assign to="useSubFolders">false</assign>
<assign to="bootstrap">false</assign>
<assign to="deleteAfterCollect">false</assign>
<assign to="." from="*"></assign>
</output>
<input message="FileSystemOutputMessage">
<assign to="." from="*"></assign>
</input>
</operation>
<!-- Set document content type/subtype -->
<operation name="SetContenType">
<participant name="GetDocumentInfoService"/>
<output message="xout">
<assign to="." from="*"></assign>
<assign to="DocumentContentType">application</assign>
<assign to="DocumentContentSubType">x-www-form-urlencoded</assign>
</output>
<input message="xin">
<assign to="docInfo" from="*"></assign>
</input>
</operation>
<!-- POST to URI /template/login to login the webpage -->
<operation name="Http Client Post Service">
<participant name="HTTPClientPost"/>
<output message="HTTPClientPostServiceTypeInputMessage">
<assign to="SessionToken"
from="HTTPClientBeginSessionServiceResults/SessionToken/text()">
</assign>
<assign to="URI">/template/login</assign>
<assign to="RawResponse">true</assign>
<assign to="ResponseTimeout">120</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="HTTPClientPostServiceResults"
from="*" append="true"></assign>
</input>
</operation>
<!-- concat the cookie from the DELETE Response -->
<assign to="counterCookie">1</assign>
<assign to="Cookie" from="''"/>
<choice>
<select>
<case ref="haveMoreCookie1" activity="AppendCookie1"/>
</select>
<sequence name="AppendCookie1">
<assign to="Cookie" from="concat(string(Cookie), substring-before
(//HTTPClientPostServiceResults/ServerResponse/Headers/Set-Cookie[number
(//counterCookie)],';'),'; ')"/>
<assign to="counterCookie" from="number(counterCookie) + 1"/>
<choice>
<select>
<case ref="haveMoreCookie1" activity="Repeat1"/>
</select>
<repeat name="Repeat1" ref="AppendCookie1"/>
</choice>
</sequence>
</choice>
<!-- release Primary Document before DELETE -->
<operation>
<participant name="ReleaseService"/>
<output message="releaseRequest">
<assign to="TARDELETE" from="'PrimaryDocument'"/>
</output>
<input message="releaseResponse"/>
</operation>
<!-- DELETE URI / to reach the final page -->
<operation name="Http Client Delete Service">
<participant name="HTTPClientDelete"/>
<output message="HTTPClientDeleteServiceTypeInputMessage">
<assign to="SessionToken"
from="HTTPClientBeginSessionServiceResults/SessionToken/text()">
</assign>
<assign to="URI">/</assign>
<assign to="RawResponse">true</assign>
<assign to="ResponseTimeout">1200</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="HTTPClientDeleteServiceResults" from="*" append="true">
</assign>
</input>
</operation>
<operation name="HTTP Client End Session Service">
<participant name="HTTPClientEndSession"/>
<output message="HTTPClientEndSessionServiceTypeInputMessage">
<assign to="SessionToken"
from="HTTPClientBeginSessionServiceResults/SessionToken/text()">
</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="HTTPClientEndSessionServiceResults" from="*"
append="true"></assign>
</input>
</operation>
<onFault>
<sequence name="End Session">
<operation name="HTTP Client End Session Service">
<participant name="HTTPClientEndSession"/>
<output message="HTTPClientEndSessionServiceTypeInputMessage">
<assign to="SessionToken"
from="HTTPClientBeginSessionServiceResults/SessionToken/text()">
</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="HTTPClientEndSessionServiceResults" from="*"></assign>
</input>
</operation>
</sequence>
</onFault>
</sequence>
</process>
The following business process provides an example of specifying the URI parameter in the HTTP Client DELETE service. The URI is:
/s/ref=nb_ss_b/102-0129027-9554536?url=search-alias%3Dstripbooks&field
-keywords=Computers&Go.x=6&G0.y=4
The URI in this example has three parameters:
Parameter | Value |
---|---|
url | search-alias%3Dstripbooks |
field-keywords | Computers |
Go.x | 6 |
G0.y | 4 |
The business process is the following:
<process name = "test_http_get">
<sequence>
<operation name="HTTP Client Begin Session Service">
<participant name="HTTPClientBeginSession"/>
<output message="HTTPClientBeginSessionServiceTypeInputMessage">
<assign to="HTTPClientAdapter">HTTPClientAdapter</assign>
<assign to="RemoteHost">www.amazon.com</assign>
<assign to="RemotePort">80</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
<operation name="HTTP Client DELETE Service">
<participant name="HTTPClientDelete"/>
<output message="HTTPClientDeleteServiceTypeInputMessage">
<assign to="SessionToken" from="/ProcessData/SessionToken/text()">
</assign>
<assign to="URI">/s/ref=nb_ss_b/
102-0129027-9554536?url=search-alias%3Dstripbooks&field-keywords=
Computers&Go.x=6&Go.y=4</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
<operation name="HTTP Client End Session Service">
<participant name="HTTPClientEndSession"/>
<output message="HTTPClientEndSessionServiceTypeInputMessage">
<assign to="SessionToken" from="/ProcessData/SessionToken/text()">
</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
</sequence>
</process>
Activity Types for the HTTP Client DELETE Service
- DELETE –Retrieves whatever information is identified by the URI in the request line.