Documentation
¶
Index ¶
- func GetPayloadFromError(err error) []byte
- func IsFault(err error) bool
- func SetCustomEnvelope(prefix string, attrs map[string]string)
- type ArrayParams
- type Client
- type Config
- type DumpLogger
- type ErrorWithPayload
- type Fault
- type FaultError
- type HeaderParams
- type Params
- type Request
- type RequestStruct
- type Response
- type SoapBody
- type SoapEnvelope
- type SoapHeader
- type SoapParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPayloadFromError ¶
GetPayloadFromError returns the payload of a ErrorWithPayload
func IsFault ¶
IsFault returns whether the given error is a fault error or not.
IsFault will return false when the error could not be typecasted to FaultError, because every fault error should have it's dynamic type as FaultError.
func SetCustomEnvelope ¶
SetCustomEnvelope define customizated envelope
Types ¶
type ArrayParams ¶
type ArrayParams [][2]interface{}
type Client ¶
type Client struct {
HTTPClient *http.Client
AutoAction bool
URL string
HeaderName string
HeaderParams HeaderParams
Definitions *wsdlDefinitions
// Must be set before first request otherwise has no effect, minimum is 15 minutes.
RefreshDefinitionsAfter time.Duration
Username string
Password string
// contains filtered or unexported fields
}
Client struct hold all the information about WSDL, request and response of the server
func SoapClient ¶
SoapClient return new *Client to handle the requests with the WSDL
func SoapClientWithConfig ¶
SoapClientWithConfig return new *Client to handle the requests with the WSDL
func (*Client) Call ¶
func (c *Client) Call(m string, p SoapParams) (res *Response, err error)
Call call's the method m with Params p
func (*Client) CallByStruct ¶
func (c *Client) CallByStruct(s RequestStruct) (res *Response, err error)
CallByStruct call's by struct
type DumpLogger ¶
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 response Fault implements Stringer interface
type FaultError ¶
type FaultError struct {
// contains filtered or unexported fields
}
FaultError implements error interface
func (FaultError) Error ¶
func (e FaultError) Error() string
type HeaderParams ¶
type HeaderParams map[string]interface{}
HeaderParams holds params specific to the header
type Request ¶
type Request struct {
Method string
Params SoapParams
}
Request Soap Request
func NewRequest ¶
func NewRequest(m string, p SoapParams) *Request
func NewRequestByStruct ¶
func NewRequestByStruct(s RequestStruct) (*Request, error)
NewRequestByStruct create a new request using builder
type RequestStruct ¶
type RequestStruct interface {
SoapBuildRequest() *Request
}
RequestStruct soap request interface
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
