Documentation
¶
Overview ¶
Package wsdl provides Web Services Description Language (WSDL) decoder.
Index ¶
- type Address
- type AnyElement
- type Attribute
- type Binding
- type BindingIO
- type BindingOperation
- type BindingType
- type Choice
- type ComplexContent
- type ComplexType
- type Definitions
- type Element
- type Enum
- type Extension
- type IO
- type Import
- type ImportSchema
- type IncludeSchema
- type Message
- type Operation
- type Part
- type Port
- type PortType
- type Restriction
- type SOAP11Operation
- type SOAP12Operation
- type Schema
- type Sequence
- type Service
- type SimpleType
- type Union
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnyElement ¶ added in v1.4.4
type AnyElement struct {
XMLName xml.Name `xml:"any"`
Min int `xml:"minOccurs,attr"`
Max string `xml:"maxOccurs,attr"` // can be # or unbounded
}
AnyElement describes an element of an undefined type.
type Attribute ¶ added in v1.4.6
type Attribute struct {
XMLName xml.Name `xml:"attribute"`
Name string `xml:"name,attr"`
Ref string `xml:"ref,attr"`
Type string `xml:"type,attr"`
ArrayType string `xml:"arrayType,attr"`
Min int `xml:"minOccurs,attr"`
Max string `xml:"maxOccurs,attr"` // can be # or unbounded
Nillable bool `xml:"nillable,attr"`
}
Attribute describes an attribute of a given type.
type Binding ¶
type Binding struct {
XMLName xml.Name `xml:"binding"`
Name string `xml:"name,attr"`
Type string `xml:"type,attr"`
BindingType *BindingType `xml:"binding"`
Operations []*BindingOperation `xml:"operation"`
}
Binding describes SOAP to WSDL binding.
type BindingOperation ¶
type BindingOperation struct {
XMLName xml.Name `xml:"operation"`
Name string `xml:"name,attr"`
Operation SOAP12Operation `xml:"http://schemas.xmlsoap.org/wsdl/soap12/ operation"`
Operation11 SOAP11Operation `xml:"http://schemas.xmlsoap.org/wsdl/soap/ operation"`
Input *BindingIO `xml:"input>body"`
Output *BindingIO `xml:"output>body"`
}
BindingOperation describes the requirement for binding SOAP to WSDL operations.
type BindingType ¶ added in v1.4.6
BindingType contains additional meta data on how to implement the binding.
type Choice ¶ added in v1.4.6
type Choice struct {
XMLName xml.Name `xml:"choice"`
ComplexTypes []*ComplexType `xml:"complexType"`
Elements []*Element `xml:"element"`
Any []*AnyElement `xml:"any"`
}
Choice describes a list of elements (parameters) of a type.
type ComplexContent ¶
type ComplexContent struct {
XMLName xml.Name `xml:"complexContent"`
Extension *Extension `xml:"extension"`
Restriction *Restriction `xml:"restriction"`
}
ComplexContent describes complex content within a complex type. Usually for extending the complex type with fields from the complex content.
type ComplexType ¶
type ComplexType struct {
XMLName xml.Name `xml:"complexType"`
Name string `xml:"name,attr"`
Abstract bool `xml:"abstract,attr"`
Doc string `xml:"annotation>documentation"`
AllElements []*Element `xml:"all>element"`
ComplexContent *ComplexContent `xml:"complexContent"`
Sequence *Sequence `xml:"sequence"`
Choice *Choice `xml:"choice"`
Attributes []*Attribute `xml:"attribute"`
TargetNamespace string
}
ComplexType describes a complex type, such as a struct.
type Definitions ¶
type Definitions struct {
XMLName xml.Name `xml:"definitions"`
Name string `xml:"name,attr"`
TargetNamespace string `xml:"targetNamespace,attr"`
Namespaces map[string]string `xml:"-"`
SOAPEnv string `xml:"SOAP-ENV,attr"`
SOAPEnc string `xml:"SOAP-ENC,attr"`
Service Service `xml:"service"`
Imports []*Import `xml:"import"`
Schema Schema `xml:"types>schema"`
Messages []*Message `xml:"message"`
PortType PortType `xml:"portType"` // TODO: PortType slice?
Binding Binding `xml:"binding"`
}
Definitions is the root element of a WSDL document.
func Unmarshal ¶
func Unmarshal(r io.Reader) (*Definitions, error)
Unmarshal unmarshals WSDL documents starting from the <definitions> tag.
The Definitions object it returns is an unmarshalled version of the WSDL XML that can be introspected to generate the Web Services API.
func (*Definitions) UnmarshalXML ¶ added in v1.4.6
func (def *Definitions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML implements the xml.Unmarshaler interface.
type Element ¶
type Element struct {
XMLName xml.Name `xml:"element"`
Name string `xml:"name,attr"`
Ref string `xml:"ref,attr"`
Type string `xml:"type,attr"`
Min int `xml:"minOccurs,attr"`
Max string `xml:"maxOccurs,attr"` // can be # or unbounded
Nillable bool `xml:"nillable,attr"`
ComplexType *ComplexType `xml:"complexType"`
}
Element describes an element of a given type.
type Extension ¶
type Extension struct {
XMLName xml.Name `xml:"extension"`
Base string `xml:"base,attr"`
Sequence *Sequence `xml:"sequence"`
Choice *Choice `xml:"choice"`
Attributes []*Attribute `xml:"attribute"`
}
Extension describes a complex content extension.
type Import ¶
type Import struct {
XMLName xml.Name `xml:"import"`
Namespace string `xml:"namespace,attr"`
Location string `xml:"location,attr"`
}
Import points to another WSDL to be imported at root level.
type ImportSchema ¶
type ImportSchema struct {
XMLName xml.Name `xml:"import"`
Namespace string `xml:"namespace,attr"`
Location string `xml:"schemaLocation,attr"`
}
ImportSchema points to another WSDL to be imported at schema level.
type IncludeSchema ¶ added in v1.4.6
type IncludeSchema struct {
XMLName xml.Name `xml:"include"`
Namespace string `xml:"namespace,attr"`
Location string `xml:"schemaLocation,attr"`
}
IncludeSchema points to another WSDL to be imported at schema level.
type Message ¶
type Message struct {
XMLName xml.Name `xml:"message"`
Name string `xml:"name,attr"`
Parts []*Part `xml:"part"`
}
Message describes the data being communicated, such as functions and their parameters.
type Operation ¶
type Operation struct {
XMLName xml.Name `xml:"operation"`
Name string `xml:"name,attr"`
Doc string `xml:"documentation"`
Input *IO `xml:"input"`
Output *IO `xml:"output"`
}
Operation describes an operation.
type Part ¶
type Part struct {
XMLName xml.Name `xml:"part"`
Name string `xml:"name,attr"`
Type string `xml:"type,attr,omitempty"`
Element string `xml:"element,attr,omitempty"` // TODO: not sure omitempty
}
Part describes what Type or Element to use from the PortType.
type Port ¶
type Port struct {
XMLName xml.Name `xml:"port"`
Name string `xml:"name,attr"`
Binding string `xml:"binding,attr"`
Address Address `xml:"address"`
}
Port for WSDL service.
type PortType ¶
type PortType struct {
XMLName xml.Name `xml:"portType"`
Name string `xml:"name,attr"`
Operations []*Operation `xml:"operation"`
}
PortType describes a set of operations.
type Restriction ¶
type Restriction struct {
XMLName xml.Name `xml:"restriction"`
Base string `xml:"base,attr"`
Enum []*Enum `xml:"enumeration"`
Attributes []*Attribute `xml:"attribute"`
}
Restriction describes the WSDL type of the simple type and optionally its allowed values.
type SOAP11Operation ¶ added in v1.4.6
type SOAP11Operation struct {
XMLName xml.Name `xml:"http://schemas.xmlsoap.org/wsdl/soap/ operation"`
Action string `xml:"soapAction,attr"`
}
SOAP11Operation describes a SOAP 1.1 operation. If it is specified in the wsdl, the soapAction will use this value instead of the default value
type SOAP12Operation ¶ added in v1.4.6
type SOAP12Operation struct {
XMLName xml.Name `xml:"http://schemas.xmlsoap.org/wsdl/soap12/ operation"`
Action string `xml:"soapAction,attr"`
}
SOAP12Operation describes a SOAP 1.2 operation. The soap12 namespace is important as the presence of a SOAP12Operation.Action is used to switch things over to sending the SOAP 1.2 content type header: (application/xml; charset=UTF-8; action='foobar')
type Schema ¶
type Schema struct {
XMLName xml.Name `xml:"schema"`
TargetNamespace string `xml:"targetNamespace,attr"`
Namespaces map[string]string `xml:"-"`
Imports []*ImportSchema `xml:"import"`
Includes []*IncludeSchema `xml:"include"`
SimpleTypes []*SimpleType `xml:"simpleType"`
ComplexTypes []*ComplexType `xml:"complexType"`
Elements []*Element `xml:"element"`
}
Schema of WSDL document.
func (*Schema) UnmarshalXML ¶ added in v1.4.6
UnmarshalXML implements the xml.Unmarshaler interface.
type Sequence ¶
type Sequence struct {
XMLName xml.Name `xml:"sequence"`
ComplexTypes []*ComplexType `xml:"complexType"`
Elements []*Element `xml:"element"`
Any []*AnyElement `xml:"any"`
Choices []*Choice `xml:"choice"`
}
Sequence describes a list of elements (parameters) of a type.
type SimpleType ¶
type SimpleType struct {
XMLName xml.Name `xml:"simpleType"`
Name string `xml:"name,attr"`
Union *Union `xml:"union"`
Restriction *Restriction `xml:"restriction"`
TargetNamespace string
}
SimpleType describes a simple type, such as string.