Пример #1
0
// NewClient creates and returns a new client wirh the ServiceContent field
// filled in.
func NewClient(ctx context.Context, rt soap.RoundTripper) (*Client, error) {
	serviceContent, err := methods.GetServiceContent(ctx, rt)
	if err != nil {
		return nil, err
	}

	c := Client{
		ServiceContent: serviceContent,
		RoundTripper:   rt,
	}

	// Set client if it happens to be a soap.Client
	if sc, ok := rt.(*soap.Client); ok {
		c.Client = sc
	}

	return &c, nil
}
Пример #2
0
func defaultKeepAlive(roundTripper soap.RoundTripper) {
	methods.GetServiceContent(context.Background(), roundTripper)
}