soap

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XmlNsSoapXsi                  = "http://www.w3.org/2001/XMLSchema-instance"
	XmlNsSoapXsd                  = "http://www.w3.org/2001/XMLSchema"
	XmlNsSoapEnv                  = "http://schemas.xmlsoap.org/soap/envelope/"
	MtomContentType               = `multipart/related; start-info="application/soap+xml"; type="application/xop+xml"; boundary="%s"`
	ContentTypeHeader             = "Content-Type"
	ContentTransferEncodingHeader = "Content-Transfer-Encoding"
	ContentIdHeader               = "Content-ID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	XMLName xml.Name    `xml:"soap:Body"`
	Content interface{} `xml:",omitempty"`
	Fault   *Fault      `xml:",omitempty"`
	// contains filtered or unexported fields
}

func (*Body) ErrorFromFault

func (b *Body) ErrorFromFault() error

type BodyResponse

type BodyResponse struct {
	XMLName xml.Name    `xml:"Body"`
	Content interface{} `xml:",omitempty"`
	Fault   *Fault      `xml:",omitempty"`
	// contains filtered or unexported fields
}

func (*BodyResponse) ErrorFromFault

func (b *BodyResponse) ErrorFromFault() error

func (*BodyResponse) UnmarshalXML

func (b *BodyResponse) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error

UnmarshalXML of the body xml

type Decoder

type Decoder interface {
	Decode(v interface{}) error
}

type DetailContainer

type DetailContainer struct {
	Detail interface{}
}

type Encoder

type Encoder interface {
	Encode(v interface{}) error
	Flush() error
}

type Envelope

type Envelope struct {
	XMLName  xml.Name `xml:"soap:Envelope"`
	XMLNS    string   `xml:"xmlns:soap,attr"`
	XMLNSXsd string   `xml:"xmlns:xsd,attr,omitempty"`
	XMLNSXsi string   `xml:"xmlns:xsi,attr,omitempty"`
	Header   *Header
	Body     Body
}

func NewEnvelope

func NewEnvelope() *Envelope

type EnvelopeResponse

type EnvelopeResponse struct {
	XMLName     xml.Name `xml:"Envelope"`
	XMLNS       string   `xml:"xmlns:soap,attr,omitempty"`
	XMLNSXsd    string   `xml:"xmlns:xsd,attr,omitempty"`
	XMLNSXsi    string   `xml:"xmlns:xsi,attr,omitempty"`
	Header      *HeaderResponse
	Body        BodyResponse
	Attachments []MIMEMultipartAttachment `xml:"attachments,omitempty"`
}

func NewEnvelopeResponse

func NewEnvelopeResponse() *EnvelopeResponse

type Fault

type Fault struct {
	XMLName xml.Name   `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault"`
	Code    string     `xml:"faultcode,omitempty"`
	String  string     `xml:"faultstring,omitempty"`
	Actor   string     `xml:"faultactor,omitempty"`
	Detail  FaultError `xml:"detail,omitempty"`
}

func (*Fault) Error

func (f *Fault) Error() string

type FaultError

type FaultError interface {
	// ErrorString should return a short version of the detail as a string,
	// which will be used in place of <faultstring> for the error message.
	// Set "HasData()" to always return false if <faultstring> error
	// message is preferred.
	ErrorString() string
	// HasData indicates whether the composite fault contains any data.
	HasData() bool
}

type HTTPError

type HTTPError struct {
	StatusCode   int
	ResponseBody []byte
}

HTTPError is returned whenever the HTTP request to the server fails

func (*HTTPError) Error

func (e *HTTPError) Error() string
type Header struct {
	XMLName xml.Name `xml:"soap:Header"`
	Headers []interface{}
}

type HeaderResponse

type HeaderResponse struct {
	XMLName xml.Name `xml:"soap:Header"`
	Headers []interface{}
}

type MIMEMultipartAttachment

type MIMEMultipartAttachment struct {
	Name string
	Data []byte
}

Jump to

Keyboard shortcuts

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