soap: SOAP client tools

[ library, mit, web ] [ Propose Tags ]

Tools to build SOAP clients using xml-conduit.

A mildly-complicated example:

main = do
    -- Initial one-time preparations.
    certP <- clientCert "priv/client.crt" "priv/client.key"
    transport <- initTransport "https://example.com/soap/endpoint" certP (iconv "cp-1251")

    -- Making queries
    activeStaff <- listStaff transport True
    print activeStaff

data Person = Person Text Int deriving Show

listStaff :: Transport -> Bool -> IO [Person]
listStaff t active = invokeWS t "urn:dummy:listStaff" () body parser
    where
        body = element "request" $ element "listStaff" $ do
                   element "active" active
                   element "order" $ T.pack "age"
                   element "limit" (10 :: Int)

        parser = StreamParser $ force "no people" $ tagNoAttr "people" $ Parse.many parsePerson

        parsePerson = tagName "person" (requireAttr "age") $ \age -> do
                          name <- Parse.content
                          return $ Person name (read . unpack $ age)

Changelog

  • 0.2: Switch to xml-conduit-writer for more clean serializers. Pluggable transports. Raw and streaming parsers.

  • 0.1: Initial implementation, somewhat inflexible and warty, but working with diverse services.

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.3, 0.1.0.4, 0.2.0.0, 0.2.0.2, 0.2.0.3, 0.2.0.4, 0.2.1.1, 0.2.1.2, 0.2.1.3, 0.2.2.0, 0.2.2.1, 0.2.2.2, 0.2.2.3, 0.2.2.4, 0.2.2.5, 0.2.2.6, 0.2.2.7, 0.2.3.0, 0.2.3.1, 0.2.3.2, 0.2.3.3, 0.2.3.4, 0.2.3.5, 0.2.3.6 (info)
Dependencies base (>=4 && <5), bytestring, conduit, configurator, data-default, http-conduit (>=1.9 && <1.10), http-types, iconv, mtl, resourcet, text, tls-extra, unordered-containers, xml-conduit, xml-conduit-writer, xml-types [details]
License MIT
Author Alexander Bondarenko
Maintainer aenor.realm@gmail.com
Category Web
Home page https://bitbucket.org/dpwiz/haskell-soap
Uploaded by AlexanderBondarenko at 2013-12-13T10:25:47Z
Distributions Debian:0.2.3.6, NixOS:0.2.3.6
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 15521 total (73 in the last 30 days)
Rating 1.75 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]