.net - Seralizing data to and from string with soap message style -
i have web service proxy. on proxy there method takes 2 custom types. when call web service, soap message generated.
in scenario, capture soap message manually (using fiddler). able de-serialize string containing soap message (that read manually created file) instances of 2 original types.
i know easy enough xml dom, xpath, , xml serialization 2 types. i'm doing this, though 2 separate files. i'd combine them, , avoid manual formatting of captured soap message.
is there more automatic way leverage existing soap infrastructure deserialization? i'd write serialization code once , expect work.
it appears .net framework doesn't expose in easy use manner. custom code writes/reads data (in soaphttpclientprotocol
, soapserverprotocol
) not directly exposed user.
you can use code @ least guts of request map correctly:
xmltypemapping xmltypemapping = new soapreflectionimporter() .importtypemapping(typeof(t)); var xmlserializer = new xmlserializer(xmltypemapping);
the rest of serialization/deserialization have (via writing soap header , body custom code, , skipping xml reader ahead content, respectively).
you try using soapformatter
, though deprecated, , quite broken lot of scenarios (including generics):
Comments
Post a Comment