soap

package
v1.39.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionHeader = "SOAPAction"
)
View Source
const (
	ContentType = `text/xml; charset="utf-8"`
)

Variables

This section is empty.

Functions

func DefaultWrapper

func DefaultWrapper(logger log.Logger, restMiddlewares ...http.Middleware) endpoint.Wrapper

func ErrorHandler

func ErrorHandler(logger log.Logger) http2.Middleware

Types

type ActionMux

type ActionMux struct {
	// contains filtered or unexported fields
}

func NewActionMux

func NewActionMux() *ActionMux

func (*ActionMux) Handle

func (m *ActionMux) Handle(actionUri string, handler http.Handler) *ActionMux

func (*ActionMux) ServeHTTP

func (m *ActionMux) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type Body

type Body struct {
	XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"`

	Content any `xml:",omitempty"`

	Fault *Fault `xml:",omitempty"`
	// contains filtered or unexported fields
}

func (*Body) UnmarshalXML

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

UnmarshalXML copied from https://github.com/hooklift/gowsdl/blob/master/soap/soap.go

type Envelope

type Envelope struct {
	XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`

	Header *Header
	Body   Body
}

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 any    `xml:"detail,omitempty"`
}

func (Fault) Error

func (f Fault) Error() string

func (Fault) WriteError

func (f Fault) WriteError(w http.ResponseWriter) error
type Header struct {
	XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header"`

	Items []any `xml:",omitempty"`
}

type RequestExtractor

type RequestExtractor struct {
	Validator Validator
}

func (RequestExtractor) Extract

func (j RequestExtractor) Extract(_ context.Context, reader io.Reader, reqBodyType reflect.Type) (reflect.Value, error)

type ResponseMapper

type ResponseMapper struct {
}

func (ResponseMapper) Map

func (j ResponseMapper) Map(ctx context.Context, result any, w http.ResponseWriter) error

type Validator

type Validator interface {
	ValidateToError(v any) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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