soap

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFault error = errors.New("xml fault")

ErrFault can be used as a target with errors.Is.

Functions

func DecodeAction

func DecodeAction(r io.Reader, action *actionBuilder) error

DecodeAction unmarshal a SOAP envelope from the reader. Errors can either be from the reader, XML decoding, or a *Fault.

func EncodeAction

func EncodeAction(w io.Writer, action *actionBuilder) error

Types

type ActionNameer

type ActionNameer interface {
	ActionName() string
}

type Fault

type Fault struct {
	Code   string      `xml:"faultcode"`
	String string      `xml:"faultstring"`
	Actor  string      `xml:"faultactor"`
	Detail FaultDetail `xml:"detail"`
}

Fault implements error, and contains SOAP fault information.

func (*Fault) Error

func (fe *Fault) Error() string

func (*Fault) Is

func (fe *Fault) Is(target error) bool

type FaultDetail

type FaultDetail struct {
	//Raw       []byte    `xml:",innerxml"`
	UPnPError UPnPError `xml:"UPnPError"`
}

FaultDetail carries XML-encoded application-specific Fault details.

type SOAPClient

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

func NewSOAPClient

func NewSOAPClient(controlURL url.URL) *SOAPClient

func (*SOAPClient) DoCall

func (client *SOAPClient) DoCall(actionNamespace, actionName string, inAction interface{}, outAction interface{}) error

DoCall is the legacy version of DoCallCtx, which uses context.Background.

func (*SOAPClient) DoCallCtx

func (client *SOAPClient) DoCallCtx(ctx context.Context, actionNamespace, actionName string, inAction interface{}, outAction interface{}) error

DoCallCtx makes a SOAP request, with the given action. inAction and outAction must both be pointers to structs with string fields only.

type UPnPError

type UPnPError struct {
	ErrorCode        string `xml:"errorCode"`
	ErrorDescription string `xml:"errorDescription"`
}

type XMLName

type XMLName xml.Name

Jump to

Keyboard shortcuts

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