packages feed

soap 0.2.3.5 → 0.2.3.6

raw patch · 4 files changed

+36/−31 lines, 4 filesdep ~bytestringdep ~resourcetdep ~text

Dependency ranges changed: bytestring, resourcet, text, xml-conduit-writer

Files

changelog view
@@ -1,3 +1,7 @@+0.2.3.6:++    * Fix conduit-1.3 deprecations.+ 0.2.3.5:      * Fix tests
soap.cabal view
@@ -1,5 +1,5 @@ name:                soap-version:             0.2.3.5+version:             0.2.3.6 synopsis:            SOAP client tools description:   Tools to build SOAP clients using xml-conduit.@@ -67,25 +67,22 @@     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+      base                 >= 4.8 && <5.0+    , bytestring           >= 0.10.6 && < 0.11+    , conduit              >= 1.2.6.6 && < 1.4+    , configurator         >= 0.3 && < 1.0+    , data-default         >= 0.5.3 && < 1.0+    , exceptions           >= 0.8.2.1 && < 0.11+    , http-client          >= 0.2 && < 1.0+    , http-types           >= 0.9 && < 1.0+    , iconv                >= 0.4.1.3 && < 0.5+    , mtl                  >= 2.2.1 && < 3.0+    , resourcet            >= 1.1.7.4 && < 1.3+    , text                 >= 1.2.2.1 && < 1.3+    , unordered-containers >= 0.2.5.1 && < 0.3+    , xml-conduit          >= 1.3.5 && < 2.0+    , xml-conduit-writer   >= 0.1.1.2 && < 0.2+    , xml-types            >= 0.3.6 && < 0.4  test-suite tests   type: exitcode-stdio-1.0
src/Network/SOAP.hs view
@@ -25,6 +25,7 @@ import qualified Data.ByteString.Lazy.Char8 as LBS  import           Data.Default (def)+import           Data.Void (Void) import qualified Text.XML as XML import           Text.XML.Cursor as XML import qualified Text.XML.Stream.Parse as XSP@@ -41,7 +42,7 @@                       | RawParser (LBS.ByteString -> a)    -- ^ Work with a raw bytestring.  -- | Stream parser from Text.XML.Stream.Parse.-type Parser a = Sink Event (ResourceT IO) a+type Parser a = ConduitM Event Void (ResourceT IO) a  -- | Prepare data, assemble request and apply a parser to a response. invokeWS :: (ToXML h, ToXML b)@@ -60,8 +61,8 @@ runResponseParser parser lbs =     case parser of         StreamParser sink ->-            runResourceT $-                XSP.parseLBS def lbs $$ unwrapEnvelopeSink sink+            runResourceT . runConduit $+                fuse (XSP.parseLBS def lbs) (unwrapEnvelopeSink sink)          CursorParser func ->             checkFault func . unwrapEnvelopeCursor
src/Network/SOAP/Parsing/Stream.hs view
@@ -17,13 +17,16 @@     , laxContent, flaxContent     , readContent, readTag       -- * Types to use in custom parser sinks-    , Sink, Event+    , Event+    , ConduitM, Void+    , Sink     ) where  #if MIN_VERSION_conduit(1,1,0) import Control.Monad.Catch (MonadThrow) #endif-import Data.Conduit+import Data.Conduit (ConduitM, Sink)+import Data.Void (Void) import Data.XML.Types (Event)  import           Text.XML (Name(..))@@ -32,7 +35,7 @@ import           Data.Text (Text, unpack)  -- | Namespace- and attribute- ignorant tagNoAttr.-laxTag :: (MonadThrow m) => Text -> Sink Event m a -> Sink Event m (Maybe a)+laxTag :: (MonadThrow m) => Text -> ConduitM Event Void m a -> ConduitM Event Void m (Maybe a) #if MIN_VERSION_xml_conduit(1,5,0) laxTag ln = XSP.tag' (XSP.matching $ (== ln) . nameLocalName) XSP.ignoreAttrs . const #else@@ -40,19 +43,19 @@ #endif  -- | Non-maybe version of laxTag/tagNoAttr.-flaxTag :: (MonadThrow m) => Text -> Sink Event m a -> Sink Event m a+flaxTag :: (MonadThrow m) => Text -> ConduitM Event Void m a -> ConduitM Event Void m a flaxTag ln s = XSP.force ("got no " ++ show ln) $ laxTag ln s -laxContent :: (MonadThrow m) => Text -> Sink Event m (Maybe Text)+laxContent :: (MonadThrow m) => Text -> ConduitM Event Void m (Maybe Text) laxContent ln = laxTag ln XSP.content -flaxContent :: (MonadThrow m) => Text -> Sink Event m Text+flaxContent :: (MonadThrow m) => Text -> ConduitM Event Void m Text flaxContent ln = flaxTag ln XSP.content  -- | Unpack and read a current tag content.-readContent :: (Read a, MonadThrow m) => Sink Event m a+readContent :: (Read a, MonadThrow m) => ConduitM Event Void m a readContent = fmap (read . unpack) XSP.content  -- | Unpack and read tag content by local name.-readTag :: (Read a, MonadThrow m) => Text -> Sink Event m a+readTag :: (Read a, MonadThrow m) => Text -> ConduitM Event Void m a readTag n = flaxTag n readContent