packages feed

shoap 0.1 → 0.2

raw patch · 2 files changed

+12/−8 lines, 2 files

Files

Network/Soap.hs view
@@ -1,13 +1,17 @@ module Network.Soap where import Network.Curl +import Data.IORef  soapMessage header body = "<?xml version=\"1.0\"?><env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><env:Header>"++header++"</env:Header><env:Body>"++body++"</env:Body></env:Envelope>" +soapPost::URLString->[String]->IO (CurlCode,String) soapPost url message = initialize >>= \ h -> do-  setopt h (CurlVerbose False)-  setopt h (CurlHttpHeaders ["SOAPAction: shoap"])-  setopt h (CurlPostFields message)-  setopt h (CurlCookieJar "cookies")-  setopt h (CurlURL url)-  perform h-  return ()+  ref <- newIORef []+  setopts h [(CurlVerbose False),(CurlHttpHeaders ["SOAPAction: shoap"]),(CurlPostFields message),(CurlCookieJar "cookies"),(CurlURL url),(CurlWriteFunction (gatherOutput ref))]+  rc<-perform h+  lss<-readIORef ref+  return (rc, concat $ reverse lss)+ +++
shoap.cabal view
@@ -1,5 +1,5 @@ Name:		shoap-Version:	0.1+Version:	0.2 Cabal-Version:  >= 1.2 Build-Type:     Simple License:	BSD3