IBM Support

HTTP Post results in Invalid document body size after header extraction

Technote (troubleshooting)


Problem(Abstract)

HTTPClientPostService has an error
HTTPClientAdapter = [HttpClientAdapter_DynamicService]
ServiceStartTime = [2012-12-07 09:03:01.528]
ServiceEndTime = [2012-12-07 09:03:01.549]
SessionToken = [HttpClientAdapter_DynamicService_HTTPClientAdapter_node1_13548889814715:14366]
ErrorMessage = Http Client Exception:
Internal Error: Couldn't send request via session [HttpClientAdapter_DynamicService_HTTPClientAdapter_node1_13548889814715:14366] due to state machine having previous failure [-1: Internal Error: Error reported during generateHeaders: [com.sterlingcommerce.woodstock.services.httpclient.HttpClientException: Invalid document body size after header extraction [-2]; make sure make sure request document contains proper headers.]]

Symptom

Attempts to post a document via the HTTP Client Adapter results in the error message:

HTTPClientPostService has an error

HTTPClientAdapter = [HttpClientAdapter_DynamicService]
ServiceStartTime = [2012-12-07 09:03:01.528]
ServiceEndTime = [2012-12-07 09:03:01.549]
SessionToken = [HttpClientAdapter_DynamicService_HTTPClientAdapter_node1_13548889814715:14366]
ErrorMessage = Http Client Exception:
Internal Error: Couldn't send request via session [HttpClientAdapter_DynamicService_HTTPClientAdapter_node1_13548889814715:14366] due to state machine having previous failure [-1: Internal Error: Error reported during generateHeaders: [com.sterlingcommerce.woodstock.services.httpclient.HttpClientException: Invalid document body size after header extraction [-2]; make sure make sure request document contains proper headers.]]


Cause

In an earlier step of this SOAP workflow, the Get Document Info service was run and the results were placed as a child of the root ProcessData. One of these nodes is called DocumentId. After more steps, the Primary Document changed. However, the HTTP Client POST Service takes DocumentId as a parameter, and that DocumentId no longer matches up with the headers that were generated by the SOAP services.


Diagnosing the problem

If you receive this error in your HTTP Client POST service, look for a <DocumentId> node as a direct child of ProcessData.

Resolving the problem

There are multiple ways of dealing with this.

1. Release the DocumentId node just before the HTTP Client Adapter
steps:

<operation name="ReleaseDocumentId">
<participant name="ReleaseService" />
<output message="outmsg">
<assign to="TARGET">DocumentId</assign>
</output>
<input message="outmsg">
</input>
</operation>

or

2. In the initial GetDocInfo, output the results to a child node of
ProcessData rather than the root:

<operation name="Get Document Information Service">
<participant name="GetDocumentInfoService"/>
<output message="GetDocumentInfoServiceTypeInputMessage">
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="DocInfo" from="*"></assign>
</input>
</operation>

3. A third alternative is to run Get Document Info again just
before the HTTP Client Adapter steps so that current information on the
PrimaryDocument is loaded into ProcessData.

Document information

More support for: Sterling B2B Integrator
Adapters

Software version: 5.0, 5.1, 5.2, 5.2.1, 5.2.2, 5.2.3, 5.2.4, 5.2.4.1

Operating system(s): Platform Independent

Reference #: 1619827

Modified date: 18 May 2013


Translate this page: