name: soap version: 0.2.3.1 synopsis: SOAP client tools description: 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: homepage: https://bitbucket.org/dpwiz/haskell-soap license: MIT license-file: LICENSE author: Alexander Bondarenko maintainer: aenor.realm@gmail.com -- copyright: category: Web build-type: Simple cabal-version: >=1.8 extra-source-files: changelog library hs-source-dirs: src/ ghc-options: -Wall exposed-modules: Network.SOAP Network.SOAP.Transport Network.SOAP.Exception Network.SOAP.Transport.HTTP Network.SOAP.Transport.Mock Network.SOAP.Parsing.Cursor Network.SOAP.Parsing.Stream build-depends: base ==4.* , http-client >=0.2 , http-types , configurator , xml-conduit-writer , xml-conduit , xml-types , conduit , exceptions , resourcet , data-default , text , bytestring , iconv , unordered-containers , mtl test-suite tests type: exitcode-stdio-1.0 main-is: Main.hs hs-source-dirs: test/ build-depends: base, soap, hspec, HUnit, xml-conduit, xml-conduit-writer, text, bytestring, unordered-containers