This is the original webservice:
https://wswhomo.afip.gov.ar/wsfev1/service.asmx?WSDL
And this is the "simulator" made with web2py:
http://www.sistemasagiles.com.ar/simulador/wsfev1/call/soap
Attached is the web2py sample controller
Steps:
1. Analyse the original web service description:
client = SoapClient(wsdl="
https://wswhomo.afip.gov.ar/wsfev1/service.asmx?WSDL")
2. Extract the input and output structures
client.services['Service']['ports']['ServiceSoap12']['operations']['FECAESolicitar']['input']
client.services['Service']['ports']['ServiceSoap12']['operations']['FECAESolicitar']['output']
The returned structures are {'FECAESolicitar': *{u'Auth': *{u'Token':
<type 'unicode'>, u'Sign': <type 'unicode'>, u'Cuit': <type 'long'>}*,
u'FeCAEReq': *{u'FeCabReq': *{u'CantReg': <type 'int'>, ... , you need
to do some clean up (for example, replace <type 'unicode'> with just
unicode, remove the * that marks an ordered dict, etc.)
3. Decorate your function accordingly
@service.soap('FECAESolicitar',
returns={'FECAESolicitarResult': {...},
args={
'Auth': {'Token': str, 'Sign': str, 'Cuit': str},
...}
4. Modify the original WSDL with the web2py location and test
To go further, you may need to adjust some xml parameters like the
namepaces, prefixes, and so on, to reproduce the exact behaviour of
the original webservice, it may be tricky but it should be doable.
Best regards.
On Wed, Jun 19, 2013 at 8:17 AM, Massimo Di Pierro