473,320 Members | 2,111 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,320 software developers and data experts.

xml-stylesheets and web-service

I have a .net webservice, developed with c++ managed extensions.

The websrvice returns an xml-document with a reference to a server side
xml-stylesheet in the format

<?xml-stylesheet href = 'StyleSheet.xsl' type = 'text/xsl'?>

This allows the client to retrieve the stylesheet for rendering the xml, if
needed. When I test this with IE it detects the stylesheet reference and
tries to get the stylesheet file with the following "GET"

GET /MyWS/MyWS.asmx/StyleSheet.xsl

How can I configure the web-service to return the StyleSheet.xsl file,
without any special coding.

Appreciate your help.

Regards.

Nov 23 '05 #1
5 1989
Hi,

You can probably do this better as an ASP.net page, instead of a web
service. The only protocol that will successfully process this type of
setup is a browser based HTTP request (e.g. HTTP GET). Web services aren't
intended to work this way.

Regards

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: xml-stylesheets and web-service
thread-index: AcTboZs6YO3gPnHQTuKsCW/8+wqyJQ==
X-WBNR-Posting-Host: 198.169.189.226
From: =?Utf-8?B?R2FyZGFy?= <Ga****@discussions.microsoft.com>
Subject: xml-stylesheets and web-service
Date: Mon, 6 Dec 2004 06:41:01 -0800
Lines: 22
Message-ID: <22**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7890
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I have a .net webservice, developed with c++ managed extensions.

The websrvice returns an xml-document with a reference to a server side
xml-stylesheet in the format

<?xml-stylesheet href = 'StyleSheet.xsl' type = 'text/xsl'?>

This allows the client to retrieve the stylesheet for rendering the xml, if
needed. When I test this with IE it detects the stylesheet reference and
tries to get the stylesheet file with the following "GET"

GET /MyWS/MyWS.asmx/StyleSheet.xsl

How can I configure the web-service to return the StyleSheet.xsl file,
without any special coding.

Appreciate your help.

Regards.


Nov 23 '05 #2
Thanks for the response Dan.

Couple of things ---

1) I did manage to "kludge" in the behaviour I wanted by creating a
WebMethod with the same name as the stylesheet file, and then just respond
with the file when invoked via the GET operation described. This is good
enough for now.

2) It's does not seem unresonable to expect the behaviour I'm looking for:
That is an xml web service responds with an xml file that the client can
either process as it sees fit, or use an author supplied stylesheet to render
the xml in a "mindless" fashion. Certainly xml and stylesheets seem designed
with this in mind. If this is not possible with ASP.NET WebServices, then
that seems more a reflection of MS's design/implementation, rather than a
"missuse" of XML Web Service intended use/design.

Again I appreciate your response.

Thanks,

"Dan Rogers" wrote:
Hi,

You can probably do this better as an ASP.net page, instead of a web
service. The only protocol that will successfully process this type of
setup is a browser based HTTP request (e.g. HTTP GET). Web services aren't
intended to work this way.

Regards

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: xml-stylesheets and web-service
thread-index: AcTboZs6YO3gPnHQTuKsCW/8+wqyJQ==
X-WBNR-Posting-Host: 198.169.189.226
From: =?Utf-8?B?R2FyZGFy?= <Ga****@discussions.microsoft.com>
Subject: xml-stylesheets and web-service
Date: Mon, 6 Dec 2004 06:41:01 -0800
Lines: 22
Message-ID: <22**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7890
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I have a .net webservice, developed with c++ managed extensions.

The websrvice returns an xml-document with a reference to a server side
xml-stylesheet in the format

<?xml-stylesheet href = 'StyleSheet.xsl' type = 'text/xsl'?>

This allows the client to retrieve the stylesheet for rendering the xml, if
needed. When I test this with IE it detects the stylesheet reference and
tries to get the stylesheet file with the following "GET"

GET /MyWS/MyWS.asmx/StyleSheet.xsl

How can I configure the web-service to return the StyleSheet.xsl file,
without any special coding.

Appreciate your help.

Regards

Nov 23 '05 #3
Hi,

The issues that makes web service unsuitable in this case are purely
technical and related to what is allowed in a SOAP message. Specifically:

1. You can't insert a processing instruction for the style sheet into the
SOAP Body. Nor is the processing instruction valid at the top of the XML
in the HTTP response since this would cause the XML processor to convert
the response to HTML - which would make most web service clients fail.

2. You _could_ place the name of the style sheet in a SOAP header - e.g.
send back the URL of the style sheet to the caller and let them get it from
you at the location you provide.

Now, you can serve up regular files from the VROOT where your web service
lives. Are you saying that if you say, put in a .txt file, and asked via
IE to get that specific file that ASP.net is refusing? This is likely an
IIS setting. Alternately you can put your style sheets in a regular VROOT
and make the SOAP headers that you return with the URL for each document
point to some web site of your choice where these style sheets live.

In short, SOAP isn't intended to be consumed directly by browser clients.

Dan

--------------------
Thread-Topic: xml-stylesheets and web-service
thread-index: AcTcDbyWazufCXMjSHeZnrmwxfgJaw==
X-WBNR-Posting-Host: 198.169.189.226
From: =?Utf-8?B?R2FyZGFy?= <Ga****@discussions.microsoft.com>
References: <22**********************************@microsoft.co m>
<Gm**************@cpmsftngxa10.phx.gbl>
Subject: RE: xml-stylesheets and web-service
Date: Mon, 6 Dec 2004 19:35:03 -0800
Lines: 78
Message-ID: <92**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7933
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Thanks for the response Dan.

Couple of things ---

1) I did manage to "kludge" in the behaviour I wanted by creating a
WebMethod with the same name as the stylesheet file, and then just respond
with the file when invoked via the GET operation described. This is good
enough for now.

2) It's does not seem unresonable to expect the behaviour I'm looking for:
That is an xml web service responds with an xml file that the client can
either process as it sees fit, or use an author supplied stylesheet to
render
the xml in a "mindless" fashion. Certainly xml and stylesheets seem
designed
with this in mind. If this is not possible with ASP.NET WebServices, then
that seems more a reflection of MS's design/implementation, rather than a
"missuse" of XML Web Service intended use/design.

Again I appreciate your response.

Thanks,

"Dan Rogers" wrote:
Hi,

You can probably do this better as an ASP.net page, instead of a web
service. The only protocol that will successfully process this type of
setup is a browser based HTTP request (e.g. HTTP GET). Web services aren't intended to work this way.

Regards

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: xml-stylesheets and web-service
thread-index: AcTboZs6YO3gPnHQTuKsCW/8+wqyJQ==
X-WBNR-Posting-Host: 198.169.189.226
From: =?Utf-8?B?R2FyZGFy?= <Ga****@discussions.microsoft.com>
Subject: xml-stylesheets and web-service
Date: Mon, 6 Dec 2004 06:41:01 -0800
Lines: 22
Message-ID: <22**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7890
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I have a .net webservice, developed with c++ managed extensions.

The websrvice returns an xml-document with a reference to a server side
xml-stylesheet in the format

<?xml-stylesheet href = 'StyleSheet.xsl' type = 'text/xsl'?>

This allows the client to retrieve the stylesheet for rendering the xml, if needed. When I test this with IE it detects the stylesheet reference and
tries to get the stylesheet file with the following "GET"

GET /MyWS/MyWS.asmx/StyleSheet.xsl

How can I configure the web-service to return the StyleSheet.xsl file,
without any special coding.

Appreciate your help.

Regards


Nov 23 '05 #4
Dan, thanks again for you response...

A number of items to clarify.

1) I've already worked out a solution to my particular problem, so our
discussion is now somewhat "academic"

2) My Web Service is only implemented wtih HTTP "POST" bindings, I'm not
using SOAP for the transactions.

3) This is my first forai into Web Service implementation so my
understanding of the issues is very basic

So to recap the problem I was having...

I return and XML document/stream with a processing instruction of the form,

<?xml-stylesheet href = 'StyleSheet.xsl' type = 'text/xsl'?>

the XML is sent back in response to a POST, so the brower receives the full
XML response, what happanes then is the IE comes back with a HTTP GET of the
form

GET /MyWS/MyWS.asmx/StyleSheet.xsl

(http://server-root//MyWS/MyWS.asmx/StyleSheet.xsl), since this is
referenced relative to the web-service asmx _file_, the GET fails

Again, I appreciate your time, and I do understand if this is too mundane
and issue for further response.

Regards,

"Gardar" wrote:
Thanks for the response Dan.

Couple of things ---

1) I did manage to "kludge" in the behaviour I wanted by creating a
WebMethod with the same name as the stylesheet file, and then just respond
with the file when invoked via the GET operation described. This is good
enough for now.

2) It's does not seem unresonable to expect the behaviour I'm looking for:
That is an xml web service responds with an xml file that the client can
either process as it sees fit, or use an author supplied stylesheet to render
the xml in a "mindless" fashion. Certainly xml and stylesheets seem designed
with this in mind. If this is not possible with ASP.NET WebServices, then
that seems more a reflection of MS's design/implementation, rather than a
"missuse" of XML Web Service intended use/design.

Again I appreciate your response.

Thanks,

"Dan Rogers" wrote:
Hi,

You can probably do this better as an ASP.net page, instead of a web
service. The only protocol that will successfully process this type of
setup is a browser based HTTP request (e.g. HTTP GET). Web services aren't
intended to work this way.

Regards

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: xml-stylesheets and web-service
thread-index: AcTboZs6YO3gPnHQTuKsCW/8+wqyJQ==
X-WBNR-Posting-Host: 198.169.189.226
From: =?Utf-8?B?R2FyZGFy?= <Ga****@discussions.microsoft.com>
Subject: xml-stylesheets and web-service
Date: Mon, 6 Dec 2004 06:41:01 -0800
Lines: 22
Message-ID: <22**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7890
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I have a .net webservice, developed with c++ managed extensions.

The websrvice returns an xml-document with a reference to a server side
xml-stylesheet in the format

<?xml-stylesheet href = 'StyleSheet.xsl' type = 'text/xsl'?>

This allows the client to retrieve the stylesheet for rendering the xml, if
needed. When I test this with IE it detects the stylesheet reference and
tries to get the stylesheet file with the following "GET"

GET /MyWS/MyWS.asmx/StyleSheet.xsl

How can I configure the web-service to return the StyleSheet.xsl file,
without any special coding.

Appreciate your help.

Regards

Nov 23 '05 #5
Hi Gardar,

My point is that WS is not intended to be called by browsers, and thus if
you are called by a web service proxy, you will not be able to insert the
processing instruction under the SOAP:Body. As a service endpoint, you
don't (theoretically) control the client's technology - you are just
serving up SOAP (assuming you're doing an ASP.Net web service).

For the kind of form post, browser facing, XML slinging application you are
describing, you will have far better luck making this a simple web
applicaiton and avoiding adding in the Web Service stack at all.

I hope this helps

Dan
--------------------
Thread-Topic: xml-stylesheets and web-service
thread-index: AcTcvyZmR8m+tAdrRRKbffodUjLdXw==
X-WBNR-Posting-Host: 198.169.188.226
From: =?Utf-8?B?R2FyZGFy?= <Ga****@discussions.microsoft.com>
References: <22**********************************@microsoft.co m>
<Gm**************@cpmsftngxa10.phx.gbl>
<92**********************************@microsoft.co m>
Subject: RE: xml-stylesheets and web-service
Date: Tue, 7 Dec 2004 16:45:01 -0800
Lines: 113
Message-ID: <B8**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7976
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Dan, thanks again for you response...

A number of items to clarify.

1) I've already worked out a solution to my particular problem, so our
discussion is now somewhat "academic"

2) My Web Service is only implemented wtih HTTP "POST" bindings, I'm not
using SOAP for the transactions.

3) This is my first forai into Web Service implementation so my
understanding of the issues is very basic

So to recap the problem I was having...

I return and XML document/stream with a processing instruction of the form,

<?xml-stylesheet href = 'StyleSheet.xsl' type = 'text/xsl'?>

the XML is sent back in response to a POST, so the brower receives the full
XML response, what happanes then is the IE comes back with a HTTP GET of
the
form

GET /MyWS/MyWS.asmx/StyleSheet.xsl

(http://server-root//MyWS/MyWS.asmx/StyleSheet.xsl), since this is
referenced relative to the web-service asmx _file_, the GET fails

Again, I appreciate your time, and I do understand if this is too mundane
and issue for further response.

Regards,

"Gardar" wrote:
Thanks for the response Dan.

Couple of things ---

1) I did manage to "kludge" in the behaviour I wanted by creating a
WebMethod with the same name as the stylesheet file, and then just respond with the file when invoked via the GET operation described. This is good
enough for now.

2) It's does not seem unresonable to expect the behaviour I'm looking for: That is an xml web service responds with an xml file that the client can
either process as it sees fit, or use an author supplied stylesheet to render the xml in a "mindless" fashion. Certainly xml and stylesheets seem designed with this in mind. If this is not possible with ASP.NET WebServices, then
that seems more a reflection of MS's design/implementation, rather than a
"missuse" of XML Web Service intended use/design.

Again I appreciate your response.

Thanks,

"Dan Rogers" wrote:
Hi,

You can probably do this better as an ASP.net page, instead of a web
service. The only protocol that will successfully process this type of
setup is a browser based HTTP request (e.g. HTTP GET). Web services aren't intended to work this way.

Regards

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: xml-stylesheets and web-service
thread-index: AcTboZs6YO3gPnHQTuKsCW/8+wqyJQ==
X-WBNR-Posting-Host: 198.169.189.226
From: =?Utf-8?B?R2FyZGFy?= <Ga****@discussions.microsoft.com>
Subject: xml-stylesheets and web-service
Date: Mon, 6 Dec 2004 06:41:01 -0800
Lines: 22
Message-ID: <22**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7890
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I have a .net webservice, developed with c++ managed extensions.

The websrvice returns an xml-document with a reference to a server side
xml-stylesheet in the format

<?xml-stylesheet href = 'StyleSheet.xsl' type = 'text/xsl'?>

This allows the client to retrieve the stylesheet for rendering the xml, if needed. When I test this with IE it detects the stylesheet reference and tries to get the stylesheet file with the following "GET"

GET /MyWS/MyWS.asmx/StyleSheet.xsl

How can I configure the web-service to return the StyleSheet.xsl file,
without any special coding.

Appreciate your help.

Regards


Nov 23 '05 #6

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

Similar topics

5
by: David | last post by:
Would I be right in saying the following files are equilavent, except first on is HTML and second one is XML? Code: <? echo "<h1>Hello world!</h1>".<br>; echo "This is HTML"; ?>
0
by: Phil Powell | last post by:
// PROCESS XML CONTENT INTO DYNAMICALLY-NAMED ARRAYS foreach (array('mime', 'state', 'country') as $val) { $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);...
13
by: Paulo Pinto | last post by:
Hi, does anyone know of a Python package that is able to load XML like the XML::Simple Perl package does? For those that don't know it, this package maps the XML file to a dictionary.
8
by: Robert Oschler | last post by:
Has anybody seen a Python module that will take an XML document (not a colossal one), and convert it to a Python nested class object? I'm basically looking for something that would allow me to...
2
by: Gustaf Liljegren | last post by:
I'm using xml.sax.parseString to read an XML file. The XML file contains a few words in Russian, and is encoded in UTF-8 using C#. In the example below, MyParser() is my SAX ContentHandler class....
2
by: jaco | last post by:
Hi, I'm new to Python and XML but still I want to create something that includes creating and editing XML using Python. Now I'm looking for a little example program that does (some of) this to...
3
by: Willem Ligtenberg | last post by:
I decided to use SAX to parse my xml file. But the parser crashes on: File "/usr/lib/python2.3/site-packages/_xmlplus/sax/handler.py", line 38, in fatalError raise exception...
0
by: Stylus Studio | last post by:
World's Most Advanced XML Schema Editor Adds Support for IBM AlphaWorks XML Schema Quality Checker to Improve XML Schema Style and Quality BEDFORD, MA -- 09/13/2005 -- Stylus Studio...
0
by: UncleRic | last post by:
Environment: Mac OS X (10.4.10) on MacBook Pro I'm a Perl Neophyte. I've downloaded the XML::Parser module and am attempting to install it in my working directory (referenced via PERL5LIB env): ...
9
by: Lie | last post by:
Why this generates AttributeError, then not? Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) on linux2 Type "help", "copyright", "credits" or "license" for more information. Traceback (most...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.