Forum Stats

  • 3,769,367 Users
  • 2,252,958 Discussions
  • 7,875,006 Comments

Discussions

APEX_WEB_SERVICE.make_request returns NULL

SørenMoss
SørenMoss Member Posts: 34 Blue Ribbon

Hi Community,

Using APEX_WEB_SERVICE.make_request to call fscmService/AccountCombinationService but the response returned is NULL

Doing a SOAP call with the payload (listed in bottom) in Postman is working fine.

But when I try to execute same payload from the Oracle database (APEX) via APEX_WEB_SERVICE.make_request it returns NULL.

It should return an XMLTYPE document. I have seen similar issue calling other SOAP services which I solved with fixing the g_request_headers.

But it still does not work for me in this case.

 

Code snippet;

 apex_web_service.g_request_headers.delete; 

 apex_web_service.g_request_headers(1).name := 'Content-Type';

 apex_web_service.g_request_headers(1).value := 'text/xml';  -- This service seems to require text/xml (tested with postman)

  

 l_result := APEX_WEB_SERVICE.make_request(p_url   => l_url, 

                      p_action  => l_action, 

                      p_envelope => l_envelope,

                      p_credential_static_id => 'eforms' -- created in workspace utilities 

                      );

 if l_result is null then

  logger.log('After web service. Result is null');

  return 'NULL'; -- I GET THIS !

...

--------------

Payload/envelope (working for same user in POSTMAN):

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/financials/generalLedger/accounts/codeCombinations/accountCombinationService/types/" xmlns:acc="http://xmlns.oracle.com/apps/financials/generalLedger/accounts/codeCombinations/accountCombinationService/"><soapenv:Header/>

<soapenv:Body>

<typ:validateAndCreateAccounts>

<typ:validationInputRowList>

<acc:DynamicInsertion>n</acc:DynamicInsertion>

<acc:Segment1>01</acc:Segment1>

<acc:Segment2>000</acc:Segment2>

<acc:Segment3>2580</acc:Segment3>

<acc:Segment4>0000</acc:Segment4>

<acc:Segment5>000</acc:Segment5>

<acc:LedgerName>Hovedbog</acc:LedgerName>

</typ:validationInputRowList>

</typ:validateAndCreateAccounts>

</soapenv:Body>

</soapenv:Envelope>