1 Reply Latest reply on May 23, 2014 2:25 PM by Keith Babo

    Switchyard/Jbpm how to set content type on rest services

    Henrique Martins Newbie

      Hi guys,

       

      I'm using BPMN on Switchyard but i'm getting some 415 Unsupported Media Type errors. I have the follow rest reference:

       

      @POST
      @Path("device/value/")
      @Consumes("text/plain")
      public void setDeviceStatus(String status);
      

       

      And i have a service task on the .bpmn that uses this service:

       

      <bpmn2:interface id="Interface_1" implementationRef="package.Device" name="Device">
           <operation id="Operation_1" implementationRef="setDeviceStatus" name="setDeviceStatus">
      
      <serviceTask id="setStatus" implementation="##SwitchYard" name="Set Status" operationRef="Operation_1">
      

       

      How can i set this service task to use "text/plain"?

       

      Regards

      Henrique

        • 1. Re: Switchyard/Jbpm how to set content type on rest services
          Keith Babo Master

          Just to be clear - are you saying the outbound REST request does not have the "Accept: text/plain" header with the JAX-RS interface you provided above?  You can't set this on the service task, but you might try setting it via a custom context mapper on the reference binding.  That said, I'm not sure why RESTEasy is not setting this based on the @Consumes value.  It would be interesting to see if this works in a standalone application using RESTEasy.