Last active
August 29, 2015 13:56
-
-
Save plq/9025184 to your computer and use it in GitHub Desktop.
question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from spyne.application import Application | |
from spyne.decorator import rpc | |
from spyne.service import ServiceBase | |
from spyne.protocol.soap import Soap11 | |
from spyne.model.primitive import String, Integer | |
from spyne.model.complex import ComplexModel | |
class DatosFac(ComplexModel): | |
__namespace__ = 'facturamanager.datosfac' | |
numero = String(pattern=r'[A-Z]/[0-9]+') | |
class FacturaService(ServiceBase): | |
@rpc(String, DatosFac, _returns=Integer) | |
def updateFacData(self, numero, data): | |
# do stuff | |
return 1 | |
application = Application([FacturaService], 'facturaManager.service', | |
in_protocol=Soap11(validator='lxml'), | |
out_protocol=Soap11() | |
) | |
from spyne.server.null import NullServer | |
s = NullServer(application) | |
data = s.factory.create('DatosFac') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment