soap-0.2.2.7: SOAP client tools

Safe HaskellNone
LanguageHaskell98

Network.SOAP.Transport.HTTP

Contents

Synopsis

Initialization

initTransport :: EndpointURL -> RequestP -> BodyP -> IO Transport Source

Create a http-client transport. Use identity transformers if you don't need any special treatment.

initTransport_ :: EndpointURL -> IO Transport Source

Create a transport without any request and body processing.

initTransportWith :: ManagerSettings -> EndpointURL -> RequestP -> BodyP -> IO Transport Source

Create a http-client transport using manager settings (for plugging tls etc.).

confTransport :: Text -> Config -> IO Transport Source

Load common transport parameters from a configurator file.

soap {
  url = "https://vendor.tld/service/"
  trace = true
  timeout = 15
}

Only url field is required.

import Data.Configurator (load, Worth(Required))
main = do
    transport <- confTransport "soap" =<< load [Required "etc/example.conf"]

confTransportWith :: ManagerSettings -> Text -> Config -> RequestP -> BodyP -> IO Transport Source

A more extensible transport parameter loader.

type EndpointURL = String Source

Web service URL. Configured at initialization, but you can tweak it dynamically with a request processor.

Making a request

type RequestP = Request -> Request Source

Update request record after defaults and method-specific fields are set.

traceRequest :: RequestP Source

Show a debug dump of a request body.

Processing a response

type BodyP = ByteString -> ByteString Source

Process response body to make it a nice UTF8-encoded XML document.

iconv :: EncodingName -> BodyP Source

Create an IConv-based processor.

traceBody :: BodyP Source

Show a debug dump of a response body.

Raw transport function

runQuery :: Manager -> EndpointURL -> RequestP -> BodyP -> Transport Source

Render document, submit it as a POST request and retrieve a body.