Forum Stats

  • 3,825,769 Users
  • 2,260,558 Discussions
  • 7,896,671 Comments

Discussions

REST adapter 12c - DELETE with payload

Naveent_2785
Naveent_2785 Member Posts: 28 Blue Ribbon

Hi,

Can we invoke a REST resource with a DELETE verb by sending a payload i.e. having representation. When I created a REST reference(using WSDL approach)  by selecting a request schema in the payload for the DELETE method, the below WADL config is created(see 1) , however when I try to send the payload while invoking the rest service the body is going as null.

1) WADL config Default created

<resource path="/cim/{market}/{lang}/v1/{puid}/sms-identity">

         <method name="DELETE" soa:wsdlOperation="CIAM_DeleteSMSIdentity">

            <request soa:paramElement="pns:Request" xmlns:pns="http://ikea/system/ciam/ru/api/CIAM_RU_IntegrationProvABCS_CIAMUnlinkAccount_request">

               <param name="market" style="template" soa:expression="$property.rest.template.market_code" type="xsd:string"/>

               <param name="lang" style="template" soa:expression="$property.rest.template.language_code" type="xsd:string"/>

               <param name="puid" style="template" soa:expression="$property.rest.template.partyUID" type="xsd:string"/>          

            </request>

2) I tried to change the WADL config as below and send a payload but this time it fails with below remote fault while invoking. What is the issue in both the cases.

<resource path="/cim/{market}/{lang}/v1/{puid}/sms-identity">

         <method name="DELETE" soa:wsdlOperation="CIAM_DeleteSMSIdentity">

            <request>

               <param name="market" style="template" soa:expression="$property.rest.template.market_code" type="xsd:string"/>

               <param name="lang" style="template" soa:expression="$property.rest.template.language_code" type="xsd:string"/>

               <param name="puid" style="template" soa:expression="$property.rest.template.partyUID" type="xsd:string"/>

           <representation mediaType="application/json" element="cns:Request" xmlns:cns="http://ikea/system/ciam/ru/api/CIAM_RU_IntegrationProvABCS_CIAMUnlinkAccount_request"/>

            </request>

<bpelFault><faultType>0</faultType><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>oracle.fabric.common.FabricInvocationException: oracle.fabric.common.FabricException: java.lang.IllegalStateException: Entity must be null for http method DELETE.: Entity must be null for http method DELETE.</summary></part><part name="code"><code>null</code></part><part name="detail"><detail>Entity must be null for http method DELETE.</detail></part></remoteFault></bpelFault>

Answers

  • Aiq
    Aiq Member Posts: 2 Green Ribbon

    Hi

    Did you get this working?

  • Naveent_2785
    Naveent_2785 Member Posts: 28 Blue Ribbon

    Hi,

    Just seen your query. It seems it is expected behavior of the Jersey Rest Client used internally by the adapter.

    As confirmed by Oracle, this is not a bug but due to configuration of JerseyInvocation class, which validate request body for all HTTP methods. In case of DELETE method, is marked as MUST_BE_NULL. Even they confirmed SOA version upgrade will not help with this issue.

    I think it is standard of not allowing entities in the DELETE HTTP Method invocation.

    map.put("DELETE", EntityPresence.MUST_BE_NULL);

    So, possible options I can think of are instead of using a REST adapter, create a java class(spring rest) and use that to invoke as a spring component in your BPEL process.