I'm trying to develop a SOAP Web Service in Django 1.5.2 with Python 2.7.3 and soaplib 0.8.1. Everything works fine at the moment, but now i need to add namespace to @soapmethod response.
This is my view:
from sms.soaplib_handler import DjangoSoapApp, soapmethod, soap_types
from django.views.decorators.csrf import csrf_exempt
class SmsGatewayService(DjangoSoapApp):
__tns__ = 'http://mismsgw01.milano.ea.it/soap'
@soapmethod(
soap_types.String,
soap_types.String,
soap_types.String,
soap_types.Integer,
soap_types.Boolean,
soap_types.Boolean,
soap_types.String,
_returns=soap_types.Any
)
def sendSms(
self,
sendTo,
numSender,
senderDescription,
timeToLive,
isDelivered,
isStatistics,
messageText
):
retCode = '<retCode>OK</retCode>'
return retCode
sms_gateway_service = csrf_exempt(SmsGatewayService())
and this is the response when i call the method:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<sendSmsResponse>
<sendSmsResult>
<retCode>OK</retCode>
</sendSmsResult>
</sendSmsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Anyone can help me? How i can modify a soap response? I need to have something similar to:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<sendSmsResponse xmlns="http://mismsgw01.milano.ea.it/soap">
<retCode>OK</retCode>
</sendSmsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Thanks in advance