• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: LEWOStuff (the stuff with JSON-RPC!)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LEWOStuff (the stuff with JSON-RPC!)


  • Subject: Re: LEWOStuff (the stuff with JSON-RPC!)
  • From: Henrique Gomes <email@hidden>
  • Date: Thu, 7 Jan 2010 10:29:20 +0000

Andrew,

Thank you, that did it. I was thinking I had to change something on the server, I now realize the 'on the wire' format is always the same, right? It's the client that has to be instructed on how to deserialize.

But does it mean that If I have the EO Model also on the client it will instantiate the right classes? I get this now :

ERROR er.extensions.eof.ERXEntityClassDescription  - Entity Obra not found in the default model group!

Also if I'm also using wonder, what's your advice? Better to subclass ERXApp and only implement the bits need for JSONRPC?

Thank you again for sharing your work and answering questions.

Best regards,

Henrique

On Jan 7, 2010, at 12:04 AM, Andrew Lindesay wrote:

Hi Henrique;

Thanks for the email.

Because the JSON-RPC system intentionally transports "model chunks" and not complete parts of the model, the concept of de-serialising to an EO on the client-side makes less sense.  This is a conscious design decision.

For WebObjects applications which are consumers of JSON-RPC web services, the client in the WebObjects application is intended to produce instances of...

nz.co.lindesay.common.webobjects.eo.proxy.LEEOEnterpriseObjectProxy

...instead of...

nz.co.lindesay.common.eo.proxy.LEEOEnterpriseObjectProxy

This class conforms to NSKeyValueCoding and should do what you want.  This behaviour will automatically happen if you add this to your application constructor in the client;

static
{
LEJSONFormatFactory.singleton().setFormatClass(LEWOJSONFormat.class);
}

(If you are subclassing from LEWOApplication then this happens by default.)

Hope this helps and let me know how you get on.

cheers


I am starting with your JSON RPC precisely on a WO->Wo scenario. Looking at the pdf, the examples and some mails I've been able to have the 'server' WOA respond to login request and send simple answers like strings. When I try to return EO's ( an NSArray of them) the client gets an ArrayList of nz.co.lindesay.common.eo.proxy.LEEOEnterpriseObjectProxy which do not have KVC.
How do I convince the server (or is it the client? to send an *NSArray*  of nz.co.lindesay.common.WEBOBJECTS.eo.proxy.LEEOEnterpriseObjectProxy ??
...
Thanks in advance for any tips.

___
Andrew Lindesay
www.lindesay.co.nz


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: LEWOStuff (the stuff with JSON-RPC!)
      • From: Andrew Lindesay <email@hidden>
References: 
 >Re: LEWOStuff (the stuff with JSON-RPC!) (From: Henrique Gomes <email@hidden>)
 >Re: LEWOStuff (the stuff with JSON-RPC!) (From: Andrew Lindesay <email@hidden>)

  • Prev by Date: Re: Best way to run period task?
  • Next by Date: Re: Best way to run period task?
  • Previous by thread: Re: LEWOStuff (the stuff with JSON-RPC!)
  • Next by thread: Re: LEWOStuff (the stuff with JSON-RPC!)
  • Index(es):
    • Date
    • Thread