Documentation ¶
Index ¶
- Constants
- type Binary
- type Client
- func (s *Client) AddHeader(header interface{})
- func (s *Client) Call(soapAction string, request, response interface{}) error
- func (s *Client) CallContext(ctx context.Context, soapAction string, request, response interface{}) error
- func (s *Client) NewRequestEnvelop() RequestEnvelop
- func (s *Client) NewResponseEnvelop() ResponseEnvelop
- type HTTPClient
- type Option
- func WithBasicAuth(login, password string) Option
- func WithHTTPClient(c HTTPClient) Option
- func WithHTTPHeaders(headers map[string]string) Option
- func WithMTOM() Option
- func WithNormalSoapXML() Option
- func WithRequestTimeout(t time.Duration) Option
- func WithTLS(tls *tls.Config) Option
- func WithTLSHandshakeTimeout(t time.Duration) Option
- func WithTimeout(t time.Duration) Option
- type RequestEnvelop
- type RequestEnvelopCallBack
- type ResponseEnvelop
- type ResponseEnvelopCallBack
- type SOAPBody
- type SOAPDecoder
- type SOAPEncoder
- type SOAPEnvelope
- type SOAPFault
- type SafeTime
- type WSSPassword
- type WSSSecurityHeader
- type WSSUsername
- type WSSUsernameToken
Constants ¶
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" )
Variables ¶
This section is empty.
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 (*Binary) ContentType ¶
ContentType returns the content type
func (*Binary) MarshalXML ¶
MarshalXML implements the xml.Marshaler interface to encode a Binary to XML
func (*Binary) SetContentType ¶
SetContentType sets the content type the content will be transmitted as multipart
func (*Binary) UnmarshalXML ¶
UnmarshalXML implements the xml.Unmarshaler interface to decode a Binary form XML
type Client ¶
type Client struct { RequestEnvelop RequestEnvelopCallBack ResponseEnvelop ResponseEnvelopCallBack // contains filtered or unexported fields }
Client is soap client
func (*Client) AddHeader ¶
func (s *Client) AddHeader(header interface{})
AddHeader adds envelope header
func (*Client) CallContext ¶
func (s *Client) CallContext(ctx context.Context, soapAction string, request, response interface{}) error
CallContext performs HTTP POST request with a context
func (*Client) NewRequestEnvelop ¶
func (s *Client) NewRequestEnvelop() RequestEnvelop
func (*Client) NewResponseEnvelop ¶
func (s *Client) NewResponseEnvelop() ResponseEnvelop
type HTTPClient ¶
HTTPClient is a client which can make HTTP requests An example implementation is net/http.Client
type Option ¶
type Option func(*options)
A Option sets options such as credentials, tls, etc.
func WithBasicAuth ¶
WithBasicAuth is an Option to set BasicAuth
func WithHTTPClient ¶
func WithHTTPClient(c HTTPClient) Option
WithHTTPClient is an Option to set the HTTP client to use This cannot be used with WithTLSHandshakeTimeout, WithTLS, WithTimeout options
func WithHTTPHeaders ¶
WithHTTPHeaders is an Option to set global HTTP headers for all requests
func WithMTOM ¶
func WithMTOM() Option
WithMTOM is an Option to set Message Transmission Optimization Mechanism MTOM encodes fields of type Binary using XOP.
func WithNormalSoapXML ¶
func WithNormalSoapXML() Option
func WithRequestTimeout ¶
WithRequestTimeout is an Option to set default end-end connection timeout This option cannot be used with WithHTTPClient
func WithTLS ¶
WithTLS is an Option to set tls config This option cannot be used with WithHTTPClient
func WithTLSHandshakeTimeout ¶
WithTLSHandshakeTimeout is an Option to set default tls handshake timeout This option cannot be used with WithHTTPClient
func WithTimeout ¶
WithTimeout is an Option to set default HTTP dial timeout
type RequestEnvelop ¶
type RequestEnvelop interface { SetHeaders([]interface{}) SetBodyContent(interface{}) }
type RequestEnvelopCallBack ¶
type RequestEnvelopCallBack = func() RequestEnvelop
type ResponseEnvelop ¶
type ResponseEnvelop interface { SetBodyContent(interface{}) GetFault() error }
type ResponseEnvelopCallBack ¶
type ResponseEnvelopCallBack = func() ResponseEnvelop
type SOAPBody ¶
type SOAPBody struct { XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"` Fault *SOAPFault `xml:",omitempty"` Content interface{} `xml:",omitempty"` }
func (*SOAPBody) UnmarshalXML ¶
UnmarshalXML unmarshals SOAPBody xml
type SOAPDecoder ¶
type SOAPDecoder interface {
Decode(v interface{}) error
}
type SOAPEncoder ¶
type SOAPEnvelope ¶
type SOAPEnvelope struct { XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"` Headers []interface{} `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header"` Body SOAPBody }
func (*SOAPEnvelope) GetFault ¶
func (s *SOAPEnvelope) GetFault() error
func (*SOAPEnvelope) SetBodyContent ¶
func (s *SOAPEnvelope) SetBodyContent(content interface{})
func (*SOAPEnvelope) SetHeaders ¶
func (s *SOAPEnvelope) SetHeaders(headers []interface{})
type SOAPFault ¶
type SafeTime ¶ added in v0.4.2
Time extended time parsing types
func (*SafeTime) UnmarshalText ¶ added in v0.4.2
type WSSPassword ¶
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"` }
func NewWSSSecurityHeader ¶
func NewWSSSecurityHeader(user, pass, tokenID, mustUnderstand string) *WSSSecurityHeader
NewWSSSecurityHeader creates WSSSecurityHeader instance
type WSSUsername ¶
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"` }