how to remove webservice headers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GADOI

    how to remove webservice headers

    Hello:
    I have a web swervice that returns a formatted KML (Google earth) xml
    document.
    Google Earth says it can consume it IF the top level element starts with :
    <kml xmlns="http://earth.google.co m/kml/2.2">

    When I return data as string from my web servive it returns:

    <?xml version="1.0" encoding="utf-8" ?>
    <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d1p1:type="q1:s tring"
    xmlns:d1p1="htt p://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">
    <kml xmlns="http://earth.google.co m/kml/2.2">

    and then Google cannot use it - so I need to learn how to remove the

    <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d1p1:type="q1:s tring"
    xmlns:d1p1="htt p://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">

    What properties and methods do you suggest. and what event
    Thanks

  • John Saunders

    #2
    Re: how to remove webservice headers

    "GADOI" <support@oci.co mwrote in message
    news:F74CEB40-721D-4F3F-AD34-D6EE842987E2@mi crosoft.com...
    Hello:
    I have a web swervice that returns a formatted KML (Google earth) xml
    document.
    Google Earth says it can consume it IF the top level element starts with :
    <kml xmlns="http://earth.google.co m/kml/2.2">
    >
    When I return data as string from my web servive it returns:
    >
    <?xml version="1.0" encoding="utf-8" ?>
    <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema"
    d1p1:type="q1:s tring"
    xmlns:d1p1="htt p://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">
    <kml xmlns="http://earth.google.co m/kml/2.2">
    >
    and then Google cannot use it - so I need to learn how to remove the
    >
    <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema"
    d1p1:type="q1:s tring"
    xmlns:d1p1="htt p://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">
    >
    What properties and methods do you suggest. and what event
    Thanks
    You don't need to learn how to remove the "header". You need to learn how to
    return the correct data. You are not returning a string. You are returning
    XML. XML is not the same thing as string. You should almost never manipulate
    XML as a string. There's an entire System.Xml namespace for manipulating
    XML. Learn to use it.

    Among other things, if your service created the correct XML in a
    System.Xml.XmlD ocument instance and then returned that, you would not have
    this problem.

    --
    John Saunders | MVP - Connected System Developer

    Comment

    • GADOI

      #3
      Re: how to remove webservice headers

      John:
      It seems to me even if I returned a proper XML document, I would still get
      an unusable header - what am I missing here ?
      Thank you
      "John Saunders" <no@dont.do.tha t.comwrote in message
      news:OFUDRrvKJH A.1308@TK2MSFTN GP02.phx.gbl...
      "GADOI" <support@oci.co mwrote in message
      news:F74CEB40-721D-4F3F-AD34-D6EE842987E2@mi crosoft.com...
      >Hello:
      >I have a web swervice that returns a formatted KML (Google earth) xml
      >document.
      >Google Earth says it can consume it IF the top level element starts with
      >:
      ><kml xmlns="http://earth.google.co m/kml/2.2">
      >>
      >When I return data as string from my web servive it returns:
      >>
      > <?xml version="1.0" encoding="utf-8" ?>
      > <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema"
      >d1p1:type="q1: string"
      >xmlns:d1p1="ht tp://www.w3.org/2001/XMLSchema-instance"
      >xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">
      ><kml xmlns="http://earth.google.co m/kml/2.2">
      >>
      >and then Google cannot use it - so I need to learn how to remove the
      >>
      > <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema"
      >d1p1:type="q1: string"
      >xmlns:d1p1="ht tp://www.w3.org/2001/XMLSchema-instance"
      >xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">
      >>
      >What properties and methods do you suggest. and what event
      >Thanks
      >
      You don't need to learn how to remove the "header". You need to learn how
      to return the correct data. You are not returning a string. You are
      returning XML. XML is not the same thing as string. You should almost
      never manipulate XML as a string. There's an entire System.Xml namespace
      for manipulating XML. Learn to use it.
      >
      Among other things, if your service created the correct XML in a
      System.Xml.XmlD ocument instance and then returned that, you would not have
      this problem.
      >
      --
      John Saunders | MVP - Connected System Developer

      Comment

      Working...