Hello,

I'm new to python and web programming.  I'm trying to setup a web
service and it's giving me fits.  I followed the tutorial, but
obviously I'm still doing something wrong.

Here's what I'm trying to do:
1) the client uploads a file via a jquery widget (this works fine)
2) Send a soap request to a python script that processes the uploaded
file and save the output.
3) Make the output available for download via http.

I keep getting a 405, Method Not Allow error.

I'm using the soap <http://plugins.jquery.com/project/soaprequest> and
uploadify <http://www.uploadify.com/> plugins.  The code looks
something like this:

$(document).ready(function() {
        $('#file_upload').uploadify({
            ...
          'onComplete': function(event, ID, fileObj, response, data) {
                $.soapRequest({
                url:'http://localhost:8080',
                method:'runspice',
                params:{filePath:fileObj.name}
                });
           }

      });
});

My python looks almost identical to the tutorial code <http://
webpy.org/cookbook/webservice>, with these changes:


import web
import download
from soaplib.wsgi_soap import SimpleWSGISoapApp
from soaplib.service import soapmethod
from soaplib.serializers import primitive as soap_types
from soaplib.client import make_service_client

class SoapService(SimpleWSGISoapApp):
    """Class for webservice """

    @soapmethod(soap_types.String,_returns=soap_types.String)
    def runspice(self, filePath):
        """ Method for webservice"""
        return download.runSpice(filePath)


class RunSpice(SoapService):
    """Class for web.py """
    def start_response(self,status, headers):
        web.ctx.status = status
        for header, value in headers:
            web.header(header, value)


    def GET(self):
        response = super(SimpleWSGISoapApp,
self).__call__(web.ctx.environ, self.start_response)
        return render("\n".join(response))


    def POST(self):
        response = super(SimpleWSGISoapApp,
self).__call__(web.ctx.environ, self.start_response)
        return render("\n".join(response))

app=web.application(urls, globals())

if __name__ == "__main__":
    app.run()


-----------------------------------------------------------
I'm never getting to the server side processing as I always get the
405 error.

Thanks for your help!

Eric

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to