The soap package

[Tags: library, mit]

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


Properties

Versions0.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 (info)
Dependenciesbase (==4.*), bytestring, conduit, data-default, http-conduit, http-types, iconv, mtl, resourcet, text, tls-extra, unordered-containers, xml-conduit, xml-conduit-writer, xml-types
LicenseMIT
AuthorAlexander Bondarenko
Maintaineraenor.realm@gmail.com
CategoryWeb
Home pagehttps://bitbucket.org/dpwiz/haskell-soap
Upload dateThu Apr 18 12:09:43 UTC 2013
Uploaded byAlexanderBondarenko
Downloads1255 total (135 in last 30 days)

Modules

Downloads

Maintainers' corner

For package maintainers and hackage trustees