Yeah, you are right. Stupid question. I am not familiar with how response 
works.

def call():
    response.namespace = 'http://tempuri.org/'
    return service()


This is enough in call() function.

Thanks!

On Thursday, June 11, 2015 at 3:18:13 PM UTC-4, Niphlod wrote:
>
> isn't a simple
>
> def what_you_serve():
>       ......foo bar
>       response.namespace = 'http://tempuri.org/'
>       return dict(a=1)
>
> working ?
>
> On Thursday, June 11, 2015 at 6:36:31 PM UTC+2, Pengfei Yu wrote:
>>
>> Hi,
>>
>> I want to change the target namespace to "http://tempuri.org/"; in the 
>> SOAP WSDL xml file. 
>>
>> From the pysimplesoap's server.py, I see that I can specify it in 
>> SoapDispatcher 
>> class with namespace parameter. But I wonder how can I specify it in 
>> web2py controller's "@service.soap" decorator.
>>
>> From the code of "/gluon/tools.py", it seems that the namespace could be 
>> given by setting "response.namespace"
>>
>>     def serve_soap(self, version="1.1"):
>>         try:
>>             from gluon.contrib.pysimplesoap.server import SoapDispatcher
>>         except:
>>             return "pysimplesoap not installed in contrib"
>>         request = current.request
>>         response = current.response
>>         procedures = self.soap_procedures
>>
>>
>>         location = "%s://%s%s" % (
>>                         request.env.wsgi_url_scheme,
>>                         request.env.http_host,
>>                         URL(r=request, f="call/soap", vars={}))
>>         *namespace = 'namespace' in response and response.namespace or 
>> location*
>>         documentation = response.description or ''
>>         dispatcher = SoapDispatcher(
>>             name=response.title,
>>             location=location,
>>             action=location,  # SOAPAction
>>             namespace=namespace,
>>             prefix='pys',
>>             documentation=documentation,
>>             ns=True)
>>
>> I wonder how I can set response.namespace directly from web2py 
>> controller. A working example will be very nice.
>>
>> Thanks!
>>  
>>
>>  
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to