Skip to content

kylewolfe/soaptrip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

soaptrip Build Status Coverage Status GoDoc

soaptrip is an HTTP Transport wrapper for parsing SOAP Faults

Usage

// create a client
c := &http.Client{Transport: soaptrip.DefaultSoapTrip}

// make a call that can respond with a SOAP Fault
resp, err := c.Post("http://localhost/soap/login", "text/xml", soapEnvelopeReader)
if err != nil {
	log.Println(err.Error()) // Post http://localhost/soap/login: FaultCode: 'faultcode' FaultString: 'fault string'

	// resp will always == nil if err != nil, however, you can retrieve the original resp
	urlError := err.(*url.Error)
	switch urlError.Err.(type) {
	case *soaptrip.SoapFault:
		resp = urlError.Err.Response
	default:
		// this is not a soap fault error
	}
}

About

soaptrip is an HTTP Transport wrapper for parsing SOAP Faults

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages