You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Don Willems <do...@mac.com> on 2004/10/22 12:28:32 UTC

WML generates 406 Not Acceptable error

Hi,

I'm generating wml files using cocoon, but I'm getting a 406/Not 
Acceptable error when I use my mobile phone (SE T610) to access the 
page. I can however access the wml page with my desktop browser. I get 
the following http request headers when accessing the page on my 
desktop:

HTTP Status Code: HTTP/1.1 200 OK
X-Cocoon-Version: 2.1.5.1
Last-Modified: Fri, 22 Oct 2004 09:30:14 GMT
Content-Type: text/vnd.wap.wml
Content-Length: 382
Date: Fri, 22 Oct 2004 10:22:45 GMT
Server: Apache-Coyote/1.1
Connection: close

I've read somewhere that the 406 problem is caused by a not acceptable 
mime-type for the requesting browser. But 'text/vnd.wap.wml' seems to 
be correct?

I run cocoon on Tomcat at port 80 on Redhat.
Any ideas?

Many thanks,
Don


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: WML generates 406 Not Acceptable error

Posted by Don Willems <do...@mac.com>.
>> ...I'm generating wml files using cocoon, but I'm getting a 406/Not 
>> Acceptable error when I use my mobile phone (SE T610) to access the 
>> page. I can however access the wml page with my desktop browser. I 
>> get the following http request headers when accessing the page on my 
>> desktop:..
>
> FYI http://wap.nouvo.ch runs on Cocoon (with an httpd front-end) since 
> a few weeks, you might want to try it and compare with what you have.

Yes I can access your site with my phone, apart from a different 
version for cocoon and a different server everything in the headers is 
the same.

>> ...I've read somewhere that the 406 problem is caused by a not 
>> acceptable mime-type for the requesting browser. But 
>> 'text/vnd.wap.wml' seems to be correct?
>
> Does your page contain images? Maybe it's one of the images mime-type 
> that's the problem?

No, it is just a simple test wml file with only text.

Don


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: WML generates 406 Not Acceptable error

Posted by Sandor Spruit <sa...@cs.uu.nl>.
Bertrand Delacretaz wrote:
> Le 22 oct. 04, à 14:09, Sandor Spruit a écrit :
> 
>> ...Troubles start when the stylesheet has an extra namespace to 
>> process the results of the request generator. Somehow, the
>> transformation seems to be producing stuff that the Nokia beast
>> does not like. No idea why!..
> 
> Do you filter out your namespaces at the end of the pipelines? Some
> transformers do leave extra namespaces in the output, which makes the
> WML invalid. Adding a transformation like the one below should help
> if that's the problem.
> 
> Also, it's always a good idea to check your output against the WML
> DTD, emulators are often more permissive than this.

You are right! The wml document produced still has a namespace attribute 
in its document root node. Thanks!

Sandor

-----------------------------------------------------------------------
NEW! international master programme 'Content and Knowledge Engineering'
see: http://www.informationscience.nl/
My personal coordinates: http://www.cs.uu.nl/people/sandor/

"Our minds are harnessed by knowledge, by the hill and the will
to succeed". From: Fish, "Vigil in a wilderness of mirrors"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: WML generates 406 Not Acceptable error

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 22 oct. 04, à 14:09, Sandor Spruit a écrit :
> ...Troubles start when the stylesheet has an extra namespace to 
> process the
> results of the request generator. Somehow, the transformation seems to 
> be producing stuff that the Nokia beast does not like. No idea why!..

Do you filter out your namespaces at the end of the pipelines?
Some transformers do leave extra namespaces in the output, which makes 
the WML invalid.
Adding a transformation like the one below should help if that's the 
problem.

Also, it's always a good idea to check your output against the WML DTD, 
emulators are often more permissive than this.

-Bertrand


    <!-- Copy everything but remove namespace nodes that might have been 
left over -->
     <xsl:template match="*">
         <xsl:element name="{name()}">
             <xsl:apply-templates select="@*|node()"/>
         </xsl:element>
     </xsl:template>

     <xsl:template match="@*|text()|comment()|processing-instruction()">
         <xsl:copy>
             <xsl:apply-templates select="@*|node()"/>
         </xsl:copy>
     </xsl:template>


Re: WML generates 406 Not Acceptable error

Posted by Sandor Spruit <sa...@cs.uu.nl>.
Bertrand Delacretaz wrote:
> Le 22 oct. 04, à 12:28, Don Willems a écrit :
> 
>> ...I'm generating wml files using cocoon, but I'm getting a 406/Not 
>> Acceptable error when I use my mobile phone (SE T610) to access the 
>> page. I can however access the wml page with my desktop browser. I get 
>> the following http request headers when accessing the page on my 
>> desktop:..
> 
> FYI http://wap.nouvo.ch runs on Cocoon (with an httpd front-end) since a 
> few weeks, you might want to try it and compare with what you have.
> 
>> ...I've read somewhere that the 406 problem is caused by a not 
>> acceptable mime-type for the requesting browser. But 
>> 'text/vnd.wap.wml' seems to be correct?
> 
> Does your page contain images? Maybe it's one of the images mime-type 
> that's the problem?

I've got a similar issue here, I think. I'm experimenting with a Nokia
emulator. As long as I serialize .wml files with type="wml", nothing is
wrong. A stylesheet that produces the same static WML-page is also okay.

Troubles start when the stylesheet has an extra namespace to process the
results of the request generator. Somehow, the transformation seems to 
be producing stuff that the Nokia beast does not like. No idea why!

Sandor
-----------------------------------------------------------------------
NEW! international master programme 'Content and Knowledge Engineering'
see: http://www.informationscience.nl/
My personal coordinates: http://www.cs.uu.nl/people/sandor/

"Our minds are harnessed by knowledge, by the hill and the will
to succeed". From: Fish, "Vigil in a wilderness of mirrors"


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: WML generates 406 Not Acceptable error

Posted by Don Willems <do...@mac.com>.
> Does not seem to be valid against the WML DTD.

Apparently that was the problem!

Thanks!

Don


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: WML generates 406 Not Acceptable error

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 22 oct. 04, à 14:30, Don Willems a écrit :

> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" 
> "http://www.wapforum.org/DTD/wml_1.1.xml">
> <wml><head/><card title="Strips" id="De Schorpioen"><p><b>De 
> Schorpioen</b></p><p>1. Het teken van de duivel<br/></p><p>2. Het 
> geheim van de Paus<br/></p><p>3. Het kruis van Petrus<br/></p><p>4. De 
> duivel van het Vaticaan<br/></p></card></wml>

Does not seem to be valid against the WML DTD.

Opening this in JEdit with the XML plugin (for example, there are other 
tools) gives two validation errors.

-Bertrand

Re: WML generates 406 Not Acceptable error

Posted by Don Willems <do...@mac.com>.
> Does your page contain images? Maybe it's one of the images mime-type 
> that's the problem?

This is the wml output (taken from the desktop browser):

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" 
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml><head/><card title="Strips" id="De Schorpioen"><p><b>De 
Schorpioen</b></p><p>1. Het teken van de duivel<br/></p><p>2. Het 
geheim van de Paus<br/></p><p>3. Het kruis van Petrus<br/></p><p>4. De 
duivel van het Vaticaan<br/></p></card></wml>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: WML generates 406 Not Acceptable error

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 22 oct. 04, à 12:28, Don Willems a écrit :

> ...I'm generating wml files using cocoon, but I'm getting a 406/Not 
> Acceptable error when I use my mobile phone (SE T610) to access the 
> page. I can however access the wml page with my desktop browser. I get 
> the following http request headers when accessing the page on my 
> desktop:..

FYI http://wap.nouvo.ch runs on Cocoon (with an httpd front-end) since 
a few weeks, you might want to try it and compare with what you have.

> ...I've read somewhere that the 406 problem is caused by a not 
> acceptable mime-type for the requesting browser. But 
> 'text/vnd.wap.wml' seems to be correct?

Does your page contain images? Maybe it's one of the images mime-type 
that's the problem?

-Bertrand