soap-0.2.3.6: SOAP client tools

Safe Haskell | None
Language | Haskell98

Network.SOAP

Contents

- Requests
- Response parsing
- Exceptions

Description

A heart of the package, `invokeWS` assembles and executes requests.

Synopsis

- invokeWS :: (ToXML h, ToXML b) => Transport -> String -> h -> b -> ResponseParser a -> IO a
- type Transport = String -> Document -> IO ByteString
- runResponseParser :: ResponseParser a -> ByteString -> IO a
- data ResponseParser a
  - = StreamParser (Parser a)
  - | CursorParser (Cursor -> a)
  - | DocumentParser (Document -> a)
  - | RawParser (ByteString -> a)
- type Parser a = ConduitM Event Void (ResourceT IO) a
- data SOAPFault = SOAPFault {
  - faultCode :: Text
  - faultString :: Text
  - faultDetail :: Text
  }
- data SOAPParsingError = SOAPParsingError String

# Requests

invokeWS Source #

Arguments

:: (ToXML h, ToXML b) |
=> Transport | Configured transport to make requests with.
-> String | SOAPAction header.
-> h | SOAP Header element. () or Nothing will result in omiting the Header node. Put a comment if you need an empty element present.
-> b | SOAP Body element.
-> ResponseParser a | Parser to use on a request reply.
-> IO a |

Prepare data, assemble request and apply a parser to a response.

type Transport Source #

Arguments

= String | SOAPAction header
-> Document | XML document with a SOAP request
-> IO ByteString |

Common transport type. Get a request and deliver it to an endpoint specified during initialization.

# Response parsing

runResponseParser :: ResponseParser a -> ByteString -> IO a Source #

data ResponseParser a Source #

Different parsing modes available to extract reply contents.

Constructors

StreamParser (Parser a) | Streaming parser from Text.XML.Stream.Parse
CursorParser (Cursor -> a) | XPath-like parser from Text.XML.Cursor
DocumentParser (Document -> a) | Parse raw XML document.
RawParser (ByteString -> a) | Work with a raw bytestring.

type Parser a = ConduitM Event Void (ResourceT IO) a Source #

Stream parser from Text.XML.Stream.Parse.

# Exceptions

data SOAPFault Source #

Exception to be thrown when transport encounters an exception that is acutally a SOAP Fault.

Constructors

SOAPFault |

Fields

- faultCode :: Text
- faultString :: Text
- faultDetail :: Text

#### Instances

Instances details

Exception SOAPFault Source # |
Instance details Defined in Network.SOAP.Exception Methods toException :: SOAPFault -> SomeException Source # fromException :: SomeException -> Maybe SOAPFault Source # displayException :: SOAPFault -> String Source # backtraceDesired :: SOAPFault -> Bool Source #
Show SOAPFault Source # |
Instance details Defined in Network.SOAP.Exception Methods showsPrec :: Int -> SOAPFault -> ShowS Source # show :: SOAPFault -> String Source # showList :: [SOAPFault] -> ShowS Source #
Eq SOAPFault Source # |
Instance details Defined in Network.SOAP.Exception Methods (==) :: SOAPFault -> SOAPFault -> Bool Source # (/=) :: SOAPFault -> SOAPFault -> Bool Source #

data SOAPParsingError Source #

Constructors

SOAPParsingError String |

#### Instances

Instances details

Exception SOAPParsingError Source # |
Instance details Defined in Network.SOAP.Exception Methods toException :: SOAPParsingError -> SomeException Source # fromException :: SomeException -> Maybe SOAPParsingError Source # displayException :: SOAPParsingError -> String Source # backtraceDesired :: SOAPParsingError -> Bool Source #
Show SOAPParsingError Source # |
Instance details Defined in Network.SOAP.Exception Methods showsPrec :: Int -> SOAPParsingError -> ShowS Source # show :: SOAPParsingError -> String Source # showList :: [SOAPParsingError] -> ShowS Source #