Saturday, March 14, 2009

SOAPpy wsdl Security

I was working on SOAPpy to access the web service exposed by JasperServer (REALLY COOL STUFF). SOAPpy can automatically retrieve function definitions from WSDL as so:



from SOAPpy import WSDL

url = 'yoururl'

# just use the path to the wsdl of your choice
wsdlObject = WSDL.Proxy(url + '?wsdl')


print 'Available methods:'
for method in wsdlObject.methods.keys() :
print method
ci = wsdlObject.methods[method]
# you can also use ci.inparams
for param in ci.outparams :
# list of the function and type
# depending of the wsdl...
print param.name.ljust(20) , param.type
print






If you want SOAPpy to authenticate you should simply put url like :


'http://username:password@computerip_name'


etc. SOAPpy internally uses urllib. It should be able to handle that.

However SOAPpy cannot authenticate method calls. You can make it authentication aware by reading more about it here:

http://www.voidspace.org.uk/python/articles/authentication.shtml

Also, since only manually testing revealed this. SOAPpy (version : 0.12) does not handle soap attachments (you can't use it as it is with Jasper). Had to test it to find out. ZSI does.

Tuesday, March 10, 2009

Django static pages

Serving static pages with django is mentioned here:
http://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs

However, I could not find help to serve index.html (or crossdomain.xml :) ).

Here is how I did it :
in your URLconf file (urls.py). Add the following:

(r'^(?P.*)$', MainPage),


And the following function in your views.py (Which you will need to import into your urls.py of course !)

in the header:

from django.views.static import serve

and define the following :


def MainPage(request,path):
if path == "":
return HttpResponseRedirect('/web/index.html')
return serve(request,'/'+path,'./web')

Congratulations ... you should now be serving pages from ./web of your current django directory. Also you can serve index.html and crossdomain.xml :).

The above should do the trick .... enjoy!

Saturday, March 7, 2009

Mapping for the masses

While currently working on GIS at Ericsson I was evaluating mapping components for FLEX. Two come out as clear leaders.
  • Google Maps Flex API
  • Umap
Google maps seems to be more stable. But Umap has a number of cool features up its sleeves.

One is the ability to view Open street maps. In case you haven't heard open street maps are the same for GIS that Wikipedia is for textual information.

Check out a cool map of Lahore (Pakistan) using UMap :



Plus you can customize the display logo at the bottom to your own company logo (for OSM) !

Also Yahoo maps seem to be more detailed for Remote locations than google maps (Virtual earth is the worst for third world countries).

Conclusion:
If you want Google maps, go with google maps. If your client specifically demands greater detailed maps or yahoo / virtual earth / open street maps ... go with UMap... even if the demand is only yahoo maps . UMap gives you more than the default yahoo control.

Google maps seems to be more hot nowadays so I will stick with it. ( Everyone has heard of it :) )
Also google maps supports the Adobe AIR Runtime (still experimental .. but stable). And it will soon have support for Google Street ( Open street map type maps by google )

P.S: both support polygon drawing (necessary for azimuth based GSM cell representation). So you can always swap between the two, as long as you abstract the APIs which you should be doing anyways :).
Links:
UMap
Google Flex Maps

Happy Coding!