module Network.Soap where
import Network.Curl 

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