• 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: Wed, 6 Jan 2010 22:39:39 +0000

On Jun 10, 2008, at 9:44 PM, Andrew Lindesay wrote:

> Hello David;
>
>> WO -> Web
>> WO -> Java Client
>> WO -> Cocoa Client
>> WO -> Cocoa Touch Client
>
> WO -> WO :)


Helo,

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 ??

For the record here is my server app code:

public class Application extends ERXApplication implements
		LEWOJSONRPCApplicationInterface {

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

	public Application() {
		(...)
		LERPCRegistry reg = LERPCRegistry.singleton();

		reg.registerTargetClass(BaseEndpointRPCTarget.class);
		reg.registerTargetClass(ClientsRPC.class);
		registerRequestHandler(new LEWOJSONRPCRequestHandler(),
				JSONRPCRequestHandlerKey());
	}


	public String JSONRPCRequestHandlerKey() {
		return "jrpc";
	}

	public WOResponse handleJSONRPCException(Throwable arg0, WOContext arg1,
			Object arg2) {
		// TODO Auto-generated method stub
		return null;
	}
}


and the method that returns EO's:

@LERPCMethod()
	public NSArray<EOEnterpriseObject> obras() {
		...
		EOFetchSpecification fs = new EOFetchSpecification(...)
		return (NSArray<EOEnterpriseObject>) session().defaultEditingContext()
				.objectsWithFetchSpecification(fs);
	}

Thanks in advance for any tips.

The point of this exercise is that we have an app used only internally by the client, and another on the internet for their clients to have real time information on their requests. I've used this to try to learn how the 'public' app could get the data only through defined interfaces without direct db access, only through RPC to the 'private' app. Having EO proxys that accept KVC simplifies a lot.

Best regards,


 _______________________________________________
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>
  • Prev by Date: MySql plugin / driver bug
  • Next by Date: from JFreeChart (BufferedImage_) to NSData_
  • Previous by thread: Re: MySql plugin / driver bug
  • Next by thread: Re: LEWOStuff (the stuff with JSON-RPC!)
  • Index(es):
    • Date
    • Thread