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
int increment(int x) { | |
return x+1; | |
} |
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 lxml import etree | |
from soapbox import xsd | |
class Actor(xsd.ComplexType): | |
name = xsd.Element(xsd.String) | |
role = xsd.Element(xsd.String) | |
class Actors(xsd.ComplexType): | |
actor = xsd.Element(Actor) |
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.model import Unicode | |
from spyne.protocol.soap.soap11 import Soap11 | |
from spyne.service import ServiceBase | |
class Customer(Unicode): | |
class Attributes(Unicode.Attributes): | |
min_len=1 |
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.model import ComplexModel, Unicode, Boolean | |
from spyne.protocol.soap.soap11 import Soap11 | |
from spyne.service import ServiceBase | |
import logging | |
logging.basicConfig(level=logging.WARN) | |
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
def validate_python(self, value, state): | |
import logging | |
log = logging.getLogger(__name__) | |
log.info('URIValidator: %r' % value) | |
try: | |
splitted_url = urlsplit(value) | |
except: | |
self.raise_error_bad_url(value, state) | |
scheme = splitted_url[0] # '.scheme' in Python 2.5+ | |
netloc = splitted_url[1] # '.netloc' in Python 2.5+ |