Forum Stats

  • 3,781,636 Users
  • 2,254,533 Discussions
  • 7,879,770 Comments

Discussions

How to send the text data in Oracel soa 12c (12.2.1.0.0) REST Adapter.

siva naga prasad
siva naga prasad Member Posts: 20 Red Ribbon

Hi All,

One of the customer requirement, We need to send the text data (GraphQL format) to the customer REST API, For this requirement we are write the java code inside the BPEL and store the data in one variable. String data is stored in the particular variable this variable we are used in the invoke activity for sending the request to the customer API . In the REST adapter we configured as request body as text you can see the below screen shot.

We are invoked the the rest service and deployed the composite and tested it is getting error "Length Required" and Error code is 411

<?xml version="1.0" encoding="UTF-8"?><messages>

  <input>

<body_var>mutation {

        updateECRD(

          update:{

            loadId: "16228",

            ecrd: "2021-05-31T13:01:09+00:00"

          }) {

          transactionId

          status

          errors {

            message

          }

        }

      }</body_var>

  </input>

  <fault>

<bpelFault>

     <faultType>0</faultType>

         <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">

      <part name="summary">

        <summary>Length Required</summary>

      </part>

      <part name="code">

        <code>411</code>

      </part>

      <part name="detail">

               <detail>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"&gt;

&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Length Required&lt;/TITLE&gt;

&lt;META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"&gt;&lt;/HEAD&gt;

&lt;BODY&gt;&lt;h2&gt;Length Required&lt;/h2&gt;

&lt;hr&gt;&lt;p&gt;HTTP Error 411. The request must be chunked or have a content length.&lt;/p&gt;

&lt;/BODY&gt;&lt;/HTML&gt;

</detail>

      </part>

     </bindingFault>

   </bpelFault>

  </fault>

  <faultType>

<message>0</message>

  </faultType>

</messages>

If I am using the property in the invoke activity "<bpelx:toProperty name="rest.binding.http.Content-Length">0</bpelx:toProperty>" then we are not getting the above error.

Can any one suggest me how to send the text data in REST Adapter to the customer API and provide the solution of this technical issue.

Suggest me any blogs or documents of reference.

Please let me know if you need any further information.

Best Regards,

Siva Prasad.

Tagged: