Permalink
Browse files

wsdl: fix up soap extension definitions.

Added various missing pieces according to these specifications:

- https://www.w3.org/tr/wsdl#_how-s
- https://www.w3.org/submission/wsdl11soap12/

Also attempted to reference the correct type classes.

Note that `<soap:fault>` will be included in a later commit.

License: BSD
  • Loading branch information...
pope1ni committed Mar 22, 2016
1 parent 58e7fc3 commit f11d48c757d2f3f293838b12ad4c8e659ca64fcc
Showing with 42 additions and 23 deletions.
  1. +2 −0 INFORMATION.md
  2. +28 −15 soapfish/wsdl11.py
  3. +10 −7 soapfish/wsdl12.py
  4. +2 −1 soapfish/xsd.py
View
@@ -24,3 +24,5 @@ Links to various specifications relevant to the project:
- [Web Services Architecture](https://www.w3.org/tr/ws-arch/)
- [Web Services Security 1.0](http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf)
- [Web Services Security 1.1](http://www.oasis-open.org/committees/download.php/16790/wss-v1.1-spec-os-SOAPMessageSecurity.pdf)
- [WSDL 1.1 Binding Extension for SOAP 1.2](https://www.w3.org/submission/wsdl11soap12/)
View
@@ -15,30 +15,44 @@
class SOAP_Binding(xsd.ComplexType):
ELEMENT_FORM_DEFAULT = xsd.ElementFormDefault.QUALIFIED
style = xsd.Attribute(xsd.String)
transport = xsd.Attribute(xsd.String)
style = xsd.Attribute(xsd.String(enumeration=['document', 'rpc']), default='document', use=xsd.Use.OPTIONAL)
transport = xsd.Attribute(xsd.AnyURI)
class SOAP_Operation(xsd.ComplexType):
ELEMENT_FORM_DEFAULT = xsd.ElementFormDefault.QUALIFIED
soapAction = xsd.Attribute(xsd.String)
style = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)
soapAction = xsd.Attribute(xsd.AnyURI, use=xsd.Use.OPTIONAL)
style = xsd.Attribute(xsd.String(enumeration=['document', 'rpc']), use=xsd.Use.OPTIONAL)
class SOAP_HeaderFault(xsd.ComplexType):
message = xsd.Attribute(xsd.QName)
part = xsd.Attribute(xsd.NMTOKEN)
use = xsd.Attribute(xsd.String(enumeration=['encoded', 'literal']))
namespace = xsd.Attribute(xsd.AnyURI, use=xsd.Use.OPTIONAL)
encodingStyle = xsd.Attribute(xsd.AnyURI, use=xsd.Use.OPTIONAL)
class SOAP_Header(xsd.ComplexType):
message = xsd.Attribute(xsd.String)
part = xsd.Attribute(xsd.String)
use = xsd.Attribute(xsd.String, use=xsd.Use.OPTIONAL)
message = xsd.Attribute(xsd.QName)
part = xsd.Attribute(xsd.NMTOKEN)
use = xsd.Attribute(xsd.String(enumeration=['encoded', 'literal']))
namespace = xsd.Attribute(xsd.AnyURI, use=xsd.Use.OPTIONAL)
encodingStyle = xsd.Attribute(xsd.AnyURI, use=xsd.Use.OPTIONAL)
headerfaults = xsd.ListElement(SOAP_HeaderFault, 'headerfault', minOccurs=0, namespace=ns.wsdl_soap)
class SOAP_Body(xsd.ComplexType):
ELEMENT_FORM_DEFAULT = xsd.ElementFormDefault.QUALIFIED
use = xsd.Attribute(xsd.String)
parts = xsd.Attribute(xsd.NMTOKENS, use=xsd.Use.OPTIONAL)
use = xsd.Attribute(xsd.String(enumeration=['encoded', 'literal']))
namespace = xsd.Attribute(xsd.AnyURI, use=xsd.Use.OPTIONAL)
encodingStyle = xsd.Attribute(xsd.AnyURI, use=xsd.Use.OPTIONAL)
class SOAP_Address(xsd.ComplexType):
ELEMENT_FORM_DEFAULT = xsd.ElementFormDefault.QUALIFIED
location = xsd.Attribute(xsd.String)
location = xsd.Attribute(xsd.AnyURI)
# WSDL 1.1 SOAP 1.1
@@ -74,8 +88,8 @@ class Input(xsd.ComplexType):
documentation = xsd.Element(xsd.String, minOccurs=0)
# Extensibility Elements:
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap, minOccurs=0)
headers = xsd.ListElement(SOAP_Header, 'header', minOccurs=0)
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap)
headers = xsd.ListElement(SOAP_Header, 'header', minOccurs=0, namespace=ns.wsdl_soap)
class Output(xsd.ComplexType):
@@ -84,8 +98,8 @@ class Output(xsd.ComplexType):
documentation = xsd.Element(xsd.String, minOccurs=0)
# Extensibility Elements:
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap, minOccurs=0)
headers = xsd.ListElement(SOAP_Header, 'header', minOccurs=0)
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap)
headers = xsd.ListElement(SOAP_Header, 'header', minOccurs=0, namespace=ns.wsdl_soap)
class Operation(xsd.ComplexType):
@@ -95,8 +109,7 @@ class Operation(xsd.ComplexType):
documentation = xsd.Element(xsd.String, minOccurs=0)
# Extensibility Elements:
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap)
operation = xsd.Element(SOAP_Operation, namespace=ns.wsdl_soap)
operation = xsd.Element(SOAP_Operation, minOccurs=0, namespace=ns.wsdl_soap)
class PortType(xsd.ComplexType):
View
@@ -12,11 +12,15 @@ class SOAP_Binding(wsdl11.SOAP_Binding):
class SOAP_Operation(wsdl11.SOAP_Operation):
soapActionRequired = xsd.Attribute(xsd.Boolean, use=xsd.Use.OPTIONAL)
class SOAP_HeaderFault(wsdl11.SOAP_HeaderFault):
pass
class SOAP_Header(wsdl11.SOAP_Header):
pass
headerfaults = xsd.ListElement(SOAP_HeaderFault, 'headerfault', minOccurs=0, namespace=ns.wsdl_soap12)
class SOAP_Body(wsdl11.SOAP_Body):
@@ -44,23 +48,22 @@ class Message(wsdl11.Message):
class Input(wsdl11.Input):
# Extensibility Elements:
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap12, minOccurs=0)
headers = xsd.ListElement(SOAP_Header, 'header', minOccurs=0)
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap12)
headers = xsd.ListElement(SOAP_Header, 'header', minOccurs=0, namespace=ns.wsdl_soap12)
class Output(wsdl11.Output):
# Extensibility Elements:
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap12, minOccurs=0)
headers = xsd.ListElement(SOAP_Header, 'header', minOccurs=0)
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap12)
headers = xsd.ListElement(SOAP_Header, 'header', minOccurs=0, namespace=ns.wsdl_soap12)
class Operation(wsdl11.Operation):
input = xsd.Element(Input, minOccurs=0)
output = xsd.Element(Output, minOccurs=0)
# Extensibility Elements:
body = xsd.Element(SOAP_Body, namespace=ns.wsdl_soap12)
operation = xsd.Element(SOAP_Operation, namespace=ns.wsdl_soap12)
operation = xsd.Element(SOAP_Operation, minOccurs=0, namespace=ns.wsdl_soap12)
class PortType(wsdl11.PortType):
View
@@ -68,7 +68,7 @@
class CallStyle(object):
DOCUMENT = 'document'
RPC = 'RPC'
RPC = 'rpc'
class Use(object):
@@ -1107,6 +1107,7 @@ class NMTOKEN(String):
pass
# TODO: Replace this with xsd.List(xsd.NMTOKEN)
class NMTOKENS(String):
pass

0 comments on commit f11d48c

Please sign in to comment.