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 "" 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
        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)


Versions,,,,,,,,,,,,,,,,,,,,,,,,, (info)
Dependencies base (==4.*), bytestring, conduit, configurator, data-default, http-conduit (>=1.9.0), http-types, iconv, mtl, resourcet, text, tls-extra, unordered-containers, xml-conduit, xml-conduit-writer, xml-types [details]
License MIT
Author Alexander Bondarenko
Category Web
Home page
Uploaded by AlexanderBondarenko at Wed Jun 5 06:19:24 UTC 2013
Distributions LTSHaskell:, NixOS:, Stackage:, openSUSE:
Downloads 7875 total (81 in the last 30 days)
Rating 1.75 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees