Re: Question for all of you EXPERT.NET architects

From: Cowboy \(Gregory A. Beamer\) [MVP] (NoSpamMgbworld_at_comcast.netNoSpamM)
Date: 08/06/04

  • Next message: Brian: "Re: Add Web Reference makes multiple requests fir WSDL"
    Date: Fri, 6 Aug 2004 12:10:51 -0500
    
    

    You could set up the object, conceivably, by using System.Reflection.Emit,
    but you leave a lot of possibilities when you except any type of object.
    While you may receive a factory and build your own factory, you might find
    that there factory was a mill, while yours looks more like a car factory.

    This is not a major problem if you are merely dinking around with the
    variables and sending it back in the same serialization method. But, in
    those cases, the factory object is a BS concept you made up simply to dink
    around with properties. If that is all you are doing, why deserialize the
    stupid class anyway, as you can consume the serialized XML and change things
    and bounce it back.

    Apologies if I appear a bit snarky on this one, but I, like Kent, believe
    you should know what your app is doing. If someone wants to fire some
    generic BS that you are not going to officially handle, it is better to
    leave it as an XML string and store it that way than it is to create a
    complete BS object simple to pretend you are talking the same language.

    -- 
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    ************************************************
    Think Outside the Box!
    ************************************************
    "Mike Miller" <mmiller@bluecypress.net> wrote in message
    news:f2018958.0408042204.7ee9940f@posting.google.com...
    > Question: How do you develop a web service that uses unknown types?
    >
    > The ideas is that my web service performs a generic function.  I want
    > anyone to be able to consume it, but I can't know what type of objects
    > they are going to pass to in (like I said it performs some generic
    > functionality - I don't want to recompile it ever).
    >
    > So I create a simple web service with with a method like:
    >
    > string GetTypeInfo(object t){
    >   return t.GetType().ToString();
    > }
    >
    > I want to consume it with something like:
    >
    > string s = WebService.GetTypeInfo(new Widget());
    >
    > Now the big question:
    > The Widget type is NOT referenced in the web service (the whole point
    > is its generic remember).  Now to me it makes sense that the client
    > (web service consumer) would serialize the object to xml, and pass the
    > xml and xsd describing the object over the wire via soap.  The server,
    > would deserialize the xml to an object using the xsd by doing the
    > following: if the type is unknown, the deserializer could define a new
    > type via system.refelection.emit and then create an instance of it and
    > populate it.  Does this make any sense?  Is there something built into
    > the webservices to do this?  If not, has anyone tried to roll your
    > own?
    >
    > So why would I want to do this?  Because lets say you have a business
    > tier and a data tier that are loosely coupled.  My business tier holds
    > my model and my data tier populates the model (using a persistance
    > framework like hibernate).  I don't want to recompile my data tier
    > simply because my model changes - I want it to be LOOSELY coupled, but
    > I don't want to be tied to simple value types and strings (I want to
    > do something useful).
    >
    > Thanks for taking to read and answer my question.
    > Mike
    

  • Next message: Brian: "Re: Add Web Reference makes multiple requests fir WSDL"

    Relevant Pages

    • RE: SP1 Problem SOAPException doesnt return quote and Umlaute correcty
      ... I suspect that there is an encoding issue in the way you are loading the ... Is there an inconsistency between the XML encoding mark up and the ... Found out .net web service clients are just as helpless with handling these ... If an exception is raised in the web service method saying i.e. 'The method ...
      (microsoft.public.dotnet.framework.webservices)
    • Consume Web Service...
      ... to call a web service in my orchestration. ... Xml parameters as string datatypes and processes this Xml and returns ... ignoreCommit, XMessage msg) ...
      (microsoft.public.biztalk.general)
    • Help please: Exception when with <input type="file"> but not with Textbox
      ... I have a web service that consumes an XML file as well as a few other ... This web service works fine if I use the web test interface. ... ' Notice that the comparison below shows the strings are *EXACTLY THE SAME* ... TestDWS_ASPX.PDF_WS.WatermarkID.TSILogo, enDealPart) ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • Help please: Exception when with <input type="file"> but not with Textbox
      ... I have a web service that consumes an XML file as well as a few other ... This web service works fine if I use the web test interface. ... ' Notice that the comparison below shows the strings are *EXACTLY THE SAME* ... TestDWS_ASPX.PDF_WS.WatermarkID.TSILogo, enDealPart) ...
      (microsoft.public.dotnet.framework.webservices)
    • RE: SP1 Problem SOAPException doesnt return quote and Umlaute correcty
      ... We are not creating any fault node data. ... In VS create a new web service project. ... where the code you are using to set up the XML is double converting. ... But then this is replaced by character references once again which results ...
      (microsoft.public.dotnet.framework.webservices)

  • Quantcast