Loading ...
Sorry, an error occurred while loading the content.

Re: System.outofmemeoryexception and deserialization unit test failure

Expand Messages
  • charlescookuk
    The return value of the response - a struct - does not contain a member called map . It does however contain a member called route which contains a member
    Message 1 of 4 , Oct 1, 2005
    View Source
    • 0 Attachment
      The return value of the response - a struct - does not contain a
      member called "map". It does however contain a member called "route"
      which contains a member called "map".

      - Charles

      --- In XMLRPCNET@yahoogroups.com, "sprg3ak" <gvgittings@h...> wrote:
      > I am trying to debug a System.outofmemoryexception. So, I setup a test
      > to verify that the response xml was valid.
      >
      > The below test fails. Does anybody have a good idea why?
      >
      > public void testRouteMap()
      > {
      > string xml = @"<?xml version=""1.0""
      >
      encoding=""UTF-8""?><methodResponse><params><param><value><struct><member><name>cid</name><value><string>d13fed8bd1e5523d31477afa12f2c109eb</string></value></member><member><name>poi</name><value><array><data><value><struct><member><name>dma</name><value><int>751</int></value></member><member><name>state</name><value><string>CO</string></value></member><member><name>segment</name><value><int>20721022</int></value></member><member><name>country</name><value><string>US</string></value></member><member><name>latitude</name><value><double>39.71651</double></value></member><member><name>postalcode</name><value><string>80209</string></value></member><member><name>city</name><value><string>Denver</string></value></member><member><name>longitude</name><value><double>-104.97915</double></value></member><member><name>msa</name><value><int>2080</int></value></member><member><name>address</name><value><string>1
      > Washington St.</string></value></member>"
      > + "<member><name>georesult</name><value><string>10
      >
      W2GIADDRESS</string></value></member><member><name>offset</name><value><double>199.292033934289</double></value></member></struct></value><value><struct><member><name>segment</name><value><int>20781645</int></value></member><member><name>latitude</name><value><double>39.76444</double></value></member><member><name>offset</name><value><double>125.793989932508</double></value></member><member><name>icon</name><value><string>reddot</string></value></member><member><name>longitude</name><value><double>-104.94065</double></value></member></struct></value></data></array></value></member><member><name>route</name><value><struct><member><name>total_seconds</name><value><int>704</int></value></member><member><name>maneuver</name><value><array><data><value><struct><member><name>text</name><value><string>Start
      > by going SOUTH on S WASHINGTON
      >
      ST</string></value></member><member><name>seconds</name><value><int>20</int></value></member>"
      > +
      >
      "<member><name>miles</name><value><double>0.12</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
      > LEFT on E BAYAUD
      >
      AVE</string></value></member><member><name>seconds</name><value><int>53</int></value></member><member><name>miles</name><value><double>0.33</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
      > LEFT on S DOWNING
      >
      ST</string></value></member><member><name>seconds</name><value><int>40</int></value></member><member><name>miles</name><value><double>0.24</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
      > RIGHT on E 1ST
      >
      AVE</string></value></member><member><name>seconds</name><value><int>177</int></value></member><member><name>miles</name><value><double>1.24</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
      > LEFT to stay on STEELE ST/E 1ST AVE</string></value></member>"
      > +
      >
      "<member><name>seconds</name><value><int>2</int></value></member><member><name>miles</name><value><double>0.02</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
      > RIGHT to stay on E 1ST
      >
      AVE</string></value></member><member><name>seconds</name><value><int>53</int></value></member><member><name>miles</name><value><double>0.49</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
      > LEFT on COLORADO
      >
      BLVD/CO-2</string></value></member><member><name>seconds</name><value><int>359</int></value></member><member><name>miles</name><value><double>3.25</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Arrive
      > at your
      >
      destination.</string></value></member><member><name>seconds</name><value><int>0</int></value></member><member><name>miles</name><value><double>0.00</double></value></member></struct></value></data></array></value></member><member>"
      > +
      >
      "<name>map</name><value><struct><member><name>content</name><value><string>http://mapserv.where2getit.net/demo/maptools/mapper40.cgi/map.png?an=churchs;ln=dealer;mark=-104.97915,39.71651,origin_icon;mark=-104.94065,39.76444,destination_icon;route=d13fed8bd1e5523d31477afa12f2c109eb;lat=39.739575;lon=-104.959835;miles=5;iwd=600;iht=400</string></value></member><member><name>size</name><value><array><data><value><int>600</int></value><value><int>400</int></value></data></array></value></member><member><name>content_type</name><value><string>text/uri-list</string></value></member><member><name>miles</name><value><int>5</int></value></member><member><name>center</name><value><struct><member><name>latitude</name><value><double>39.739575</double></value></member><member><name>longitude</name><value><double>-104.959835</double></value></member></struct></value></member></struct></value></member><member><name>total_time</name><value><string>12
      > minutes</string></value></member><member>"
      > +
      >
      "<name>total_miles</name><value><double>5.69</double></value></member></struct></value></member><member><name>times</name><value><struct><member><name>csys</name><value><int>0</int></value></member><member><name>cusr</name><value><int>0</int></value></member><member><name>sys</name><value><double>0.01</double></value></member><member><name>usr</name><value><double>0.0300000000000002</double></value></member><member><name>wallclock</name><value><double>0.034094</double></value></member></struct></value></member></struct></value></param></params></methodResponse>";
      > StringReader sr = new StringReader(xml);
      > XmlRpcSerializer serializer = new XmlRpcSerializer();
      > XmlRpcResponse response = serializer.DeserializeResponse(sr,
      > typeof(XmlRpcStruct));
      >
      > XmlRpcStruct response_struct = (XmlRpcStruct)response.retVal;
      >
      > Assert.IsTrue(response_struct.ContainsKey("map"));
      > }
    • charlescookuk
      I ve not had any reports of this. I ve not tried it myself but you can get detailed information about managed memory allocations with the SOS debugger
      Message 2 of 4 , Oct 1, 2005
      View Source
      • 0 Attachment
        I've not had any reports of this. I've not tried it myself but you can
        get detailed information about managed memory allocations with the SOS
        debugger extension.

        - Charles

        --- In XMLRPCNET@yahoogroups.com, "sprg3ak" <gvgittings@h...> wrote:
        > Never mind about the failed test the api documentation is incorrect.
        > Has anybody excperienced an out of memory exception before with a
        > client proxy? Any thoughts on how to debug it?
        >
        > Thanks
        > Gabe
        >
        > --- In XMLRPCNET@yahoogroups.com, "sprg3ak" <gvgittings@h...> wrote:
        > > I am trying to debug a System.outofmemoryexception. So, I setup a test
        > > to verify that the response xml was valid.
        > >
        > > The below test fails. Does anybody have a good idea why?
        > >
        > > public void testRouteMap()
        > > {
        > > string xml = @"<?xml version=""1.0""
        > >
        >
        encoding=""UTF-8""?><methodResponse><params><param><value><struct><member><name>cid</name><value><string>d13fed8bd1e5523d31477afa12f2c109eb</string></value></member><member><name>poi</name><value><array><data><value><struct><member><name>dma</name><value><int>751</int></value></member><member><name>state</name><value><string>CO</string></value></member><member><name>segment</name><value><int>20721022</int></value></member><member><name>country</name><value><string>US</string></value></member><member><name>latitude</name><value><double>39.71651</double></value></member><member><name>postalcode</name><value><string>80209</string></value></member><member><name>city</name><value><string>Denver</string></value></member><member><name>longitude</name><value><double>-104.97915</double></value></member><member><name>msa</name><value><int>2080</int></value></member><member><name>address</name><value><string>1
        > > Washington St.</string></value></member>"
        > > + "<member><name>georesult</name><value><string>10
        > >
        >
        W2GIADDRESS</string></value></member><member><name>offset</name><value><double>199.292033934289</double></value></member></struct></value><value><struct><member><name>segment</name><value><int>20781645</int></value></member><member><name>latitude</name><value><double>39.76444</double></value></member><member><name>offset</name><value><double>125.793989932508</double></value></member><member><name>icon</name><value><string>reddot</string></value></member><member><name>longitude</name><value><double>-104.94065</double></value></member></struct></value></data></array></value></member><member><name>route</name><value><struct><member><name>total_seconds</name><value><int>704</int></value></member><member><name>maneuver</name><value><array><data><value><struct><member><name>text</name><value><string>Start
        > > by going SOUTH on S WASHINGTON
        > >
        >
        ST</string></value></member><member><name>seconds</name><value><int>20</int></value></member>"
        > > +
        > >
        >
        "<member><name>miles</name><value><double>0.12</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
        > > LEFT on E BAYAUD
        > >
        >
        AVE</string></value></member><member><name>seconds</name><value><int>53</int></value></member><member><name>miles</name><value><double>0.33</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
        > > LEFT on S DOWNING
        > >
        >
        ST</string></value></member><member><name>seconds</name><value><int>40</int></value></member><member><name>miles</name><value><double>0.24</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
        > > RIGHT on E 1ST
        > >
        >
        AVE</string></value></member><member><name>seconds</name><value><int>177</int></value></member><member><name>miles</name><value><double>1.24</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
        > > LEFT to stay on STEELE ST/E 1ST AVE</string></value></member>"
        > > +
        > >
        >
        "<member><name>seconds</name><value><int>2</int></value></member><member><name>miles</name><value><double>0.02</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
        > > RIGHT to stay on E 1ST
        > >
        >
        AVE</string></value></member><member><name>seconds</name><value><int>53</int></value></member><member><name>miles</name><value><double>0.49</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Turn
        > > LEFT on COLORADO
        > >
        >
        BLVD/CO-2</string></value></member><member><name>seconds</name><value><int>359</int></value></member><member><name>miles</name><value><double>3.25</double></value></member></struct></value><value><struct><member><name>text</name><value><string>Arrive
        > > at your
        > >
        >
        destination.</string></value></member><member><name>seconds</name><value><int>0</int></value></member><member><name>miles</name><value><double>0.00</double></value></member></struct></value></data></array></value></member><member>"
        > > +
        > >
        >
        "<name>map</name><value><struct><member><name>content</name><value><string>http://mapserv.where2getit.net/demo/maptools/mapper40.cgi/map.png?an=churchs;ln=dealer;mark=-104.97915,39.71651,origin_icon;mark=-104.94065,39.76444,destination_icon;route=d13fed8bd1e5523d31477afa12f2c109eb;lat=39.739575;lon=-104.959835;miles=5;iwd=600;iht=400</string></value></member><member><name>size</name><value><array><data><value><int>600</int></value><value><int>400</int></value></data></array></value></member><member><name>content_type</name><value><string>text/uri-list</string></value></member><member><name>miles</name><value><int>5</int></value></member><member><name>center</name><value><struct><member><name>latitude</name><value><double>39.739575</double></value></member><member><name>longitude</name><value><double>-104.959835</double></value></member></struct></value></member></struct></value></member><member><name>total_time</name><value><string>12
        > > minutes</string></value></member><member>"
        > > +
        > >
        >
        "<name>total_miles</name><value><double>5.69</double></value></member></struct></value></member><member><name>times</name><value><struct><member><name>csys</name><value><int>0</int></value></member><member><name>cusr</name><value><int>0</int></value></member><member><name>sys</name><value><double>0.01</double></value></member><member><name>usr</name><value><double>0.0300000000000002</double></value></member><member><name>wallclock</name><value><double>0.034094</double></value></member></struct></value></member></struct></value></param></params></methodResponse>";
        > > StringReader sr = new StringReader(xml);
        > > XmlRpcSerializer serializer = new XmlRpcSerializer();
        > > XmlRpcResponse response = serializer.DeserializeResponse(sr,
        > > typeof(XmlRpcStruct));
        > >
        > > XmlRpcStruct response_struct = (XmlRpcStruct)response.retVal;
        > >
        > > Assert.IsTrue(response_struct.ContainsKey("map"));
        > > }
      Your message has been successfully submitted and would be delivered to recipients shortly.