wsdl

package
v1.1.103 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	XMLName  xml.Name `xml:"address"`
	Location string   `xml:"location,attr"`
}

Address of WSDL service.

type AnyElement

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

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 BindingIO

type BindingIO struct {
	Parts string `xml:"parts,attr"`
	Use   string `xml:"use,attr"`
}

BindingIO describes the IO binding of SOAP operations. See IO for details.

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

type BindingType struct {
	Style     string `xml:"style,attr"`
	Transport string `xml:"transport,attr"`
}

BindingType contains additional meta data on how to implement the binding.

type Choice

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"`
	SimpleContent   *SimpleContent  `xml:"simpleContent"`
	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"`
	Binding         Binding           `xml:"binding"`
}

Definitions is the root element of a WSDL document.

func Unmarshal

func Unmarshal(bytes []byte) (*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

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 Enum

type Enum struct {
	XMLName xml.Name `xml:"enumeration"`
	Value   string   `xml:"value,attr"`
}

Enum describes one possible value for a Restriction.

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 IO

type IO struct {
	XMLName xml.Name
	Message string `xml:"message,attr"`
}

IO describes which message is linked to an operation, for input or output parameters.

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

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"`
}

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

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

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

func (schema *Schema) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

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 Service

type Service struct {
	Doc   string  `xml:"documentation"`
	Ports []*Port `xml:"port"`
}

Service defines a WSDL service and with a location, like an HTTP server.

type SimpleContent

type SimpleContent struct {
	XMLName     xml.Name     `xml:"simpleContent"`
	Extension   *Extension   `xml:"extension"`
	Restriction *Restriction `xml:"restriction"`
}

SimpleContent describes simple content within a complex 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.

type Union

type Union struct {
	XMLName     xml.Name `xml:"union"`
	MemberTypes string   `xml:"memberTypes,attr"`
}

Union is a mix of multiple types in a union.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL