2 Replies Latest reply on Mar 8, 2010 3:07 PM by Jovin49

    Configuring HTTP Service


      When I configure an http service, I create an operation updateItem, assign it a method of POST, Content-Type application/xml, and then specify a URL: http://localhost:3000/sites/1/students/3. Now when I go to test the operation, this is what I get:


      InvocationTargetException:There was an error while invoking the operation. Check your operation inputs and try invoking the operation again.


      Response Received:
      Length Required




      Yet, in my application there is no such error when doing an update. However, when I try to accomplish it using Flash Builder, I get the above error. Am I doing something wrong in the Configure HTTP Service window? Thanks for any suggestions.

        • 1. Re: Configuring HTTP Service
          JohnMerlino Level 1

          I  completely abandoned the CallResponder route. It just took too much time to figure out and there's practically no in-depth resources out there for setting it up with HTTP Service (although you will find resources for ColdFusion and PHP). So I tried HTTP Service rather than CallResponder in the code:


                  <mx:HTTPService id="user_requestsUpdate" url="{CONTEXT_URL}/user_requests/{user_requestsGrid.selectedItem.id}/confirm_request"
                                  resultFormat = "e4x"
                                  headers="{{X_HTTP_METHOD_OVERRIDE: 'PUT'}}" />



          This produces this:


          [RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"]


          It's shocking to me how difficult it is just to make a simple update using flex.

          • 2. Re: Configuring HTTP Service



            Did you check the docs on configurng HTTPService in Flash Builder? Also, Configuring a custom data type (HTTPService). Please let me know what's missing or confusing with these docs.


            Also, here is a blog post from Sujit Reddy G with an example for HTTP Service that might be helpful as well.


            Vince Genovese