ZSI-services
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@181 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
parent
4a8a10548a
commit
2c8c2228c0
8 changed files with 159 additions and 636 deletions
8
backend/src/BusinessMethods.py
Normal file
8
backend/src/BusinessMethods.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# Business methoden
|
||||
#
|
||||
def login(login, password):
|
||||
if (('jan' == login) and ('jan' == password)):
|
||||
return 'XXX'
|
||||
else:
|
||||
return None
|
|
@ -6,9 +6,7 @@
|
|||
|
||||
from ZSI.ServiceContainer import ServiceContainer
|
||||
from ZSI.dispatch import SOAPRequestHandler
|
||||
from gnuviechadminCommon.gnuviechadmin_services_server import *
|
||||
|
||||
service = gnuviechadmin()
|
||||
from gnuviechadmin_services_server import *
|
||||
|
||||
class mySOAPRequestHandler(SOAPRequestHandler):
|
||||
'''
|
||||
|
@ -20,7 +18,13 @@ class mySOAPRequestHandler(SOAPRequestHandler):
|
|||
'''
|
||||
self.send_xml(service._wsdl)
|
||||
|
||||
def AsServer(iporhost='', port=80, services=(), RequestHandlerClass=SOAPRequestHandler):
|
||||
def AsServer(iporhost='', port=80, services=(),
|
||||
RequestHandlerClass=SOAPRequestHandler):
|
||||
"""
|
||||
iporhost -- IP address or hostname to bind to
|
||||
port -- TCP port
|
||||
services -- list of service instances
|
||||
"""
|
||||
address = (iporhost, port)
|
||||
sc = ServiceContainer(address, RequestHandlerClass=RequestHandlerClass)
|
||||
for service in services:
|
||||
|
@ -28,6 +32,8 @@ def AsServer(iporhost='', port=80, services=(), RequestHandlerClass=SOAPRequestH
|
|||
sc.setNode(service, path)
|
||||
sc.serve_forever()
|
||||
|
||||
service = gnuviechadmin()
|
||||
|
||||
if __name__ == '__main__':
|
||||
AsServer(iporhost='localhost', port=8080, services=[service],
|
||||
RequestHandlerClass=mySOAPRequestHandler)
|
||||
|
|
74
backend/src/gnuviechadmin_services_server.py
Normal file
74
backend/src/gnuviechadmin_services_server.py
Normal file
|
@ -0,0 +1,74 @@
|
|||
from gnuviechadminCommon.gnuviechadmin_services import *
|
||||
from ZSI.ServiceContainer import ServiceSOAPBinding
|
||||
import BusinessMethods
|
||||
|
||||
class gnuviechadmin(ServiceSOAPBinding):
|
||||
soapAction = {
|
||||
'https://ssl.gnuviech.info/gnuviechadmin/Authenticate': 'soap_Authenticate',
|
||||
}
|
||||
_wsdl = """<?xml version=\"1.0\" ?>
|
||||
<!--
|
||||
Webservice description for gnuviechadmin
|
||||
(c) 2006 Jan Dittberner <jan@dittberner.info>
|
||||
Version: $Id: gnuviechadmin.wsdl 863 2006-03-07 22:26:55Z jan $
|
||||
--><wsdl:definitions name=\"gnuviechadmin\" targetNamespace=\"https://ssl.gnuviech.info/gnuviechadmin/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:tns=\"https://ssl.gnuviech.info/gnuviechadmin/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
|
||||
<wsdl:types>
|
||||
<xsd:schema targetNamespace=\"https://ssl.gnuviech.info/gnuviechadmin/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
|
||||
<xsd:element name=\"AuthCode\" type=\"xsd:string\"/>
|
||||
<xsd:element name=\"LoginInfo\">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs=\"1\" minOccurs=\"1\">
|
||||
<xsd:element name=\"login\" type=\"xsd:string\"/>
|
||||
<xsd:element name=\"password\" type=\"xsd:string\"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name=\"AuthResponse\">
|
||||
<wsdl:part element=\"tns:AuthCode\" name=\"AuthResponse\"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name=\"AuthRequest\">
|
||||
<wsdl:part element=\"tns:LoginInfo\" name=\"AuthRequest\"/>
|
||||
</wsdl:message>
|
||||
<wsdl:portType name=\"gnuviechadmin\">
|
||||
<wsdl:operation name=\"Authenticate\">
|
||||
<wsdl:input message=\"tns:AuthRequest\"/>
|
||||
<wsdl:output message=\"tns:AuthResponse\"/>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name=\"gnuviechadminSOAP\" type=\"tns:gnuviechadmin\">
|
||||
<soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>
|
||||
<wsdl:operation name=\"Authenticate\">
|
||||
<soap:operation soapAction=\"https://ssl.gnuviech.info/gnuviechadmin/Authenticate\"/>
|
||||
<wsdl:input>
|
||||
<soap:body parts=\" AuthRequest\" use=\"literal\"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body parts=\" AuthResponse\" use=\"literal\"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name=\"gnuviechadmin\">
|
||||
<wsdl:port binding=\"tns:gnuviechadminSOAP\" name=\"gnuviechadminSOAP\">
|
||||
<soap:address location=\"https://ssl.gnuviech.info/gnuviechadmin\"/>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>"""
|
||||
|
||||
def __init__(self, post='/gnuviechadmin', **kw):
|
||||
ServiceSOAPBinding.__init__(self, post)
|
||||
|
||||
|
||||
def soap_Authenticate(self, ps):
|
||||
# input vals in request object
|
||||
args = ps.Parse( AuthRequestWrapper )
|
||||
|
||||
# assign return values to response object
|
||||
class SimpleTypeWrapper(str): typecode = AuthResponseWrapper()
|
||||
|
||||
# WARNING specify value eg. SimpleTypeWrapper(1)
|
||||
response = SimpleTypeWrapper(BusinessMethods.login(login=args._login, password=args._password))
|
||||
|
||||
# Return the response
|
||||
return response
|
|
@ -5,141 +5,51 @@
|
|||
Version: $Id$
|
||||
-->
|
||||
<wsdl:definitions name="gnuviechadmin"
|
||||
targetNamespace="https://ssl.gnuviech.info/gnuviechadmin/"
|
||||
xmlns:tns="https://ssl.gnuviech.info/gnuviechadmin/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="https://ssl.gnuviech.info/gnuviechadmin/">
|
||||
<xsd:element name="AuthCode" type="xsd:string" />
|
||||
<xsd:element name="LoginInfo" type="tns:LoginInfo" />
|
||||
<xsd:complexType name="LoginInfo">
|
||||
<xsd:sequence maxOccurs="1" minOccurs="1">
|
||||
<xsd:element name="login" type="xsd:string" />
|
||||
<xsd:element name="password" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="DomainList" type="tns:DomainList" />
|
||||
<xsd:complexType name="DomainList">
|
||||
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
||||
<xsd:element name="domain" type="tns:Domain" />
|
||||
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="ListMailAliasesResponse"
|
||||
type="tns:MailAliasList" />
|
||||
<xsd:element name="ListMailAliasesRequest">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs="1" minOccurs="1">
|
||||
<xsd:element name="AuthCode" type="xsd:string" />
|
||||
<xsd:element name="DomainName"
|
||||
type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:complexType name="Domain">
|
||||
<xsd:sequence minOccurs="1" maxOccurs="1">
|
||||
<xsd:element name="domainName" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="MailAlias">
|
||||
<xsd:sequence maxOccurs="1" minOccurs="1">
|
||||
<xsd:element name="alias" type="xsd:string" />
|
||||
<xsd:element name="target" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="MailAliasList">
|
||||
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
||||
<xsd:element name="alias" type="tns:MailAlias" />
|
||||
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="AuthResponse">
|
||||
<wsdl:part name="AuthResponse" element="tns:AuthCode" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="AuthRequest">
|
||||
<wsdl:part name="AuthRequest" element="tns:LoginInfo" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ListDomainsResponse">
|
||||
<wsdl:part name="ListDomainsResponse" element="tns:DomainList" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ListDomainsRequest">
|
||||
<wsdl:part name="ListDomainsRequest" element="tns:AuthCode" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ListMailAliasesResponse">
|
||||
<wsdl:part name="ListMailAliasesResponse"
|
||||
element="tns:ListMailAliasesResponse" />
|
||||
|
||||
</wsdl:message>
|
||||
<wsdl:message name="ListMailAliasesRequest">
|
||||
<wsdl:part name="ListMailAliasesRequest"
|
||||
element="tns:ListMailAliasesRequest" />
|
||||
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="gnuviechadmin">
|
||||
<wsdl:operation name="Authenticate">
|
||||
<wsdl:input message="tns:AuthRequest" />
|
||||
<wsdl:output message="tns:AuthResponse" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ListDomains">
|
||||
<wsdl:input message="tns:ListDomainsRequest" />
|
||||
<wsdl:output message="tns:ListDomainsResponse" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ListMailAliases">
|
||||
<wsdl:input message="tns:ListMailAliasesRequest" />
|
||||
<wsdl:output message="tns:ListMailAliasesResponse" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="gnuviechadminSOAP" type="tns:gnuviechadmin">
|
||||
<soap:binding style="document"
|
||||
transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="Authenticate">
|
||||
|
||||
<soap:operation
|
||||
soapAction="https://ssl.gnuviech.info/gnuviechadmin/Authenticate" />
|
||||
<wsdl:input>
|
||||
|
||||
<soap:body use="literal" parts=" AuthRequest" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
|
||||
<soap:body use="literal" parts=" AuthResponse" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ListDomains">
|
||||
<soap:operation
|
||||
soapAction="https://ssl.gnuviech.info/gnuviechadmin/ListDomains" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" parts=" ListDomainsRequest" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" parts=" ListDomainsResponse" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="ListMailAliases">
|
||||
<soap:operation
|
||||
soapAction="https://ssl.gnuviech.info/gnuviechadmin/ListMailAliases" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal"
|
||||
parts=" ListMailAliasesRequest" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal"
|
||||
parts=" ListMailAliasesResponse" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="gnuviechadmin">
|
||||
<wsdl:port name="gnuviechadminSOAP"
|
||||
binding="tns:gnuviechadminSOAP">
|
||||
<soap:address
|
||||
location="https://ssl.gnuviech.info/gnuviechadmin" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
targetNamespace="https://ssl.gnuviech.info/gnuviechadmin/"
|
||||
xmlns:tns="https://ssl.gnuviech.info/gnuviechadmin/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
|
||||
<wsdl:types>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="https://ssl.gnuviech.info/gnuviechadmin/">
|
||||
<xsd:element name="AuthCode" type="xsd:string" />
|
||||
<xsd:element name="LoginInfo">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs="1" minOccurs="1">
|
||||
<xsd:element name="login" type="xsd:string" />
|
||||
<xsd:element name="password" type="xsd:string" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="AuthResponse">
|
||||
<wsdl:part name="AuthResponse" element="tns:AuthCode" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="AuthRequest">
|
||||
<wsdl:part name="AuthRequest" element="tns:LoginInfo" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="gnuviechadmin">
|
||||
<wsdl:operation name="Authenticate">
|
||||
<wsdl:input message="tns:AuthRequest" />
|
||||
<wsdl:output message="tns:AuthResponse" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="gnuviechadminSOAP" type="tns:gnuviechadmin">
|
||||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="Authenticate">
|
||||
<soap:operation soapAction="https://ssl.gnuviech.info/gnuviechadmin/Authenticate" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" parts=" AuthRequest" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" parts=" AuthResponse" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="gnuviechadmin">
|
||||
<wsdl:port name="gnuviechadminSOAP" binding="tns:gnuviechadminSOAP">
|
||||
<soap:address location="https://ssl.gnuviech.info/gnuviechadmin" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
##################################################
|
||||
# gnuviechadmin-common/gnuviechadmin_services.py
|
||||
# src/gnuviechadminCommon/gnuviechadmin_services.py
|
||||
# generated by ZSI.wsdl2python
|
||||
#
|
||||
#
|
||||
|
@ -44,7 +44,8 @@ class gnuviechadminSOAPSOAP:
|
|||
def Authenticate(self, request):
|
||||
"""
|
||||
@param: request to AuthRequest::
|
||||
_LoginInfo: ns1.LoginInfo_Def
|
||||
_login: str
|
||||
_password: str
|
||||
|
||||
@return: response is str
|
||||
"""
|
||||
|
@ -61,52 +62,6 @@ class gnuviechadminSOAPSOAP:
|
|||
return response
|
||||
|
||||
|
||||
def ListDomains(self, request):
|
||||
"""
|
||||
@param: request is str
|
||||
|
||||
@return: response from ListDomainsResponse::
|
||||
_DomainList: ns1.DomainList_Def
|
||||
"""
|
||||
|
||||
if not isinstance(request, basestring):
|
||||
raise TypeError, "%s incorrect request type" %(request.__class__)
|
||||
kw = {'requestclass': ListDomainsRequestWrapper}
|
||||
response = self.binding.Send(None, None, request, soapaction="https://ssl.gnuviech.info/gnuviechadmin/ListDomains", **kw)
|
||||
response = self.binding.Receive(ListDomainsResponseWrapper())
|
||||
|
||||
if not isinstance(response, ListDomainsResponse) and\
|
||||
not issubclass(ListDomainsResponse, response.__class__):
|
||||
raise TypeError, "%s incorrect response type" %(response.__class__)
|
||||
return response
|
||||
|
||||
|
||||
def ListMailAliases(self, request):
|
||||
"""
|
||||
@param: request to ListMailAliasesRequest::
|
||||
_AuthCode: str
|
||||
_DomainName: str
|
||||
|
||||
@return: response from ListMailAliasesResponse::
|
||||
_ListMailAliasesResponse: ns1.MailAliasList_Def
|
||||
_alias: ns1.MailAlias_Def
|
||||
_alias: str
|
||||
_target: str
|
||||
"""
|
||||
|
||||
if not isinstance(request, ListMailAliasesRequest) and\
|
||||
not issubclass(ListMailAliasesRequest, request.__class__):
|
||||
raise TypeError, "%s incorrect request type" %(request.__class__)
|
||||
kw = {}
|
||||
response = self.binding.Send(None, None, request, soapaction="https://ssl.gnuviech.info/gnuviechadmin/ListMailAliases", **kw)
|
||||
response = self.binding.Receive(ListMailAliasesResponseWrapper())
|
||||
|
||||
if not isinstance(response, ListMailAliasesResponse) and\
|
||||
not issubclass(ListMailAliasesResponse, response.__class__):
|
||||
raise TypeError, "%s incorrect response type" %(response.__class__)
|
||||
return response
|
||||
|
||||
|
||||
|
||||
class AuthRequest(ns1.LoginInfo_Dec):
|
||||
if not hasattr( ns1.LoginInfo_Dec(), "typecode" ):
|
||||
|
@ -135,59 +90,3 @@ class AuthResponseWrapper(AuthResponse):
|
|||
typecode = AuthResponse( name=None, ns=None ).typecode
|
||||
def __init__( self, name=None, ns=None, **kw ):
|
||||
AuthResponse.__init__( self, name=None, ns=None )
|
||||
|
||||
class ListDomainsRequest(ns1.AuthCode_Dec):
|
||||
if not hasattr( ns1.AuthCode_Dec(), "typecode" ):
|
||||
typecode = ns1.AuthCode_Dec()
|
||||
|
||||
def __init__(self, name=None, ns=None):
|
||||
ns1.AuthCode_Dec.__init__(self, name=None, ns=None)
|
||||
|
||||
class ListDomainsRequestWrapper(ListDomainsRequest):
|
||||
"""wrapper for document:literal message"""
|
||||
|
||||
typecode = ListDomainsRequest( name=None, ns=None ).typecode
|
||||
def __init__( self, name=None, ns=None, **kw ):
|
||||
ListDomainsRequest.__init__( self, name=None, ns=None )
|
||||
|
||||
class ListDomainsResponse(ns1.DomainList_Dec):
|
||||
if not hasattr( ns1.DomainList_Dec(), "typecode" ):
|
||||
typecode = ns1.DomainList_Dec()
|
||||
|
||||
def __init__(self, name=None, ns=None):
|
||||
ns1.DomainList_Dec.__init__(self, name=None, ns=None)
|
||||
|
||||
class ListDomainsResponseWrapper(ListDomainsResponse):
|
||||
"""wrapper for document:literal message"""
|
||||
|
||||
typecode = ListDomainsResponse( name=None, ns=None ).typecode
|
||||
def __init__( self, name=None, ns=None, **kw ):
|
||||
ListDomainsResponse.__init__( self, name=None, ns=None )
|
||||
|
||||
class ListMailAliasesRequest(ns1.ListMailAliasesRequest_Dec):
|
||||
if not hasattr( ns1.ListMailAliasesRequest_Dec(), "typecode" ):
|
||||
typecode = ns1.ListMailAliasesRequest_Dec()
|
||||
|
||||
def __init__(self, name=None, ns=None):
|
||||
ns1.ListMailAliasesRequest_Dec.__init__(self, name=None, ns=None)
|
||||
|
||||
class ListMailAliasesRequestWrapper(ListMailAliasesRequest):
|
||||
"""wrapper for document:literal message"""
|
||||
|
||||
typecode = ListMailAliasesRequest( name=None, ns=None ).typecode
|
||||
def __init__( self, name=None, ns=None, **kw ):
|
||||
ListMailAliasesRequest.__init__( self, name=None, ns=None )
|
||||
|
||||
class ListMailAliasesResponse(ns1.ListMailAliasesResponse_Dec):
|
||||
if not hasattr( ns1.ListMailAliasesResponse_Dec(), "typecode" ):
|
||||
typecode = ns1.ListMailAliasesResponse_Dec()
|
||||
|
||||
def __init__(self, name=None, ns=None):
|
||||
ns1.ListMailAliasesResponse_Dec.__init__(self, name=None, ns=None)
|
||||
|
||||
class ListMailAliasesResponseWrapper(ListMailAliasesResponse):
|
||||
"""wrapper for document:literal message"""
|
||||
|
||||
typecode = ListMailAliasesResponse( name=None, ns=None ).typecode
|
||||
def __init__( self, name=None, ns=None, **kw ):
|
||||
ListMailAliasesResponse.__init__( self, name=None, ns=None )
|
||||
|
|
|
@ -1,172 +0,0 @@
|
|||
from gnuviechadmin_services import *
|
||||
from ZSI.ServiceContainer import ServiceSOAPBinding
|
||||
|
||||
class gnuviechadmin(ServiceSOAPBinding):
|
||||
soapAction = {
|
||||
'https://ssl.gnuviech.info/gnuviechadmin/Authenticate': 'soap_Authenticate',
|
||||
'https://ssl.gnuviech.info/gnuviechadmin/ListDomains': 'soap_ListDomains',
|
||||
'https://ssl.gnuviech.info/gnuviechadmin/ListMailAliases': 'soap_ListMailAliases',
|
||||
}
|
||||
_wsdl = """<?xml version=\"1.0\" ?>
|
||||
<!--
|
||||
Webservice description for gnuviechadmin
|
||||
(c) 2006 Jan Dittberner <jan@dittberner.info>
|
||||
Version: $Id: gnuviechadmin.wsdl 862 2006-03-07 15:02:39Z jan $
|
||||
--><wsdl:definitions name=\"gnuviechadmin\" targetNamespace=\"https://ssl.gnuviech.info/gnuviechadmin/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:tns=\"https://ssl.gnuviech.info/gnuviechadmin/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
|
||||
<wsdl:types>
|
||||
<xsd:schema targetNamespace=\"https://ssl.gnuviech.info/gnuviechadmin/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
|
||||
<xsd:element name=\"AuthCode\" type=\"xsd:string\"/>
|
||||
<xsd:element name=\"LoginInfo\" type=\"tns:LoginInfo\"/>
|
||||
<xsd:complexType name=\"LoginInfo\">
|
||||
<xsd:sequence maxOccurs=\"1\" minOccurs=\"1\">
|
||||
<xsd:element name=\"login\" type=\"xsd:string\"/>
|
||||
<xsd:element name=\"password\" type=\"xsd:string\"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name=\"DomainList\" type=\"tns:DomainList\"/>
|
||||
<xsd:complexType name=\"DomainList\">
|
||||
<xsd:sequence maxOccurs=\"unbounded\" minOccurs=\"0\">
|
||||
<xsd:element name=\"domain\" type=\"tns:Domain\"/>
|
||||
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name=\"ListMailAliasesResponse\" type=\"tns:MailAliasList\"/>
|
||||
<xsd:element name=\"ListMailAliasesRequest\">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs=\"1\" minOccurs=\"1\">
|
||||
<xsd:element name=\"AuthCode\" type=\"xsd:string\"/>
|
||||
<xsd:element name=\"DomainName\" type=\"xsd:string\"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:complexType name=\"Domain\">
|
||||
<xsd:sequence maxOccurs=\"1\" minOccurs=\"1\">
|
||||
<xsd:element name=\"domainName\" type=\"xsd:string\"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name=\"MailAlias\">
|
||||
<xsd:sequence maxOccurs=\"1\" minOccurs=\"1\">
|
||||
<xsd:element name=\"alias\" type=\"xsd:string\"/>
|
||||
<xsd:element name=\"target\" type=\"xsd:string\"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name=\"MailAliasList\">
|
||||
<xsd:sequence maxOccurs=\"unbounded\" minOccurs=\"0\">
|
||||
<xsd:element name=\"alias\" type=\"tns:MailAlias\"/>
|
||||
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name=\"AuthResponse\">
|
||||
<wsdl:part element=\"tns:AuthCode\" name=\"AuthResponse\"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name=\"AuthRequest\">
|
||||
<wsdl:part element=\"tns:LoginInfo\" name=\"AuthRequest\"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name=\"ListDomainsResponse\">
|
||||
<wsdl:part element=\"tns:DomainList\" name=\"ListDomainsResponse\"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name=\"ListDomainsRequest\">
|
||||
<wsdl:part element=\"tns:AuthCode\" name=\"ListDomainsRequest\"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name=\"ListMailAliasesResponse\">
|
||||
<wsdl:part element=\"tns:ListMailAliasesResponse\" name=\"ListMailAliasesResponse\"/>
|
||||
|
||||
</wsdl:message>
|
||||
<wsdl:message name=\"ListMailAliasesRequest\">
|
||||
<wsdl:part element=\"tns:ListMailAliasesRequest\" name=\"ListMailAliasesRequest\"/>
|
||||
|
||||
</wsdl:message>
|
||||
<wsdl:portType name=\"gnuviechadmin\">
|
||||
<wsdl:operation name=\"Authenticate\">
|
||||
<wsdl:input message=\"tns:AuthRequest\"/>
|
||||
<wsdl:output message=\"tns:AuthResponse\"/>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name=\"ListDomains\">
|
||||
<wsdl:input message=\"tns:ListDomainsRequest\"/>
|
||||
<wsdl:output message=\"tns:ListDomainsResponse\"/>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name=\"ListMailAliases\">
|
||||
<wsdl:input message=\"tns:ListMailAliasesRequest\"/>
|
||||
<wsdl:output message=\"tns:ListMailAliasesResponse\"/>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name=\"gnuviechadminSOAP\" type=\"tns:gnuviechadmin\">
|
||||
<soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>
|
||||
<wsdl:operation name=\"Authenticate\">
|
||||
|
||||
<soap:operation soapAction=\"https://ssl.gnuviech.info/gnuviechadmin/Authenticate\"/>
|
||||
<wsdl:input>
|
||||
|
||||
<soap:body parts=\" AuthRequest\" use=\"literal\"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
|
||||
<soap:body parts=\" AuthResponse\" use=\"literal\"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name=\"ListDomains\">
|
||||
<soap:operation soapAction=\"https://ssl.gnuviech.info/gnuviechadmin/ListDomains\"/>
|
||||
<wsdl:input>
|
||||
<soap:body parts=\" ListDomainsRequest\" use=\"literal\"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body parts=\" ListDomainsResponse\" use=\"literal\"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name=\"ListMailAliases\">
|
||||
<soap:operation soapAction=\"https://ssl.gnuviech.info/gnuviechadmin/ListMailAliases\"/>
|
||||
<wsdl:input>
|
||||
<soap:body parts=\" ListMailAliasesRequest\" use=\"literal\"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body parts=\" ListMailAliasesResponse\" use=\"literal\"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name=\"gnuviechadmin\">
|
||||
<wsdl:port binding=\"tns:gnuviechadminSOAP\" name=\"gnuviechadminSOAP\">
|
||||
<soap:address location=\"https://ssl.gnuviech.info/gnuviechadmin\"/>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>"""
|
||||
|
||||
def __init__(self, post='/gnuviechadmin', **kw):
|
||||
ServiceSOAPBinding.__init__(self, post)
|
||||
|
||||
|
||||
def soap_Authenticate(self, ps):
|
||||
# input vals in request object
|
||||
args = ps.Parse( AuthRequestWrapper )
|
||||
|
||||
# assign return values to response object
|
||||
class SimpleTypeWrapper(str): typecode = AuthResponseWrapper()
|
||||
|
||||
# WARNING specify value eg. SimpleTypeWrapper(1)
|
||||
response = SimpleTypeWrapper()
|
||||
|
||||
# Return the response
|
||||
return response
|
||||
|
||||
def soap_ListDomains(self, ps):
|
||||
# input vals in request object
|
||||
args = ps.Parse( ListDomainsRequestWrapper )
|
||||
|
||||
# assign return values to response object
|
||||
response = ListDomainsResponseWrapper()
|
||||
|
||||
# Return the response
|
||||
return response
|
||||
|
||||
def soap_ListMailAliases(self, ps):
|
||||
# input vals in request object
|
||||
args = ps.Parse( ListMailAliasesRequestWrapper )
|
||||
|
||||
# assign return values to response object
|
||||
response = ListMailAliasesResponseWrapper()
|
||||
|
||||
# Return the response
|
||||
return response
|
|
@ -1,5 +1,5 @@
|
|||
##################################################
|
||||
# gnuviechadmin-common/gnuviechadmin_services_types.py
|
||||
# src/gnuviechadminCommon/gnuviechadmin_services_types.py
|
||||
# generated by ZSI.wsdl2python
|
||||
#
|
||||
#
|
||||
|
@ -20,43 +20,14 @@ from ZSI.TCcompound import Struct
|
|||
class https___ssl_gnuviech_info_gnuviechadmin:
|
||||
targetNamespace = 'https://ssl.gnuviech.info/gnuviechadmin/'
|
||||
|
||||
class Domain_Def(ZSI.TCcompound.Struct):
|
||||
class LoginInfo_Dec(ZSI.TCcompound.Struct):
|
||||
schema = 'https://ssl.gnuviech.info/gnuviechadmin/'
|
||||
type = 'Domain'
|
||||
literal = 'LoginInfo'
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
# internal vars
|
||||
self._domainName = None
|
||||
name = name or self.__class__.literal
|
||||
ns = ns or self.__class__.schema
|
||||
|
||||
TClist = [ZSI.TC.String(pname="domainName",aname="_domainName"), ]
|
||||
|
||||
oname = name
|
||||
|
||||
if name:
|
||||
aname = '_%s' % name
|
||||
if ns:
|
||||
oname += ' xmlns="%s"' % ns
|
||||
else:
|
||||
oname += ' xmlns="%s"' % self.__class__.schema
|
||||
else:
|
||||
aname = None
|
||||
|
||||
ZSI.TCcompound.Struct.__init__(self, self.__class__, TClist,
|
||||
pname=name, inorder=0,
|
||||
aname=aname, oname=oname,
|
||||
**kw)
|
||||
def Get_domainName(self):
|
||||
return self._domainName
|
||||
|
||||
def Set_domainName(self,_domainName):
|
||||
self._domainName = _domainName
|
||||
|
||||
|
||||
class LoginInfo_Def(ZSI.TCcompound.Struct):
|
||||
schema = 'https://ssl.gnuviech.info/gnuviechadmin/'
|
||||
type = 'LoginInfo'
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
# internal vars
|
||||
self._login = None
|
||||
self._password = None
|
||||
|
@ -91,184 +62,6 @@ class https___ssl_gnuviech_info_gnuviechadmin:
|
|||
self._password = _password
|
||||
|
||||
|
||||
class MailAlias_Def(ZSI.TCcompound.Struct):
|
||||
schema = 'https://ssl.gnuviech.info/gnuviechadmin/'
|
||||
type = 'MailAlias'
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
# internal vars
|
||||
self._alias = None
|
||||
self._target = None
|
||||
|
||||
TClist = [ZSI.TC.String(pname="alias",aname="_alias"), ZSI.TC.String(pname="target",aname="_target"), ]
|
||||
|
||||
oname = name
|
||||
|
||||
if name:
|
||||
aname = '_%s' % name
|
||||
if ns:
|
||||
oname += ' xmlns="%s"' % ns
|
||||
else:
|
||||
oname += ' xmlns="%s"' % self.__class__.schema
|
||||
else:
|
||||
aname = None
|
||||
|
||||
ZSI.TCcompound.Struct.__init__(self, self.__class__, TClist,
|
||||
pname=name, inorder=0,
|
||||
aname=aname, oname=oname,
|
||||
**kw)
|
||||
def Get_alias(self):
|
||||
return self._alias
|
||||
|
||||
def Set_alias(self,_alias):
|
||||
self._alias = _alias
|
||||
|
||||
def Get_target(self):
|
||||
return self._target
|
||||
|
||||
def Set_target(self,_target):
|
||||
self._target = _target
|
||||
|
||||
|
||||
class ListMailAliasesRequest_Dec(ZSI.TCcompound.Struct):
|
||||
schema = 'https://ssl.gnuviech.info/gnuviechadmin/'
|
||||
literal = 'ListMailAliasesRequest'
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
name = name or self.__class__.literal
|
||||
ns = ns or self.__class__.schema
|
||||
|
||||
# internal vars
|
||||
self._AuthCode = None
|
||||
self._DomainName = None
|
||||
|
||||
TClist = [ZSI.TC.String(pname="AuthCode",aname="_AuthCode"), ZSI.TC.String(pname="DomainName",aname="_DomainName"), ]
|
||||
|
||||
oname = name
|
||||
|
||||
if name:
|
||||
aname = '_%s' % name
|
||||
if ns:
|
||||
oname += ' xmlns="%s"' % ns
|
||||
else:
|
||||
oname += ' xmlns="%s"' % self.__class__.schema
|
||||
else:
|
||||
aname = None
|
||||
|
||||
ZSI.TCcompound.Struct.__init__(self, self.__class__, TClist,
|
||||
pname=name, inorder=0,
|
||||
aname=aname, oname=oname,
|
||||
**kw)
|
||||
def Get_AuthCode(self):
|
||||
return self._AuthCode
|
||||
|
||||
def Set_AuthCode(self,_AuthCode):
|
||||
self._AuthCode = _AuthCode
|
||||
|
||||
def Get_DomainName(self):
|
||||
return self._DomainName
|
||||
|
||||
def Set_DomainName(self,_DomainName):
|
||||
self._DomainName = _DomainName
|
||||
|
||||
|
||||
class DomainList_Def(ZSI.TCcompound.Struct):
|
||||
schema = 'https://ssl.gnuviech.info/gnuviechadmin/'
|
||||
type = 'DomainList'
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
# internal vars
|
||||
self._domain = None
|
||||
|
||||
TClist = [ns1.Domain_Def(name="domain", ns=ns), ]
|
||||
|
||||
oname = name
|
||||
|
||||
if name:
|
||||
aname = '_%s' % name
|
||||
if ns:
|
||||
oname += ' xmlns="%s"' % ns
|
||||
else:
|
||||
oname += ' xmlns="%s"' % self.__class__.schema
|
||||
else:
|
||||
aname = None
|
||||
|
||||
ZSI.TCcompound.Struct.__init__(self, self.__class__, TClist,
|
||||
pname=name, inorder=0,
|
||||
aname=aname, oname=oname,
|
||||
**kw)
|
||||
def Get_domain(self):
|
||||
return self._domain
|
||||
|
||||
def Set_domain(self,_domain):
|
||||
self._domain = _domain
|
||||
|
||||
|
||||
class LoginInfo_Dec(LoginInfo_Def):
|
||||
literal = "LoginInfo"
|
||||
schema = "https://ssl.gnuviech.info/gnuviechadmin/"
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
name = name or self.__class__.literal
|
||||
ns = ns or self.__class__.schema
|
||||
|
||||
ns1.LoginInfo_Def.__init__(self, name=name, ns=ns, **kw)
|
||||
self.typecode = ns1.LoginInfo_Def(name=name, ns=ns, **kw)
|
||||
|
||||
class MailAliasList_Def(ZSI.TCcompound.Struct):
|
||||
schema = 'https://ssl.gnuviech.info/gnuviechadmin/'
|
||||
type = 'MailAliasList'
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
# internal vars
|
||||
self._alias = None
|
||||
|
||||
TClist = [ns1.MailAlias_Def(name="alias", ns=ns), ]
|
||||
|
||||
oname = name
|
||||
|
||||
if name:
|
||||
aname = '_%s' % name
|
||||
if ns:
|
||||
oname += ' xmlns="%s"' % ns
|
||||
else:
|
||||
oname += ' xmlns="%s"' % self.__class__.schema
|
||||
else:
|
||||
aname = None
|
||||
|
||||
ZSI.TCcompound.Struct.__init__(self, self.__class__, TClist,
|
||||
pname=name, inorder=0,
|
||||
aname=aname, oname=oname,
|
||||
**kw)
|
||||
def Get_alias(self):
|
||||
return self._alias
|
||||
|
||||
def Set_alias(self,_alias):
|
||||
self._alias = _alias
|
||||
|
||||
|
||||
class DomainList_Dec(DomainList_Def):
|
||||
literal = "DomainList"
|
||||
schema = "https://ssl.gnuviech.info/gnuviechadmin/"
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
name = name or self.__class__.literal
|
||||
ns = ns or self.__class__.schema
|
||||
|
||||
ns1.DomainList_Def.__init__(self, name=name, ns=ns, **kw)
|
||||
self.typecode = ns1.DomainList_Def(name=name, ns=ns, **kw)
|
||||
|
||||
class ListMailAliasesResponse_Dec(MailAliasList_Def):
|
||||
literal = "ListMailAliasesResponse"
|
||||
schema = "https://ssl.gnuviech.info/gnuviechadmin/"
|
||||
|
||||
def __init__(self, name=None, ns=None, **kw):
|
||||
name = name or self.__class__.literal
|
||||
ns = ns or self.__class__.schema
|
||||
|
||||
ns1.MailAliasList_Def.__init__(self, name=name, ns=ns, **kw)
|
||||
self.typecode = ns1.MailAliasList_Def(name=name, ns=ns, **kw)
|
||||
|
||||
class AuthCode_Dec(ZSI.TC.String):
|
||||
literal = "AuthCode"
|
||||
schema = "https://ssl.gnuviech.info/gnuviechadmin/"
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
#!/usr/bin/python
|
||||
from SOAPpy import SOAPProxy
|
||||
import sys
|
||||
import socket
|
||||
from ZSI import ServiceProxy
|
||||
|
||||
class SOAPClient:
|
||||
def __init__(self):
|
||||
self.server = SOAPProxy('http://localhost:8080/',
|
||||
namespace = 'urn:gnuviech-admin-services')
|
||||
url = 'http://localhost:8080/gnuviechadmin'
|
||||
self.service = ServiceProxy(url, use_wsdl=True,
|
||||
tracefile=sys.stdout)
|
||||
print 'service is ', self.service
|
||||
print self.service.__dict__
|
||||
|
||||
def echo(self, value):
|
||||
def authenticate(self, login, password):
|
||||
try:
|
||||
return self.server.echo(value);
|
||||
response = self.service.Authenticate(login=login, password=password)
|
||||
print response
|
||||
except socket.error:
|
||||
return "couldn't connect"
|
||||
|
||||
if __name__ == "__main__":
|
||||
if __name__ == "__main__":
|
||||
client = SOAPClient()
|
||||
print client.echo("Ein Test ")
|
||||
print client.authenticate("jan", "jan")
|
Loading…
Reference in a new issue