0

I have a webservice developped with Python, that is made available via Ladon.

I use the jsonwspclient.js and json2.js provided by the JSON example from ladon http://ladonize.org/index.php/Python_Example.

I am now in the need to do some cross script call to this webservice, so if I understand well the difference, I need to switch to some JSONP behaviour.

To do so, I have read that I need to add some callback function or something like that BTW I do not understand where this addiction should be made, and also if it can still be compatible with the description to load via JSON-WSP (is some kind of JSONP-WSP possible ?)

(also, should I switch to something like jquery for ths Javasript JSON part?)

My first tries ends with :

SyntaxError: JSON.parse: unexpected end of data

I think that this is due to some cross domain JS limitation (doing it not cross domain works well and does not end with this error)

another way, would be : how to convert a JSON-WSP descritpion and call it from a simple JSON way like the one described here ? Because calling client.loadDescription(muURL) to get description cannot be done cross domain.

Community
  • 1
  • 1
user1340802
  • 1,157
  • 4
  • 17
  • 36

1 Answers1

1

Or you simply make sure you don't have to go cross-site by creating a Reverse proxy setup on your webserver

1) Setting up a reverse proxy on IIS: http://technet.microsoft.com/en-us/library/ee215194(v=ws.10).aspx

You should have a match rule looking something like this:

<rule name="Reverse Proxy to MV-ID Services" stopProcessing="true">
  <match url="^service/(.*)" />
  <action type="Rewrite" url="http://ladonize.org/python-demos/{R:1}" />
</rule>

2) Setting up a reverse proxy on Apache2: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

In your apache site-configuration you should have something like this in the site configuration:

ProxyPass /service http://ladonize.org/python-demos
ProxyPassReverse http://ladonize.org/python-demos
  • thx. Please is it possible to do so => to convert a JSON-WSP descritpion and call it from a simple JSON way like the one described here ? Because calling client.loadDescription(muURL) to get description cannot be done cross domain. ? – user1340802 Oct 25 '12 at 15:04