soapclient

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Predefined WSS namespaces to be used in
	WssNsWSSE string = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
	WssNsWSU  string = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
	WssNsType string = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"
)

Constants

Variables

View Source
var DebugSoapResponse = false

DebugSoapResponse debugger flag

Functions

This section is empty.

Types

type Binary

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

Binary enables binary data to be enchanged in MTOM mode with XOP encoding When MTOM is not used, the field is encoded in Base64

func NewBinary

func NewBinary(v []byte) *Binary

NewBinary allocate a new Binary backed by the given byte slice

func (*Binary) Bytes

func (b *Binary) Bytes() []byte

Bytes returns a slice backed by the content of the field

func (*Binary) ContentType

func (b *Binary) ContentType() string

ContentType returns the content type

func (*Binary) MarshalXML

func (b *Binary) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

MarshalXML implements the xml.Marshaler interface to encode a Binary to XML

func (*Binary) SetContentType

func (b *Binary) SetContentType(contentType string) *Binary

SetContentType sets the content type the content will be transmitted as multipart

func (*Binary) UnmarshalXML

func (b *Binary) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements the xml.Unmarshaler interface to decode a Binary form XML

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption options

func WithHTTPHeader

func WithHTTPHeader(name, value string) ClientOption

WithHTTPHeader options

func WithHTTPHeaders

func WithHTTPHeaders(headers map[string]string) ClientOption

WithHTTPHeaders options

func WithHTTPProxies

func WithHTTPProxies(proxies *definations.Proxies) ClientOption

WithHTTPProxies options

func WithHTTPTLSOptions

func WithHTTPTLSOptions(tlsOptions *definations.TLSOptions) ClientOption

WithHTTPTLSOptions options

func WithTimeoutSeconds

func WithTimeoutSeconds(timeoutSeconds int) ClientOption

WithTimeoutSeconds options

type SOAPBody

type SOAPBody struct {
	XMLName xml.Name `xml:"soap-env:Body"`

	Fault   *SOAPFault  `xml:",omitempty"`
	Content interface{} `xml:",omitempty"`
}

SOAPBody struct

type SOAPBodyResponse

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

	Fault   *SOAPFault  `xml:",omitempty"`
	Content interface{} `xml:",omitempty"`
}

SOAPBodyResponse struct

func (*SOAPBodyResponse) UnmarshalXML

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

UnmarshalXML unmarshals SOAPBody xml

type SOAPClient

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

SOAPClient client

func NewSOAPClient

func NewSOAPClient(endpoint string, options ...ClientOption) (*SOAPClient, error)

NewSOAPClient new client

func (*SOAPClient) ActiveState

func (c *SOAPClient) ActiveState(now int64) bool

ActiveState state

func (*SOAPClient) GetPort

func (c *SOAPClient) GetPort(name string) *SOAPPort

GetPort getter

func (*SOAPClient) GetService

func (c *SOAPClient) GetService(name string) *SOAPService

GetService getter

func (*SOAPClient) Init

func (c *SOAPClient) Init() error

Init initializer

type SOAPDecoder

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

SOAPDecoder interface

type SOAPEncoder

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

SOAPEncoder interface

type SOAPEnvelope

type SOAPEnvelope struct {
	XMLName xml.Name      `xml:"soap-env:Envelope"`
	NS      string        `xml:"xmlns:soap-env,attr"`
	Headers []interface{} `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header,omitempty"`
	Body    SOAPBody
}

SOAPEnvelope struct

func NewSOAPEnvelope

func NewSOAPEnvelope(content interface{}, headers []interface{}) *SOAPEnvelope

NewSOAPEnvelope envelope

type SOAPEnvelopeResponse

type SOAPEnvelopeResponse struct {
	XMLName xml.Name      `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
	Headers []interface{} `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header,omitempty"`
	Body    SOAPBodyResponse
}

SOAPEnvelopeResponse struct

type SOAPFault

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

SOAPFault struct

func (*SOAPFault) Error

func (f *SOAPFault) Error() string

Error get error

type SOAPPort

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

SOAPPort port

func (*SOAPPort) Call

func (p *SOAPPort) Call(operation string, response interface{}, soapBody interface{}, soapHeaders []interface{}) error

Call caller

type SOAPService

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

SOAPService service

func (*SOAPService) GetPort

func (s *SOAPService) GetPort(name string) *SOAPPort

GetPort getter

type WSSPassword

type WSSPassword struct {
	XMLName   xml.Name `xml:"wsse:Password"`
	XMLNSWsse string   `xml:"xmlns:wsse,attr"`
	XMLNSType string   `xml:"Type,attr"`

	Data string `xml:",chardata"`
}

WSSPassword struct

type WSSSecurityHeader

type WSSSecurityHeader struct {
	XMLName   xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ wsse:Security"`
	XMLNSWsse string   `xml:"xmlns:wsse,attr"`

	MustUnderstand string `xml:"mustUnderstand,attr,omitempty"`

	Token *WSSUsernameToken `xml:",omitempty"`
}

WSSSecurityHeader struct

func NewWSSSecurityHeader

func NewWSSSecurityHeader(user, pass, tokenID, mustUnderstand string) *WSSSecurityHeader

NewWSSSecurityHeader creates WSSSecurityHeader instance

type WSSUsername

type WSSUsername struct {
	XMLName   xml.Name `xml:"wsse:Username"`
	XMLNSWsse string   `xml:"xmlns:wsse,attr"`

	Data string `xml:",chardata"`
}

WSSUsername struct

type WSSUsernameToken

type WSSUsernameToken struct {
	XMLName   xml.Name `xml:"wsse:UsernameToken"`
	XMLNSWsu  string   `xml:"xmlns:wsu,attr"`
	XMLNSWsse string   `xml:"xmlns:wsse,attr"`

	ID string `xml:"wsu:Id,attr,omitempty"`

	Username *WSSUsername `xml:",omitempty"`
	Password *WSSPassword `xml:",omitempty"`
}

WSSUsernameToken struct

Jump to

Keyboard shortcuts

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