1 Reply Latest reply on Sep 26, 2012 8:29 AM by Lars Burgess

    update query

      Hello!

      i have in the source adapter the following code :

      def update(update_hash)

          obj_id = update_hash['id']

          RestClient.put("#{@updateADPC}/#{obj_id}",:model => update_hash)

        end

       

       

      my Web api is a mvc4 with following part of code:

      [HttpPut]

              public ADCView UpdateActDetailsC(ADCView model)

              {

                  _actDetailsCRepo.Edit(model);

                  return model;

              }

      when i make a synchronization in rhoconnect method (update) obj_id is what must to be  but when append the RestClient.put().... it give me an exception like "405 - methode not allowed".  can someone help me?thanks!

        • Re: update query

          It depends on what your .NET web service method is expecting.  Based on this code:

           

              RestClient.put("#{@updateADPC}/#{obj_id}",:model => update_hash)

           

          The incoming request to your web service will be www url form encoded (like it was posted by an HTML form).  If you're expecting JSON instead, you can specify the content type of the post:

           

          RestClient.put("#{@updateADPC}/#{obj_id}", {:model => update_hash}.to_json, :content_type => :json)

           

          But really it depends on what your web service needs, so I would look into the logs for your web service and debug it there.

          1 of 1 people found this helpful