3

I am creating a simple Web Service using Spyne, the client (which I don't control) send a GET to verify that SSL is up and working.

The Spyne service I created responds with an error, saying only POSTS are supported.

Any ideas on how I can make it respond to a simple get on the same path?

Example of the code (using Django, but that shouldn't make a difference):

views.py:

class QWCService(ServiceBase):
    @rpc(Unicode, Unicode, _returns=Array(Unicode))
    def authenticate(ctx, strUserName, strPassword):
        print "authenticate"
    return ["auth","success"]

app = Application([QWCService],
    'my.namespace.com',
    in_protocol=Soap11(validator='lxml'),
    out_protocol=Soap11(),
)

app_service = csrf_exempt(DjangoApplication(app))

urls.py:

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url('^qwc', app.views.app_service, name="root"),
]

The only way I can figure out how to get around this is to flip the URL to a blank page, then flip it back after the check for SSL is done.

Error from Spyne:

Soap11env:Client.RequestNotAllowed You must issue a POST request with the Content-Type header properly set.

bcb
  • 41
  • 2

0 Answers0