473,382 Members | 1,562 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,382 software developers and data experts.

Webservice and browser

Hi,
I have a small HTML page which posts requests to a web service. I am
using a IFRAME for that so that the entire page wont reload. All is working
fine except that the respose from the web service changes once it reaches the
client. i.e it adds all javascript for handling + and - events when an xml
file is rendered. I need to avoid that and I need only the pure XML response
from the web service. I added a SoapExtension on my web service and found
that the servcie is working fine and respose is
-----SoapResponse at 7/18/2005 2:35:29 PM
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><getnameResponse
xmlns="http://tempuri.org/"><getnameResult>Hello</getnameResult></getnameResponse></soap:Body></soap:Envelope>
but whe is reaches the browser
its somethisng like this
**********<HEAD>
<STYLE>BODY{font:x-small 'Verdana';margin-right:1.5em}
..c{cursor:hand}
..b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
..e{margin-left:1em;text-indent:-1em;margin-right:1em}
..k{margin-left:1em;text-indent:-1em;margin-right:1em}
..t{color:#990000}
..xt{color:#990099}
..ns{color:red}
..dt{color:green}
..m{color:blue}
..tx{font-weight:bold
..db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
..di{font:small Courier}
..d{color:blue}
..pi{color:blue
..cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
..ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}</STYLE>

<SCRIPT><!--
function f(e){
if (e.className=="ci"){if (e.children(0).innerText.indexOf("\n")>0)
fix(e,"cb");}
if (e.className=="di"){if (e.children(0).innerText.indexOf("\n")>0)
fix(e,"db");}
e.id="";
}
function fix(e,cl){
e.className=cl;
e.style.display="block";
j=e.parentElement.children(0);
j.className="c";
etc etc and then the actual response.

How to avoid this ?
Any Suggestions?

Nov 17 '05 #1
2 1318
Ravi,

The problem here is that the mime type of the returned content is
text/xml, so IE shows you that view by default. In order to get around
that, I would use the XmlHttpRequest (I think that is the name) object on
the client to post your request and get your response. You can then take
the XML and set the document content to that XML document (in text form, of
course).

This would also allow you to get rid of the IFRAME as well.

If you don't want to use that on the client side, I would create another
page which will forward the call to the web service for you, and set the
content type on the response to "text/plain" instead of "text/xml" (you
shouldn't modify the original web service to do this). IE might still
process it as XML though, since it sniffs content for types in case the
headers are wrong. However, I believe there are headers you can set to tell
IE to not do that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ravi" <Ra**@discussions.microsoft.com> wrote in message
news:36**********************************@microsof t.com...
Hi,
I have a small HTML page which posts requests to a web service. I am
using a IFRAME for that so that the entire page wont reload. All is
working
fine except that the respose from the web service changes once it reaches
the
client. i.e it adds all javascript for handling + and - events when an xml
file is rendered. I need to avoid that and I need only the pure XML
response
from the web service. I added a SoapExtension on my web service and found
that the servcie is working fine and respose is
-----SoapResponse at 7/18/2005 2:35:29 PM
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><getnameResponse
xmlns="http://tempuri.org/"><getnameResult>Hello</getnameResult></getnameResponse></soap:Body></soap:Envelope>
but whe is reaches the browser
its somethisng like this
**********<HEAD>
<STYLE>BODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier
New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px
solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small
Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}</STYLE>

<SCRIPT><!--
function f(e){
if (e.className=="ci"){if (e.children(0).innerText.indexOf("\n")>0)
fix(e,"cb");}
if (e.className=="di"){if (e.children(0).innerText.indexOf("\n")>0)
fix(e,"db");}
e.id="";
}
function fix(e,cl){
e.className=cl;
e.style.display="block";
j=e.parentElement.children(0);
j.className="c";
etc etc and then the actual response.

How to avoid this ?
Any Suggestions?

Nov 17 '05 #2
Thanks. That really helped. I'll have a look at the options specified.
-- Ravi

"Nicholas Paldino [.NET/C# MVP]" wrote:
Ravi,

The problem here is that the mime type of the returned content is
text/xml, so IE shows you that view by default. In order to get around
that, I would use the XmlHttpRequest (I think that is the name) object on
the client to post your request and get your response. You can then take
the XML and set the document content to that XML document (in text form, of
course).

This would also allow you to get rid of the IFRAME as well.

If you don't want to use that on the client side, I would create another
page which will forward the call to the web service for you, and set the
content type on the response to "text/plain" instead of "text/xml" (you
shouldn't modify the original web service to do this). IE might still
process it as XML though, since it sniffs content for types in case the
headers are wrong. However, I believe there are headers you can set to tell
IE to not do that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ravi" <Ra**@discussions.microsoft.com> wrote in message
news:36**********************************@microsof t.com...
Hi,
I have a small HTML page which posts requests to a web service. I am
using a IFRAME for that so that the entire page wont reload. All is
working
fine except that the respose from the web service changes once it reaches
the
client. i.e it adds all javascript for handling + and - events when an xml
file is rendered. I need to avoid that and I need only the pure XML
response
from the web service. I added a SoapExtension on my web service and found
that the servcie is working fine and respose is
-----SoapResponse at 7/18/2005 2:35:29 PM
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><getnameResponse
xmlns="http://tempuri.org/"><getnameResult>Hello</getnameResult></getnameResponse></soap:Body></soap:Envelope>
but whe is reaches the browser
its somethisng like this
**********<HEAD>
<STYLE>BODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier
New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px
solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small
Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}</STYLE>

<SCRIPT><!--
function f(e){
if (e.className=="ci"){if (e.children(0).innerText.indexOf("\n")>0)
fix(e,"cb");}
if (e.className=="di"){if (e.children(0).innerText.indexOf("\n")>0)
fix(e,"db");}
e.id="";
}
function fix(e,cl){
e.className=cl;
e.style.display="block";
j=e.parentElement.children(0);
j.className="c";
etc etc and then the actual response.

How to avoid this ?
Any Suggestions?


Nov 17 '05 #3

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

Similar topics

1
by: Nalaka | last post by:
Hi, I am testing with Visual studio 2005, web projects. Situation: I have one solution with two web projects, created as file system projects. (I am tesing using the built in server, not IIS)...
2
by: Miguel | last post by:
Hi, I'm developing an application in C# with Windows Forms for my company that is similar to the MSN Messenger. This application uses a webservice for registering users, etc... and as 2...
3
by: subha | last post by:
I have a HelloWorld webservice that works on my IE browser. But, when I add a webreference to it and call the HelloWorld method from my WindowsFormsApp (return in C#), I get error messages. The...
2
by: Sergio Cossa | last post by:
Hello to all! I need to accede to webservice from a Javascript function. I have read on the possibility of using webservice.htc, but Microsoft no lon ger supports it. Can somebody say me how I...
5
by: Daniel Wilson | last post by:
I have a client who is trying to deploy a webservice I wrote. The web service reads a file on a file server and delivers information about it. The file needs to be inaccessible to the user of the...
18
by: A.M | last post by:
Hi, Is there any way to call a WSS web service method by using browser and see the XML result in browser as well? I have been told that there is query string syntax for calling...
2
by: joelcochran | last post by:
I am trying to consume my first WebService in a C# Windows Form in VS.NET 2003. I have created a Web Reference using the WSDL URL...
1
by: Frans | last post by:
I have made my first webservice whic can be called in a browser: http://localhost/webquote/calc.asmx?op=QuoteParams I get a screen with input for parameters and a Invoke-button. After pressing...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
7
by: Amirallia | last post by:
Hi, I consume my webservice with the IE browser and all is ok when I call it with one browser. But when I call it a the same time with two browsers, the IE page tells me that the apllication...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.