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,
> Hi,
>
[quoted text clipped - 51 lines]
>
> Regards
Dan Rogers - 07 Dec 2004 20:49 GMT
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?= <Gardar@discussions.microsoft.com>
References: <226924E0-67BB-44BF-A3A1-701C236222AB@microsoft.com>
<GmPQyY92EHA.3388@cpmsftngxa10.phx.gbl>
Subject: RE: xml-stylesheets and web-service
Date: Mon, 6 Dec 2004 19:35:03 -0800
Lines: 78
Message-ID: <92EE3398-3AE4-4479-87C6-BAB23FEBDDF9@microsoft.com>
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,
>
[quoted text clipped - 51 lines]
>
> Regards
Gardar - 08 Dec 2004 00:45 GMT
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,
> Thanks for the response Dan.
>
[quoted text clipped - 72 lines]
> >
> > Regards
Dan Rogers - 13 Dec 2004 20:09 GMT
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?= <Gardar@discussions.microsoft.com>
References: <226924E0-67BB-44BF-A3A1-701C236222AB@microsoft.com>
<GmPQyY92EHA.3388@cpmsftngxa10.phx.gbl>
<92EE3398-3AE4-4479-87C6-BAB23FEBDDF9@microsoft.com>
Subject: RE: xml-stylesheets and web-service
Date: Tue, 7 Dec 2004 16:45:01 -0800
Lines: 113
Message-ID: <B817961C-873F-4BF1-92E0-71998036DCF7@microsoft.com>
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,
> Thanks for the response Dan.
>
[quoted text clipped - 74 lines]
> >
> > Regards