1 Reply Latest reply on Feb 16, 2007 3:16 AM by shane.bryzak

    Remoting: Use mock-xml instead of server-call?!

    mugwump

      Basically. we want to have the ability to test our javascript-clients without any server: Is there a way to mock the xml that remoting uses?! We want to use a static xml and then use the remoting-apis to deserialize this on the client without needing a call to the server.

      Ideally, this could be implemented by using json instead of xml: We could then use the produced json in a disconnected enviroment, without relying on the server-infrastructure.

      Therefore my questions:

      a) is there a way to re-direct the deserialization-mechanism of remoting to use a static xml instead of a server-call?!

      b) could the remoting-protocols be made pluggable and use json instead of xml?

      This would make it easier, to develop&test the clients and the server independently from each other.

        • 1. Re: Remoting: Use mock-xml instead of server-call?!
          shane.bryzak

          This is extremely easy. Just override the Seam.Remoting.sendAjaxRequest() function to return whatever response you want to Seam.Remoting.requestCallback(). That's the great thing about Javascript, everything is public and you can selectively override pretty much anything you want.