The soap package

[Tags: library, mit]

Tools to build SOAP clients using xml-conduit.

A mildly-complicated example:

 import Network.SOAP
 import Network.SOAP.Transport.HTTP

 import Text.XML.Writer
 import Text.XML.Stream.Parse as Parse
 import           Data.Text (Text)
 import qualified Data.Text as T

 main :: IO ()
 main = do
     -- Initial one-time preparations.
     transport <- initTransport "http://example.com/soap/endpoint" id (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 . T.unpack $ age)

Notice: to invoke HTTPS services you need to initialize a transport from soap-tls or soap-openssl.

Full examples available at source repo: https://bitbucket.org/dpwiz/haskell-soap/src/HEAD/soap/examples/

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, 0.2.2.5 (info)
Change logchangelog
Dependenciesbase (==4.*), bytestring, conduit, configurator, data-default, exceptions, http-client (>=0.2), http-types, iconv, mtl, resourcet, text, unordered-containers, xml-conduit, xml-conduit-writer, xml-types
LicenseMIT
AuthorAlexander Bondarenko
Maintaineraenor.realm@gmail.com
CategoryWeb
Home pagehttps://bitbucket.org/dpwiz/haskell-soap
UploadedTue Mar 24 08:55:08 UTC 2015 by AlexanderBondarenko
DistributionsLTSHaskell:0.2.2.5, NixOS:0.2.2.5
Downloads2038 total (133 in last 30 days)
StatusDocs available [build log]
Last success reported on 2015-03-24 [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees