Modify dispacher for differente response element name

This commit is contained in:
Nicola Gramola
2018-04-19 08:57:25 +02:00
parent 8d4dc1b373
commit 43e2ed2fc7
6 changed files with 45 additions and 20 deletions
@@ -25,6 +25,9 @@ def division(a, b):
"Divide two values "
return a / b
@service.soap('DummyCustomElement', returns={'out0': str}, args={'in0': str}, response_element_name='customResponseTag')
def dummy(in0):
return in0
# expose the soap methods
@@ -51,3 +54,20 @@ def test_soap_sub():
xml_response=client.xml_response,
result=result)
def test_custom_response_element_name():
from gluon.contrib.pysimplesoap.client import SoapClient, SoapFault
# build the url to the WSDL (web service description)
# like "http://localhost:8000/webservices/sample/call/soap?WSDL"
url = URL(f="call/soap", vars={"WSDL": ""}, scheme=True)
# create a SOAP client
client = SoapClient(wsdl=url)
# call the SOAP remote method
try:
ret = client.DummyCustomElement(in0="Hello World!")
result = ret['out0']
except SoapFault as sf:
result = sf
response.view = "soap_examples/generic.html"
return dict(xml_request=client.xml_request,
xml_response=client.xml_response,
result=result)
+5
View File
@@ -34,6 +34,7 @@
'An error occured, please %s the page': 'È stato rilevato un errore, prego %s la pagina',
'An error occured, please [[reload %s]] the page': 'An error occured, please [[reload %s]] the page',
'And': 'E',
'API Example': 'API Example',
'appadmin is disabled because insecure channel': 'Amministrazione (appadmin) disabilitata: comunicazione non sicura',
'Are you sure you want to delete this object?': 'Sicuro di voler cancellare questo oggetto ?',
'Available Databases and Tables': 'Database e tabelle disponibili',
@@ -99,6 +100,7 @@
'Email and SMS': 'Email e SMS',
'Email non valida': 'Email non valida',
'enter a number between %(min)g and %(max)g': 'enter a number between %(min)g and %(max)g',
'Enter an integer between %(min)g and %(max)g': 'Enter an integer between %(min)g and %(max)g',
'enter an integer between %(min)g and %(max)g': 'inserisci un intero tra %(min)g e %(max)g',
'Errors': 'Errori',
'Errors in form, please check it out.': 'Errori nel form, ricontrollalo',
@@ -110,6 +112,7 @@
'Forms and Validators': 'Forms and Validators',
'Free Applications': 'Free Applications',
'Graph Model': 'Graph Model',
'Grid Example': 'Grid Example',
'Group %(group_id)s created': 'Group %(group_id)s created',
'Group ID': 'ID Gruppo',
'Group uniquely assigned to user %(id)s': 'Group uniquely assigned to user %(id)s',
@@ -226,6 +229,7 @@
'Semantic': 'Semantic',
'Services': 'Servizi',
'Sign Up': 'Sign Up',
'Sign up': 'Sign up',
'Size of cache:': 'Size of cache:',
'starts with': 'comincia con',
'state': 'stato',
@@ -273,6 +277,7 @@
'Welcome to web2py': 'Benvenuto su web2py',
'Welcome to web2py!': 'Benvenuto in web2py!',
'Which called the function %s located in the file %s': 'che ha chiamato la funzione %s presente nel file %s',
'Wiki Example': 'Wiki Example',
'Working...': 'Working...',
'XML': 'XML',
'You are successfully running web2py': 'Stai eseguendo web2py con successo',