AW: [Zope3-Users] Using z3c.jsonrpc with an existing skin
Roger Ineichen
dev at projekt01.ch
Tue Jul 22 07:53:22 EDT 2008
Hi Dominique
> Betreff: [Zope3-Users] Using z3c.jsonrpc with an existing skin
>
> Hi
>
> i want to switch from jsonserver to z3c.jsonrpc, but i cant
> get it working.
>
> i have a skin defined:
>
> py:
> from zope.publisher.interfaces.browser import
> IDefaultBrowserLayer class IPreview(IDefaultBrowserLayer):
> """ """
> zcml:
> <interface interface=".IPreview"
> type="zope.publisher.interfaces.browser.IBrowserSkinType"
> name="myskin" />
z3c.jsonrpc allows you to use JSON-RPC without a browser request.
This means it's possible to only support a JSON-RPC server
without any HTTP server setup. The sideefect is, that you need
to register a own JSON-RPC skin type.
<zope:interface
interface=".IPreview"
type="z3c.jsonrpc.interfaces.IJSONRPCSkinType"
name="myskin"
/>
Note, if you use forms or other pages in your JSON-RPC
response you also need to setup the IBrowserSkinType.
Otherwise forms or pages are not available. Most the time
the same skin name is used. Only use different names if
you like to separate the JSON-RPC from the HTTP API on
that server.
Regards
Roger Ineichen
_____________________________
END OF MESSAGE
> my json methods:
> <z3c:jsonrpc
> for="..interfaces.IGallery"
> permission="zope.Public"
> methods="getGallery getImages"
> class=".json.GalleryJSONViews"
> layer="bla.blest.skin.IPreview"
> />
>
> the methods class derives from jsonrpc's Methodpublisher.
>
> my apache is setup to proxy all requests to the skin "myskin"
>
> i tried to derive my Skin from IJSONRPCRequest, but a
> json-rpc request always ends in a 404.
>
> the request content-type is correct 'application/json-rpc'
>
> please help
>
> thanks
> Dominique
More information about the Zope3-users
mailing list