rope

package module
v0.0.0-...-b89400b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2015 License: MIT Imports: 5 Imported by: 0

README

soap-on-a-rope

A Go package designed to make your experiences with SOAP a little lesss unpleasant.

Features

  • SOAP Client support for TLS and basic auth
  • Service oriented design

Example

import (
	"fmt"
	"github.com/FlocoApps/soap-on-a-rope"
)

...

reqTemplate := rope.StdEnvelope(AvailabilityRequestTemplate)
	bodyString := fmt.Sprintf(reqTemplate, accessCode)
	url := PreProductionURL + AvailabilityService
	auth := &rope.BasicAuth{
		Username: "UserID",
		Password: "Password",
	}

	soap := &rope.SoapClient{
		UseTLS: true,
		Auth:   auth,
	}

	responseString, err := soap.SendRequest(bodyString, url)
	if err != nil {
		fmt.Println(err)
	} else {
		fmt.Println(responseString)
	}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StdEnvelope

func StdEnvelope(body string) string

Types

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

type Service

type Service interface {
	Endpoint() string
	RequestTemplate() string

	RequestBody() string
}

type SoapClient

type SoapClient struct {
	UseTLS bool
	Auth   *BasicAuth
}

func (*SoapClient) SendRequest

func (sc *SoapClient) SendRequest(body, url string) (string, error)

func (*SoapClient) SendServiceRequest

func (sc *SoapClient) SendServiceRequest(service Service) (string, error)

Jump to

Keyboard shortcuts

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