473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.com/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="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">
<kml xmlns="http://earth.google.com/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="http://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

Oct 10 '08 #1
2 3019
"GADOI" <su*****@oci.comwrote in message
news:F7**********************************@microsof t.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.com/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="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">
<kml xmlns="http://earth.google.com/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="http://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.XmlDocument instance and then returned that, you would not have
this problem.

--
John Saunders | MVP - Connected System Developer

Oct 10 '08 #2
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.that.comwrote in message
news:OF**************@TK2MSFTNGP02.phx.gbl...
"GADOI" <su*****@oci.comwrote in message
news:F7**********************************@microsof t.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.com/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="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.ga.gov/GeoKML/GeoKML.asmx">
<kml xmlns="http://earth.google.com/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="http://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.XmlDocument instance and then returned that, you would not have
this problem.

--
John Saunders | MVP - Connected System Developer
Oct 10 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
5
by: jb | last post by:
*Please* help --- I'm tearing my hair out. I want to use sessionstate in a webservice, accessed from a client, written in script (JScript, InfoPath). I have written my webservice (C# .NET). I...
6
by: utnemisis51 | last post by:
Hi, I'm trying to include some user credentials for accessing a remote webservice. The remote location requires that I use Basic authentication, which means, from browsing around, I need to...
2
by: rn5a | last post by:
I have created the following WebService named NConnect.asmx using which I want an ASPX page to first authenticate a user & after successful user validation, the ASPX page should display a few...
0
by: Wijnand Kroes | last post by:
Hi guys, I have a C#.NET client which sends SOAP requests to .Net webservices and non ..Net webservices. If I do not add a SOAP header a get a valid response from all webservices. If I do add...
7
by: GD | last post by:
Hi, I am trying to call a webservice from a windows service application. It works only if I launch the windows service app from VS.Net 2005 (Worked around from Main()) or from a winform test...
3
by: =?Utf-8?B?bGVvMg==?= | last post by:
Hi All, I have a question which might be a beginner's question. I have a webservice whose webmethod has to call a window's service and get back the results. What is the best way to implement...
7
by: Nick | last post by:
Hi there, Is it possible to tell how a WebMethod was invoked? For example I would like to determin if it was invoked via SOAP or HTTP Post. Other than creating 2 methods I am no sure if I can...
1
by: gihan | last post by:
Hi, I have a problem accessing remote webservice from my asp code. Instead of returning results, it returns list of web methods it has. Wonder where i'm doing wrong. Also note that, this is a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.