Documentation ¶
Index ¶
- func GetPayloadFromError(err error) []byte
- func Named(element any, name string) named
- type ArrayParams
- type Client
- type CommunicationLogger
- type Config
- type ErrorWithPayload
- type Fault
- type FaultError
- type NamedElement
- type Params
- type Request
- type Response
- type SliceParams
- type SoapBody
- type SoapEnvelope
- type SoapHeader
- type WSDLSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPayloadFromError ¶
GetPayloadFromError returns the payload of a ErrorWithPayload
Types ¶
type ArrayParams ¶
type ArrayParams [][2]any
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct hold all the information about WSDL, request and response of the server
func NewClient ¶
func NewClient(wsdlSource WSDLSource, config *Config) (*Client, error)
NewClient return new *Client to handle the requests with the WSDL
type CommunicationLogger ¶
type CommunicationLogger interface { LogRequest(operation string, header http.Header, body []byte) LogResponse(operation string, header http.Header, body []byte) }
func NewSlogAdapter ¶
func NewSlogAdapter(logger *slog.Logger, level slog.Level) CommunicationLogger
type Config ¶
type Config struct { Client *http.Client AutoAction bool LogRequests bool Logger CommunicationLogger Service string Port string EnvelopePrefix string EnvelopeAttrs map[string]string Username string Password string }
Config config the Client
type ErrorWithPayload ¶
type ErrorWithPayload struct { Payload []byte // contains filtered or unexported fields }
ErrorWithPayload error payload schema
type Fault ¶
type Fault struct { Code string `xml:"faultcode"` Description string `xml:"faultstring"` Detail string `xml:"detail"` }
Fault see https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507
type FaultError ¶
type FaultError struct {
Fault Fault
}
FaultError implements error interface
func (FaultError) Error ¶
func (e FaultError) Error() string
func (FaultError) Is ¶
func (e FaultError) Is(target error) bool
type NamedElement ¶
type NamedElement interface { Name() xml.StartElement Value() any }
type Request ¶
type Request struct { // wsdl operation name, this will be used to map to a SOAP action // https://www.w3.org/TR/2001/NOTE-wsdl-20010315#_soap:operation WSDLOperation string // see https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383503 Body any // see https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383497 HeaderEntries []any }
A representation of a SOAP Request
type Response ¶
type Response struct { // see https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383503 Body []byte // see https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383497 HeaderEntries []byte }
Response Soap Response
func (*Response) UnmarshalHeader ¶
type SliceParams ¶
type SliceParams []any
type SoapBody ¶
type SoapBody struct { XMLName struct{} `xml:"Body"` Contents []byte `xml:",innerxml"` }
SoapBody struct
type SoapEnvelope ¶
type SoapEnvelope struct { XMLName struct{} `xml:"Envelope"` Header SoapHeader Body SoapBody }
SoapEnvelope struct
type SoapHeader ¶
type SoapHeader struct { XMLName struct{} `xml:"Header"` Contents []byte `xml:",innerxml"` }
SoapHeader struct
type WSDLSource ¶
func SourceFromBytes ¶
func SourceFromBytes(raw []byte) WSDLSource
func SourceFromURI ¶
func SourceFromURI(ctx context.Context, uri string) WSDLSource
Click to show internal directories.
Click to hide internal directories.