You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Jim Hazen <ji...@myplay.com> on 2001/05/25 22:38:52 UTC

Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

There seems to be a problem in the RPCRouterServlet doGet() method.

Instead of printing the 'GET not supported.  Talk to me using POST' HTTP
response.  My server (old version of Weblogic) starts throwing
IllegalStateExceptions:

java.lang.IllegalStateException: Attempt to change ContentType after calling
getPrintWriter()

I've looked at the code and sure enough, this is the case.

public void doGet (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    PrintWriter out = res.getWriter ();

    res.setContentType("text/html");

...

If the setContentType and getWriter lines are swapped the problem goes away.

Could someone please make this simple fix before the final release.

Thanks,
Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
I'm not opposed to changing it - I was just pointing out that nothing
changed there for 7 months.

Jim, the doGet() is the first part of Apache SOAP an outsider doing
an HTTP GET hits- so there's no way other code changes made this break.
Does your app server not complain about 2.1?

The pushback was because otherwise we're done with 2.2 .. things are
working well and stable. Changes require new testing etc., but this
is minor.

Anyway, if there's a need to change it let's do it .. if we're
changing it I'll change the message to be more useful to beginners
since that appears to be a FAQ.

Sanjiva.

----- Original Message -----
From: "Glen Daniels" <gd...@macromedia.com>
To: <so...@xml.apache.org>
Sent: Saturday, May 26, 2001 6:21 PM
Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3


> It looks to me like the setContentType and the slight html changes were
> added just to make the doGet() code a little cleaner and more correct.  I
> have a strong suspicion that adding the setContentType after the getWriter
> was just an oversight.  Jim can certainly fix it in his version, but IMHO
if
> it causes a problem for anyone, we should fix it.
>
> --G
>
> ----- Original Message -----
> From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> To: <so...@xml.apache.org>
> Sent: Friday, May 25, 2001 11:13 PM
> Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
>
>
> > It appears that the setContentType was introduced between
> > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> >
> >
>
http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apache/soap/se
> > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> >
> > The change was committed October 17th, 2000.
> >
> > That means this code was exactly the same in v2.1 too. I am not
> > inclined to changing it at this point .. without knowing why
> > it was added. Also, the fact that it was not reported for so
> > long means that it must work pretty much all the time.
> >
> > Conceptually, it seems to me that the change you're suggesting is
> > correct. However, given the age of that code ..
> >
> > Sanjiva.
> >
> > ----- Original Message -----
> > From: "Jim Hazen" <ji...@myplay.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, May 25, 2001 4:38 PM
> > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> >
> >
> > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > >
> > > Instead of printing the 'GET not supported.  Talk to me using POST'
HTTP
> > > response.  My server (old version of Weblogic) starts throwing
> > > IllegalStateExceptions:
> > >
> > > java.lang.IllegalStateException: Attempt to change ContentType after
> > calling
> > > getPrintWriter()
> > >
> > > I've looked at the code and sure enough, this is the case.
> > >
> > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > >     throws ServletException, IOException {
> > >     PrintWriter out = res.getWriter ();
> > >
> > >     res.setContentType("text/html");
> > >
> > > ...
> > >
> > > If the setContentType and getWriter lines are swapped the problem goes
> > away.
> > >
> > > Could someone please make this simple fix before the final release.
> > >
> > > Thanks,
> > > Jim
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Jim Hazen <ji...@myplay.com>.
Things work fine in the 2.2 release.  Thanks all.

-Jim

> They work fine in my internal test code.  When rc4 is released I'll be more than
> happy to test the changes there too.
>
> -Jim
>
> > Hi Jim,
> >
> > Ok, I made the swap in both *Router servlets. Please check to make sure they
> > work ok for you now.
> >
> > Thanks,
> > -Matt
> >
> > > -----Original Message-----
> > > From: jim@deathstar.smateo1.sfba.home.com
> > > [mailto:jim@deathstar.smateo1.sfba.home.com]On Behalf Of Jim Hazen
> > > Sent: Sunday, May 27, 2001 3:30 AM
> > > To: soap-user@xml.apache.org
> > > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > >
> > >
> > > Thanks Glen,
> > >
> > > This is a problem for me, and I'm sure many other people.  Using
> > > HTTP GET is
> > > generally a corner case, and as such, people probably don't have
> > > this problem
> > > much.  However it's documented all over the Servlet JavaDoc's
> > > that you *must* do
> > > all setting of the ServletResponse properties before calling
> > > getWriter().  They
> > > even site this example by name.  I've quoted from the Sun Servlet
> > > API 2.2 below:
> > >
> > > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> > > vletResponse.html#getWriter()
> > >
> > > getWriter
> > > public java.io.PrintWriter getWriter()
> > >                               throws java.io.IOException
> > >
> > > Returns a PrintWriter object that can send character text to the
> > > client. The
> > > character encoding used is the one specified in the charset=
> > > property of the
> > > setContentType(java.lang.String) method, which must be called
> > > before calling
> > > this method for the charset to take effect.
> > >
> > > If necessary, the MIME type of the response is modified to
> > > reflect the character
> > > encoding used.
> > >
> > > Either this method or getOutputStream() may be called to write
> > > the body, not
> > > both.
> > >
> > > And setContentType()
> > >
> > > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> > > vletResponse.html#setContentType(java.lang.String)
> > >
> > >
> > >
> > > public void setContentType(java.lang.String type)
> > >
> > > Sets the content type of the response being sent to the client.
> > > The content type
> > > may include the type of character encoding used, for example, text/html;
> > > charset=ISO-8859-4.
> > >
> > > If obtaining a PrintWriter, this method should be called first.
> > >
> > > Of course all Servlet containers are implemented differently and
> > > your mileage
> > > may vary.  I get exceptions under Weblogic 4.5.1.  Under Tomcat
> > > things might be
> > > different, hey it might even work.
> > >
> > > Maybe there were other changes between 2.1 and 2.2 that caused
> > > this problem to
> > > show up.  Maybe somewhere else in the code things were
> > > initialized to have a
> > > content type of text/xml and it's the change to text/html that freaks out
> > > Weblogic.  I'm not really sure, and it doesn't really matter.
> > > The fix to this
> > > problem doesn't take much research.  I've tested this, swap the
> > > two lines and
> > > everything works.  This even makes sense logically.  You should have to
> > > configure the context that is giving you your Writer before you
> > > get it.  And
> > > once gotten shouldn't be able to change things like content type,
> > > since the
> > > content type needs to be sent with the HTTP headers and as such,
> > > after you've
> > > started to stream data can't be changed.
> > >
> > > I think this is a pretty legit and simple request, and don't
> > > quite understand
> > > the push back on this.
> > >
> > > -Jim
> > >
> > > > It looks to me like the setContentType and the slight html changes were
> > > > added just to make the doGet() code a little cleaner and more
> > > correct.  I
> > > > have a strong suspicion that adding the setContentType after
> > > the getWriter
> > > > was just an oversight.  Jim can certainly fix it in his
> > > version, but IMHO if
> > > > it causes a problem for anyone, we should fix it.
> > > >
> > > > --G
> > > >
> > > > ----- Original Message -----
> > > > From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, May 25, 2001 11:13 PM
> > > > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > > >
> > > > > It appears that the setContentType was introduced between
> > > > > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> > > > >
> > > > >
> > > >
> > > http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apac
> > > he/soap/se
> > > > > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> > > > >
> > > > > The change was committed October 17th, 2000.
> > > > >
> > > > > That means this code was exactly the same in v2.1 too. I am not
> > > > > inclined to changing it at this point .. without knowing why
> > > > > it was added. Also, the fact that it was not reported for so
> > > > > long means that it must work pretty much all the time.
> > > > >
> > > > > Conceptually, it seems to me that the change you're suggesting is
> > > > > correct. However, given the age of that code ..
> > > > >
> > > > > Sanjiva.
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Jim Hazen" <ji...@myplay.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Friday, May 25, 2001 4:38 PM
> > > > > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > > > >
> > > > >
> > > > > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > > > > >
> > > > > > Instead of printing the 'GET not supported.  Talk to me
> > > using POST' HTTP
> > > > > > response.  My server (old version of Weblogic) starts throwing
> > > > > > IllegalStateExceptions:
> > > > > >
> > > > > > java.lang.IllegalStateException: Attempt to change ContentType after
> > > > > calling
> > > > > > getPrintWriter()
> > > > > >
> > > > > > I've looked at the code and sure enough, this is the case.
> > > > > >
> > > > > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > > > > >     throws ServletException, IOException {
> > > > > >     PrintWriter out = res.getWriter ();
> > > > > >
> > > > > >     res.setContentType("text/html");
> > > > > >
> > > > > > ...
> > > > > >
> > > > > > If the setContentType and getWriter lines are swapped the
> > > problem goes
> > > > > away.
> > > > > >
> > > > > > Could someone please make this simple fix before the final release.
> > > > > >
> > > > > > Thanks,
> > > > > > Jim
> > > > > >
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > > > For additional commands, email: soap-user-help@xml.apache.org
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > > For additional commands, email: soap-user-help@xml.apache.org
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > For additional commands, email: soap-user-help@xml.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Jim Hazen <ji...@myplay.com>.
Things work fine in the 2.2 release.  Thanks all.

-Jim

> They work fine in my internal test code.  When rc4 is released I'll be more than
> happy to test the changes there too.
>
> -Jim
>
> > Hi Jim,
> >
> > Ok, I made the swap in both *Router servlets. Please check to make sure they
> > work ok for you now.
> >
> > Thanks,
> > -Matt
> >
> > > -----Original Message-----
> > > From: jim@deathstar.smateo1.sfba.home.com
> > > [mailto:jim@deathstar.smateo1.sfba.home.com]On Behalf Of Jim Hazen
> > > Sent: Sunday, May 27, 2001 3:30 AM
> > > To: soap-user@xml.apache.org
> > > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > >
> > >
> > > Thanks Glen,
> > >
> > > This is a problem for me, and I'm sure many other people.  Using
> > > HTTP GET is
> > > generally a corner case, and as such, people probably don't have
> > > this problem
> > > much.  However it's documented all over the Servlet JavaDoc's
> > > that you *must* do
> > > all setting of the ServletResponse properties before calling
> > > getWriter().  They
> > > even site this example by name.  I've quoted from the Sun Servlet
> > > API 2.2 below:
> > >
> > > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> > > vletResponse.html#getWriter()
> > >
> > > getWriter
> > > public java.io.PrintWriter getWriter()
> > >                               throws java.io.IOException
> > >
> > > Returns a PrintWriter object that can send character text to the
> > > client. The
> > > character encoding used is the one specified in the charset=
> > > property of the
> > > setContentType(java.lang.String) method, which must be called
> > > before calling
> > > this method for the charset to take effect.
> > >
> > > If necessary, the MIME type of the response is modified to
> > > reflect the character
> > > encoding used.
> > >
> > > Either this method or getOutputStream() may be called to write
> > > the body, not
> > > both.
> > >
> > > And setContentType()
> > >
> > > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> > > vletResponse.html#setContentType(java.lang.String)
> > >
> > >
> > >
> > > public void setContentType(java.lang.String type)
> > >
> > > Sets the content type of the response being sent to the client.
> > > The content type
> > > may include the type of character encoding used, for example, text/html;
> > > charset=ISO-8859-4.
> > >
> > > If obtaining a PrintWriter, this method should be called first.
> > >
> > > Of course all Servlet containers are implemented differently and
> > > your mileage
> > > may vary.  I get exceptions under Weblogic 4.5.1.  Under Tomcat
> > > things might be
> > > different, hey it might even work.
> > >
> > > Maybe there were other changes between 2.1 and 2.2 that caused
> > > this problem to
> > > show up.  Maybe somewhere else in the code things were
> > > initialized to have a
> > > content type of text/xml and it's the change to text/html that freaks out
> > > Weblogic.  I'm not really sure, and it doesn't really matter.
> > > The fix to this
> > > problem doesn't take much research.  I've tested this, swap the
> > > two lines and
> > > everything works.  This even makes sense logically.  You should have to
> > > configure the context that is giving you your Writer before you
> > > get it.  And
> > > once gotten shouldn't be able to change things like content type,
> > > since the
> > > content type needs to be sent with the HTTP headers and as such,
> > > after you've
> > > started to stream data can't be changed.
> > >
> > > I think this is a pretty legit and simple request, and don't
> > > quite understand
> > > the push back on this.
> > >
> > > -Jim
> > >
> > > > It looks to me like the setContentType and the slight html changes were
> > > > added just to make the doGet() code a little cleaner and more
> > > correct.  I
> > > > have a strong suspicion that adding the setContentType after
> > > the getWriter
> > > > was just an oversight.  Jim can certainly fix it in his
> > > version, but IMHO if
> > > > it causes a problem for anyone, we should fix it.
> > > >
> > > > --G
> > > >
> > > > ----- Original Message -----
> > > > From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, May 25, 2001 11:13 PM
> > > > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > > >
> > > > > It appears that the setContentType was introduced between
> > > > > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> > > > >
> > > > >
> > > >
> > > http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apac
> > > he/soap/se
> > > > > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> > > > >
> > > > > The change was committed October 17th, 2000.
> > > > >
> > > > > That means this code was exactly the same in v2.1 too. I am not
> > > > > inclined to changing it at this point .. without knowing why
> > > > > it was added. Also, the fact that it was not reported for so
> > > > > long means that it must work pretty much all the time.
> > > > >
> > > > > Conceptually, it seems to me that the change you're suggesting is
> > > > > correct. However, given the age of that code ..
> > > > >
> > > > > Sanjiva.
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Jim Hazen" <ji...@myplay.com>
> > > > > To: <so...@xml.apache.org>
> > > > > Sent: Friday, May 25, 2001 4:38 PM
> > > > > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > > > >
> > > > >
> > > > > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > > > > >
> > > > > > Instead of printing the 'GET not supported.  Talk to me
> > > using POST' HTTP
> > > > > > response.  My server (old version of Weblogic) starts throwing
> > > > > > IllegalStateExceptions:
> > > > > >
> > > > > > java.lang.IllegalStateException: Attempt to change ContentType after
> > > > > calling
> > > > > > getPrintWriter()
> > > > > >
> > > > > > I've looked at the code and sure enough, this is the case.
> > > > > >
> > > > > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > > > > >     throws ServletException, IOException {
> > > > > >     PrintWriter out = res.getWriter ();
> > > > > >
> > > > > >     res.setContentType("text/html");
> > > > > >
> > > > > > ...
> > > > > >
> > > > > > If the setContentType and getWriter lines are swapped the
> > > problem goes
> > > > > away.
> > > > > >
> > > > > > Could someone please make this simple fix before the final release.
> > > > > >
> > > > > > Thanks,
> > > > > > Jim
> > > > > >
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > > > For additional commands, email: soap-user-help@xml.apache.org
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > > For additional commands, email: soap-user-help@xml.apache.org
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > For additional commands, email: soap-user-help@xml.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Jim Hazen <ji...@myplay.com>.
They work fine in my internal test code.  When rc4 is released I'll be more than
happy to test the changes there too.

-Jim

> Hi Jim,
>
> Ok, I made the swap in both *Router servlets. Please check to make sure they
> work ok for you now.
>
> Thanks,
> -Matt
>
> > -----Original Message-----
> > From: jim@deathstar.smateo1.sfba.home.com
> > [mailto:jim@deathstar.smateo1.sfba.home.com]On Behalf Of Jim Hazen
> > Sent: Sunday, May 27, 2001 3:30 AM
> > To: soap-user@xml.apache.org
> > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> >
> >
> > Thanks Glen,
> >
> > This is a problem for me, and I'm sure many other people.  Using
> > HTTP GET is
> > generally a corner case, and as such, people probably don't have
> > this problem
> > much.  However it's documented all over the Servlet JavaDoc's
> > that you *must* do
> > all setting of the ServletResponse properties before calling
> > getWriter().  They
> > even site this example by name.  I've quoted from the Sun Servlet
> > API 2.2 below:
> >
> > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> > vletResponse.html#getWriter()
> >
> > getWriter
> > public java.io.PrintWriter getWriter()
> >                               throws java.io.IOException
> >
> > Returns a PrintWriter object that can send character text to the
> > client. The
> > character encoding used is the one specified in the charset=
> > property of the
> > setContentType(java.lang.String) method, which must be called
> > before calling
> > this method for the charset to take effect.
> >
> > If necessary, the MIME type of the response is modified to
> > reflect the character
> > encoding used.
> >
> > Either this method or getOutputStream() may be called to write
> > the body, not
> > both.
> >
> > And setContentType()
> >
> > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> > vletResponse.html#setContentType(java.lang.String)
> >
> >
> >
> > public void setContentType(java.lang.String type)
> >
> > Sets the content type of the response being sent to the client.
> > The content type
> > may include the type of character encoding used, for example, text/html;
> > charset=ISO-8859-4.
> >
> > If obtaining a PrintWriter, this method should be called first.
> >
> > Of course all Servlet containers are implemented differently and
> > your mileage
> > may vary.  I get exceptions under Weblogic 4.5.1.  Under Tomcat
> > things might be
> > different, hey it might even work.
> >
> > Maybe there were other changes between 2.1 and 2.2 that caused
> > this problem to
> > show up.  Maybe somewhere else in the code things were
> > initialized to have a
> > content type of text/xml and it's the change to text/html that freaks out
> > Weblogic.  I'm not really sure, and it doesn't really matter.
> > The fix to this
> > problem doesn't take much research.  I've tested this, swap the
> > two lines and
> > everything works.  This even makes sense logically.  You should have to
> > configure the context that is giving you your Writer before you
> > get it.  And
> > once gotten shouldn't be able to change things like content type,
> > since the
> > content type needs to be sent with the HTTP headers and as such,
> > after you've
> > started to stream data can't be changed.
> >
> > I think this is a pretty legit and simple request, and don't
> > quite understand
> > the push back on this.
> >
> > -Jim
> >
> > > It looks to me like the setContentType and the slight html changes were
> > > added just to make the doGet() code a little cleaner and more
> > correct.  I
> > > have a strong suspicion that adding the setContentType after
> > the getWriter
> > > was just an oversight.  Jim can certainly fix it in his
> > version, but IMHO if
> > > it causes a problem for anyone, we should fix it.
> > >
> > > --G
> > >
> > > ----- Original Message -----
> > > From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, May 25, 2001 11:13 PM
> > > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > >
> > > > It appears that the setContentType was introduced between
> > > > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> > > >
> > > >
> > >
> > http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apac
> > he/soap/se
> > > > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> > > >
> > > > The change was committed October 17th, 2000.
> > > >
> > > > That means this code was exactly the same in v2.1 too. I am not
> > > > inclined to changing it at this point .. without knowing why
> > > > it was added. Also, the fact that it was not reported for so
> > > > long means that it must work pretty much all the time.
> > > >
> > > > Conceptually, it seems to me that the change you're suggesting is
> > > > correct. However, given the age of that code ..
> > > >
> > > > Sanjiva.
> > > >
> > > > ----- Original Message -----
> > > > From: "Jim Hazen" <ji...@myplay.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, May 25, 2001 4:38 PM
> > > > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > > >
> > > >
> > > > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > > > >
> > > > > Instead of printing the 'GET not supported.  Talk to me
> > using POST' HTTP
> > > > > response.  My server (old version of Weblogic) starts throwing
> > > > > IllegalStateExceptions:
> > > > >
> > > > > java.lang.IllegalStateException: Attempt to change ContentType after
> > > > calling
> > > > > getPrintWriter()
> > > > >
> > > > > I've looked at the code and sure enough, this is the case.
> > > > >
> > > > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > > > >     throws ServletException, IOException {
> > > > >     PrintWriter out = res.getWriter ();
> > > > >
> > > > >     res.setContentType("text/html");
> > > > >
> > > > > ...
> > > > >
> > > > > If the setContentType and getWriter lines are swapped the
> > problem goes
> > > > away.
> > > > >
> > > > > Could someone please make this simple fix before the final release.
> > > > >
> > > > > Thanks,
> > > > > Jim
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > > For additional commands, email: soap-user-help@xml.apache.org
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > For additional commands, email: soap-user-help@xml.apache.org
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Jim Hazen <ji...@myplay.com>.
They work fine in my internal test code.  When rc4 is released I'll be more than
happy to test the changes there too.

-Jim

> Hi Jim,
>
> Ok, I made the swap in both *Router servlets. Please check to make sure they
> work ok for you now.
>
> Thanks,
> -Matt
>
> > -----Original Message-----
> > From: jim@deathstar.smateo1.sfba.home.com
> > [mailto:jim@deathstar.smateo1.sfba.home.com]On Behalf Of Jim Hazen
> > Sent: Sunday, May 27, 2001 3:30 AM
> > To: soap-user@xml.apache.org
> > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> >
> >
> > Thanks Glen,
> >
> > This is a problem for me, and I'm sure many other people.  Using
> > HTTP GET is
> > generally a corner case, and as such, people probably don't have
> > this problem
> > much.  However it's documented all over the Servlet JavaDoc's
> > that you *must* do
> > all setting of the ServletResponse properties before calling
> > getWriter().  They
> > even site this example by name.  I've quoted from the Sun Servlet
> > API 2.2 below:
> >
> > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> > vletResponse.html#getWriter()
> >
> > getWriter
> > public java.io.PrintWriter getWriter()
> >                               throws java.io.IOException
> >
> > Returns a PrintWriter object that can send character text to the
> > client. The
> > character encoding used is the one specified in the charset=
> > property of the
> > setContentType(java.lang.String) method, which must be called
> > before calling
> > this method for the charset to take effect.
> >
> > If necessary, the MIME type of the response is modified to
> > reflect the character
> > encoding used.
> >
> > Either this method or getOutputStream() may be called to write
> > the body, not
> > both.
> >
> > And setContentType()
> >
> > http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> > vletResponse.html#setContentType(java.lang.String)
> >
> >
> >
> > public void setContentType(java.lang.String type)
> >
> > Sets the content type of the response being sent to the client.
> > The content type
> > may include the type of character encoding used, for example, text/html;
> > charset=ISO-8859-4.
> >
> > If obtaining a PrintWriter, this method should be called first.
> >
> > Of course all Servlet containers are implemented differently and
> > your mileage
> > may vary.  I get exceptions under Weblogic 4.5.1.  Under Tomcat
> > things might be
> > different, hey it might even work.
> >
> > Maybe there were other changes between 2.1 and 2.2 that caused
> > this problem to
> > show up.  Maybe somewhere else in the code things were
> > initialized to have a
> > content type of text/xml and it's the change to text/html that freaks out
> > Weblogic.  I'm not really sure, and it doesn't really matter.
> > The fix to this
> > problem doesn't take much research.  I've tested this, swap the
> > two lines and
> > everything works.  This even makes sense logically.  You should have to
> > configure the context that is giving you your Writer before you
> > get it.  And
> > once gotten shouldn't be able to change things like content type,
> > since the
> > content type needs to be sent with the HTTP headers and as such,
> > after you've
> > started to stream data can't be changed.
> >
> > I think this is a pretty legit and simple request, and don't
> > quite understand
> > the push back on this.
> >
> > -Jim
> >
> > > It looks to me like the setContentType and the slight html changes were
> > > added just to make the doGet() code a little cleaner and more
> > correct.  I
> > > have a strong suspicion that adding the setContentType after
> > the getWriter
> > > was just an oversight.  Jim can certainly fix it in his
> > version, but IMHO if
> > > it causes a problem for anyone, we should fix it.
> > >
> > > --G
> > >
> > > ----- Original Message -----
> > > From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, May 25, 2001 11:13 PM
> > > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > >
> > > > It appears that the setContentType was introduced between
> > > > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> > > >
> > > >
> > >
> > http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apac
> > he/soap/se
> > > > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> > > >
> > > > The change was committed October 17th, 2000.
> > > >
> > > > That means this code was exactly the same in v2.1 too. I am not
> > > > inclined to changing it at this point .. without knowing why
> > > > it was added. Also, the fact that it was not reported for so
> > > > long means that it must work pretty much all the time.
> > > >
> > > > Conceptually, it seems to me that the change you're suggesting is
> > > > correct. However, given the age of that code ..
> > > >
> > > > Sanjiva.
> > > >
> > > > ----- Original Message -----
> > > > From: "Jim Hazen" <ji...@myplay.com>
> > > > To: <so...@xml.apache.org>
> > > > Sent: Friday, May 25, 2001 4:38 PM
> > > > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > > >
> > > >
> > > > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > > > >
> > > > > Instead of printing the 'GET not supported.  Talk to me
> > using POST' HTTP
> > > > > response.  My server (old version of Weblogic) starts throwing
> > > > > IllegalStateExceptions:
> > > > >
> > > > > java.lang.IllegalStateException: Attempt to change ContentType after
> > > > calling
> > > > > getPrintWriter()
> > > > >
> > > > > I've looked at the code and sure enough, this is the case.
> > > > >
> > > > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > > > >     throws ServletException, IOException {
> > > > >     PrintWriter out = res.getWriter ();
> > > > >
> > > > >     res.setContentType("text/html");
> > > > >
> > > > > ...
> > > > >
> > > > > If the setContentType and getWriter lines are swapped the
> > problem goes
> > > > away.
> > > > >
> > > > > Could someone please make this simple fix before the final release.
> > > > >
> > > > > Thanks,
> > > > > Jim
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > > For additional commands, email: soap-user-help@xml.apache.org
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > For additional commands, email: soap-user-help@xml.apache.org
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


RE: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by "Matthew J. Duftler" <du...@watson.ibm.com>.
Hi Jim,

Ok, I made the swap in both *Router servlets. Please check to make sure they
work ok for you now.

Thanks,
-Matt

> -----Original Message-----
> From: jim@deathstar.smateo1.sfba.home.com
> [mailto:jim@deathstar.smateo1.sfba.home.com]On Behalf Of Jim Hazen
> Sent: Sunday, May 27, 2001 3:30 AM
> To: soap-user@xml.apache.org
> Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
>
>
> Thanks Glen,
>
> This is a problem for me, and I'm sure many other people.  Using
> HTTP GET is
> generally a corner case, and as such, people probably don't have
> this problem
> much.  However it's documented all over the Servlet JavaDoc's
> that you *must* do
> all setting of the ServletResponse properties before calling
> getWriter().  They
> even site this example by name.  I've quoted from the Sun Servlet
> API 2.2 below:
>
> http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> vletResponse.html#getWriter()
>
> getWriter
> public java.io.PrintWriter getWriter()
>                               throws java.io.IOException
>
> Returns a PrintWriter object that can send character text to the
> client. The
> character encoding used is the one specified in the charset=
> property of the
> setContentType(java.lang.String) method, which must be called
> before calling
> this method for the charset to take effect.
>
> If necessary, the MIME type of the response is modified to
> reflect the character
> encoding used.
>
> Either this method or getOutputStream() may be called to write
> the body, not
> both.
>
> And setContentType()
>
> http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> vletResponse.html#setContentType(java.lang.String)
>
>
>
> public void setContentType(java.lang.String type)
>
> Sets the content type of the response being sent to the client.
> The content type
> may include the type of character encoding used, for example, text/html;
> charset=ISO-8859-4.
>
> If obtaining a PrintWriter, this method should be called first.
>
> Of course all Servlet containers are implemented differently and
> your mileage
> may vary.  I get exceptions under Weblogic 4.5.1.  Under Tomcat
> things might be
> different, hey it might even work.
>
> Maybe there were other changes between 2.1 and 2.2 that caused
> this problem to
> show up.  Maybe somewhere else in the code things were
> initialized to have a
> content type of text/xml and it's the change to text/html that freaks out
> Weblogic.  I'm not really sure, and it doesn't really matter.
> The fix to this
> problem doesn't take much research.  I've tested this, swap the
> two lines and
> everything works.  This even makes sense logically.  You should have to
> configure the context that is giving you your Writer before you
> get it.  And
> once gotten shouldn't be able to change things like content type,
> since the
> content type needs to be sent with the HTTP headers and as such,
> after you've
> started to stream data can't be changed.
>
> I think this is a pretty legit and simple request, and don't
> quite understand
> the push back on this.
>
> -Jim
>
> > It looks to me like the setContentType and the slight html changes were
> > added just to make the doGet() code a little cleaner and more
> correct.  I
> > have a strong suspicion that adding the setContentType after
> the getWriter
> > was just an oversight.  Jim can certainly fix it in his
> version, but IMHO if
> > it causes a problem for anyone, we should fix it.
> >
> > --G
> >
> > ----- Original Message -----
> > From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, May 25, 2001 11:13 PM
> > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> >
> > > It appears that the setContentType was introduced between
> > > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> > >
> > >
> >
> http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apac
> he/soap/se
> > > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> > >
> > > The change was committed October 17th, 2000.
> > >
> > > That means this code was exactly the same in v2.1 too. I am not
> > > inclined to changing it at this point .. without knowing why
> > > it was added. Also, the fact that it was not reported for so
> > > long means that it must work pretty much all the time.
> > >
> > > Conceptually, it seems to me that the change you're suggesting is
> > > correct. However, given the age of that code ..
> > >
> > > Sanjiva.
> > >
> > > ----- Original Message -----
> > > From: "Jim Hazen" <ji...@myplay.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, May 25, 2001 4:38 PM
> > > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > >
> > >
> > > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > > >
> > > > Instead of printing the 'GET not supported.  Talk to me
> using POST' HTTP
> > > > response.  My server (old version of Weblogic) starts throwing
> > > > IllegalStateExceptions:
> > > >
> > > > java.lang.IllegalStateException: Attempt to change ContentType after
> > > calling
> > > > getPrintWriter()
> > > >
> > > > I've looked at the code and sure enough, this is the case.
> > > >
> > > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > > >     throws ServletException, IOException {
> > > >     PrintWriter out = res.getWriter ();
> > > >
> > > >     res.setContentType("text/html");
> > > >
> > > > ...
> > > >
> > > > If the setContentType and getWriter lines are swapped the
> problem goes
> > > away.
> > > >
> > > > Could someone please make this simple fix before the final release.
> > > >
> > > > Thanks,
> > > > Jim
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > For additional commands, email: soap-user-help@xml.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


RE: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by "Matthew J. Duftler" <du...@watson.ibm.com>.
Hi Jim,

Ok, I made the swap in both *Router servlets. Please check to make sure they
work ok for you now.

Thanks,
-Matt

> -----Original Message-----
> From: jim@deathstar.smateo1.sfba.home.com
> [mailto:jim@deathstar.smateo1.sfba.home.com]On Behalf Of Jim Hazen
> Sent: Sunday, May 27, 2001 3:30 AM
> To: soap-user@xml.apache.org
> Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
>
>
> Thanks Glen,
>
> This is a problem for me, and I'm sure many other people.  Using
> HTTP GET is
> generally a corner case, and as such, people probably don't have
> this problem
> much.  However it's documented all over the Servlet JavaDoc's
> that you *must* do
> all setting of the ServletResponse properties before calling
> getWriter().  They
> even site this example by name.  I've quoted from the Sun Servlet
> API 2.2 below:
>
> http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> vletResponse.html#getWriter()
>
> getWriter
> public java.io.PrintWriter getWriter()
>                               throws java.io.IOException
>
> Returns a PrintWriter object that can send character text to the
> client. The
> character encoding used is the one specified in the charset=
> property of the
> setContentType(java.lang.String) method, which must be called
> before calling
> this method for the charset to take effect.
>
> If necessary, the MIME type of the response is modified to
> reflect the character
> encoding used.
>
> Either this method or getOutputStream() may be called to write
> the body, not
> both.
>
> And setContentType()
>
> http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/Ser
> vletResponse.html#setContentType(java.lang.String)
>
>
>
> public void setContentType(java.lang.String type)
>
> Sets the content type of the response being sent to the client.
> The content type
> may include the type of character encoding used, for example, text/html;
> charset=ISO-8859-4.
>
> If obtaining a PrintWriter, this method should be called first.
>
> Of course all Servlet containers are implemented differently and
> your mileage
> may vary.  I get exceptions under Weblogic 4.5.1.  Under Tomcat
> things might be
> different, hey it might even work.
>
> Maybe there were other changes between 2.1 and 2.2 that caused
> this problem to
> show up.  Maybe somewhere else in the code things were
> initialized to have a
> content type of text/xml and it's the change to text/html that freaks out
> Weblogic.  I'm not really sure, and it doesn't really matter.
> The fix to this
> problem doesn't take much research.  I've tested this, swap the
> two lines and
> everything works.  This even makes sense logically.  You should have to
> configure the context that is giving you your Writer before you
> get it.  And
> once gotten shouldn't be able to change things like content type,
> since the
> content type needs to be sent with the HTTP headers and as such,
> after you've
> started to stream data can't be changed.
>
> I think this is a pretty legit and simple request, and don't
> quite understand
> the push back on this.
>
> -Jim
>
> > It looks to me like the setContentType and the slight html changes were
> > added just to make the doGet() code a little cleaner and more
> correct.  I
> > have a strong suspicion that adding the setContentType after
> the getWriter
> > was just an oversight.  Jim can certainly fix it in his
> version, but IMHO if
> > it causes a problem for anyone, we should fix it.
> >
> > --G
> >
> > ----- Original Message -----
> > From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, May 25, 2001 11:13 PM
> > Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> >
> > > It appears that the setContentType was introduced between
> > > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> > >
> > >
> >
> http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apac
> he/soap/se
> > > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> > >
> > > The change was committed October 17th, 2000.
> > >
> > > That means this code was exactly the same in v2.1 too. I am not
> > > inclined to changing it at this point .. without knowing why
> > > it was added. Also, the fact that it was not reported for so
> > > long means that it must work pretty much all the time.
> > >
> > > Conceptually, it seems to me that the change you're suggesting is
> > > correct. However, given the age of that code ..
> > >
> > > Sanjiva.
> > >
> > > ----- Original Message -----
> > > From: "Jim Hazen" <ji...@myplay.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Friday, May 25, 2001 4:38 PM
> > > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> > >
> > >
> > > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > > >
> > > > Instead of printing the 'GET not supported.  Talk to me
> using POST' HTTP
> > > > response.  My server (old version of Weblogic) starts throwing
> > > > IllegalStateExceptions:
> > > >
> > > > java.lang.IllegalStateException: Attempt to change ContentType after
> > > calling
> > > > getPrintWriter()
> > > >
> > > > I've looked at the code and sure enough, this is the case.
> > > >
> > > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > > >     throws ServletException, IOException {
> > > >     PrintWriter out = res.getWriter ();
> > > >
> > > >     res.setContentType("text/html");
> > > >
> > > > ...
> > > >
> > > > If the setContentType and getWriter lines are swapped the
> problem goes
> > > away.
> > > >
> > > > Could someone please make this simple fix before the final release.
> > > >
> > > > Thanks,
> > > > Jim
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > > For additional commands, email: soap-user-help@xml.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Jim Hazen <ji...@myplay.com>.
Thanks Glen,

This is a problem for me, and I'm sure many other people.  Using HTTP GET is
generally a corner case, and as such, people probably don't have this problem
much.  However it's documented all over the Servlet JavaDoc's that you *must* do
all setting of the ServletResponse properties before calling getWriter().  They
even site this example by name.  I've quoted from the Sun Servlet API 2.2 below:

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletResponse.html#getWriter()

getWriter
public java.io.PrintWriter getWriter()
                              throws java.io.IOException

Returns a PrintWriter object that can send character text to the client. The
character encoding used is the one specified in the charset= property of the
setContentType(java.lang.String) method, which must be called before calling
this method for the charset to take effect.

If necessary, the MIME type of the response is modified to reflect the character
encoding used.

Either this method or getOutputStream() may be called to write the body, not
both.

And setContentType()

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletResponse.html#setContentType(java.lang.String)



public void setContentType(java.lang.String type)

Sets the content type of the response being sent to the client. The content type
may include the type of character encoding used, for example, text/html;
charset=ISO-8859-4.

If obtaining a PrintWriter, this method should be called first.

Of course all Servlet containers are implemented differently and your mileage
may vary.  I get exceptions under Weblogic 4.5.1.  Under Tomcat things might be
different, hey it might even work.

Maybe there were other changes between 2.1 and 2.2 that caused this problem to
show up.  Maybe somewhere else in the code things were initialized to have a
content type of text/xml and it's the change to text/html that freaks out
Weblogic.  I'm not really sure, and it doesn't really matter.  The fix to this
problem doesn't take much research.  I've tested this, swap the two lines and
everything works.  This even makes sense logically.  You should have to
configure the context that is giving you your Writer before you get it.  And
once gotten shouldn't be able to change things like content type, since the
content type needs to be sent with the HTTP headers and as such, after you've
started to stream data can't be changed.

I think this is a pretty legit and simple request, and don't quite understand
the push back on this.

-Jim

> It looks to me like the setContentType and the slight html changes were
> added just to make the doGet() code a little cleaner and more correct.  I
> have a strong suspicion that adding the setContentType after the getWriter
> was just an oversight.  Jim can certainly fix it in his version, but IMHO if
> it causes a problem for anyone, we should fix it.
>
> --G
>
> ----- Original Message -----
> From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> To: <so...@xml.apache.org>
> Sent: Friday, May 25, 2001 11:13 PM
> Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
>
> > It appears that the setContentType was introduced between
> > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> >
> >
> http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apache/soap/se
> > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> >
> > The change was committed October 17th, 2000.
> >
> > That means this code was exactly the same in v2.1 too. I am not
> > inclined to changing it at this point .. without knowing why
> > it was added. Also, the fact that it was not reported for so
> > long means that it must work pretty much all the time.
> >
> > Conceptually, it seems to me that the change you're suggesting is
> > correct. However, given the age of that code ..
> >
> > Sanjiva.
> >
> > ----- Original Message -----
> > From: "Jim Hazen" <ji...@myplay.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, May 25, 2001 4:38 PM
> > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> >
> >
> > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > >
> > > Instead of printing the 'GET not supported.  Talk to me using POST' HTTP
> > > response.  My server (old version of Weblogic) starts throwing
> > > IllegalStateExceptions:
> > >
> > > java.lang.IllegalStateException: Attempt to change ContentType after
> > calling
> > > getPrintWriter()
> > >
> > > I've looked at the code and sure enough, this is the case.
> > >
> > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > >     throws ServletException, IOException {
> > >     PrintWriter out = res.getWriter ();
> > >
> > >     res.setContentType("text/html");
> > >
> > > ...
> > >
> > > If the setContentType and getWriter lines are swapped the problem goes
> > away.
> > >
> > > Could someone please make this simple fix before the final release.
> > >
> > > Thanks,
> > > Jim
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Jim Hazen <ji...@myplay.com>.
Thanks Glen,

This is a problem for me, and I'm sure many other people.  Using HTTP GET is
generally a corner case, and as such, people probably don't have this problem
much.  However it's documented all over the Servlet JavaDoc's that you *must* do
all setting of the ServletResponse properties before calling getWriter().  They
even site this example by name.  I've quoted from the Sun Servlet API 2.2 below:

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletResponse.html#getWriter()

getWriter
public java.io.PrintWriter getWriter()
                              throws java.io.IOException

Returns a PrintWriter object that can send character text to the client. The
character encoding used is the one specified in the charset= property of the
setContentType(java.lang.String) method, which must be called before calling
this method for the charset to take effect.

If necessary, the MIME type of the response is modified to reflect the character
encoding used.

Either this method or getOutputStream() may be called to write the body, not
both.

And setContentType()

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletResponse.html#setContentType(java.lang.String)



public void setContentType(java.lang.String type)

Sets the content type of the response being sent to the client. The content type
may include the type of character encoding used, for example, text/html;
charset=ISO-8859-4.

If obtaining a PrintWriter, this method should be called first.

Of course all Servlet containers are implemented differently and your mileage
may vary.  I get exceptions under Weblogic 4.5.1.  Under Tomcat things might be
different, hey it might even work.

Maybe there were other changes between 2.1 and 2.2 that caused this problem to
show up.  Maybe somewhere else in the code things were initialized to have a
content type of text/xml and it's the change to text/html that freaks out
Weblogic.  I'm not really sure, and it doesn't really matter.  The fix to this
problem doesn't take much research.  I've tested this, swap the two lines and
everything works.  This even makes sense logically.  You should have to
configure the context that is giving you your Writer before you get it.  And
once gotten shouldn't be able to change things like content type, since the
content type needs to be sent with the HTTP headers and as such, after you've
started to stream data can't be changed.

I think this is a pretty legit and simple request, and don't quite understand
the push back on this.

-Jim

> It looks to me like the setContentType and the slight html changes were
> added just to make the doGet() code a little cleaner and more correct.  I
> have a strong suspicion that adding the setContentType after the getWriter
> was just an oversight.  Jim can certainly fix it in his version, but IMHO if
> it causes a problem for anyone, we should fix it.
>
> --G
>
> ----- Original Message -----
> From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> To: <so...@xml.apache.org>
> Sent: Friday, May 25, 2001 11:13 PM
> Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
>
> > It appears that the setContentType was introduced between
> > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> >
> >
> http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apache/soap/se
> > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> >
> > The change was committed October 17th, 2000.
> >
> > That means this code was exactly the same in v2.1 too. I am not
> > inclined to changing it at this point .. without knowing why
> > it was added. Also, the fact that it was not reported for so
> > long means that it must work pretty much all the time.
> >
> > Conceptually, it seems to me that the change you're suggesting is
> > correct. However, given the age of that code ..
> >
> > Sanjiva.
> >
> > ----- Original Message -----
> > From: "Jim Hazen" <ji...@myplay.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, May 25, 2001 4:38 PM
> > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> >
> >
> > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > >
> > > Instead of printing the 'GET not supported.  Talk to me using POST' HTTP
> > > response.  My server (old version of Weblogic) starts throwing
> > > IllegalStateExceptions:
> > >
> > > java.lang.IllegalStateException: Attempt to change ContentType after
> > calling
> > > getPrintWriter()
> > >
> > > I've looked at the code and sure enough, this is the case.
> > >
> > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > >     throws ServletException, IOException {
> > >     PrintWriter out = res.getWriter ();
> > >
> > >     res.setContentType("text/html");
> > >
> > > ...
> > >
> > > If the setContentType and getWriter lines are swapped the problem goes
> > away.
> > >
> > > Could someone please make this simple fix before the final release.
> > >
> > > Thanks,
> > > Jim
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
I'm not opposed to changing it - I was just pointing out that nothing
changed there for 7 months.

Jim, the doGet() is the first part of Apache SOAP an outsider doing
an HTTP GET hits- so there's no way other code changes made this break.
Does your app server not complain about 2.1?

The pushback was because otherwise we're done with 2.2 .. things are
working well and stable. Changes require new testing etc., but this
is minor.

Anyway, if there's a need to change it let's do it .. if we're
changing it I'll change the message to be more useful to beginners
since that appears to be a FAQ.

Sanjiva.

----- Original Message -----
From: "Glen Daniels" <gd...@macromedia.com>
To: <so...@xml.apache.org>
Sent: Saturday, May 26, 2001 6:21 PM
Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3


> It looks to me like the setContentType and the slight html changes were
> added just to make the doGet() code a little cleaner and more correct.  I
> have a strong suspicion that adding the setContentType after the getWriter
> was just an oversight.  Jim can certainly fix it in his version, but IMHO
if
> it causes a problem for anyone, we should fix it.
>
> --G
>
> ----- Original Message -----
> From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
> To: <so...@xml.apache.org>
> Sent: Friday, May 25, 2001 11:13 PM
> Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
>
>
> > It appears that the setContentType was introduced between
> > revisions 1.5 and 1.6 of RPCRouterServlet.java:
> >
> >
>
http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apache/soap/se
> > rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
> >
> > The change was committed October 17th, 2000.
> >
> > That means this code was exactly the same in v2.1 too. I am not
> > inclined to changing it at this point .. without knowing why
> > it was added. Also, the fact that it was not reported for so
> > long means that it must work pretty much all the time.
> >
> > Conceptually, it seems to me that the change you're suggesting is
> > correct. However, given the age of that code ..
> >
> > Sanjiva.
> >
> > ----- Original Message -----
> > From: "Jim Hazen" <ji...@myplay.com>
> > To: <so...@xml.apache.org>
> > Sent: Friday, May 25, 2001 4:38 PM
> > Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
> >
> >
> > > There seems to be a problem in the RPCRouterServlet doGet() method.
> > >
> > > Instead of printing the 'GET not supported.  Talk to me using POST'
HTTP
> > > response.  My server (old version of Weblogic) starts throwing
> > > IllegalStateExceptions:
> > >
> > > java.lang.IllegalStateException: Attempt to change ContentType after
> > calling
> > > getPrintWriter()
> > >
> > > I've looked at the code and sure enough, this is the case.
> > >
> > > public void doGet (HttpServletRequest req, HttpServletResponse res)
> > >     throws ServletException, IOException {
> > >     PrintWriter out = res.getWriter ();
> > >
> > >     res.setContentType("text/html");
> > >
> > > ...
> > >
> > > If the setContentType and getWriter lines are swapped the problem goes
> > away.
> > >
> > > Could someone please make this simple fix before the final release.
> > >
> > > Thanks,
> > > Jim
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > > For additional commands, email: soap-user-help@xml.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Glen Daniels <gd...@macromedia.com>.
It looks to me like the setContentType and the slight html changes were
added just to make the doGet() code a little cleaner and more correct.  I
have a strong suspicion that adding the setContentType after the getWriter
was just an oversight.  Jim can certainly fix it in his version, but IMHO if
it causes a problem for anyone, we should fix it.

--G

----- Original Message -----
From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
To: <so...@xml.apache.org>
Sent: Friday, May 25, 2001 11:13 PM
Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3


> It appears that the setContentType was introduced between
> revisions 1.5 and 1.6 of RPCRouterServlet.java:
>
>
http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apache/soap/se
> rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
>
> The change was committed October 17th, 2000.
>
> That means this code was exactly the same in v2.1 too. I am not
> inclined to changing it at this point .. without knowing why
> it was added. Also, the fact that it was not reported for so
> long means that it must work pretty much all the time.
>
> Conceptually, it seems to me that the change you're suggesting is
> correct. However, given the age of that code ..
>
> Sanjiva.
>
> ----- Original Message -----
> From: "Jim Hazen" <ji...@myplay.com>
> To: <so...@xml.apache.org>
> Sent: Friday, May 25, 2001 4:38 PM
> Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
>
>
> > There seems to be a problem in the RPCRouterServlet doGet() method.
> >
> > Instead of printing the 'GET not supported.  Talk to me using POST' HTTP
> > response.  My server (old version of Weblogic) starts throwing
> > IllegalStateExceptions:
> >
> > java.lang.IllegalStateException: Attempt to change ContentType after
> calling
> > getPrintWriter()
> >
> > I've looked at the code and sure enough, this is the case.
> >
> > public void doGet (HttpServletRequest req, HttpServletResponse res)
> >     throws ServletException, IOException {
> >     PrintWriter out = res.getWriter ();
> >
> >     res.setContentType("text/html");
> >
> > ...
> >
> > If the setContentType and getWriter lines are swapped the problem goes
> away.
> >
> > Could someone please make this simple fix before the final release.
> >
> > Thanks,
> > Jim
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Glen Daniels <gd...@macromedia.com>.
It looks to me like the setContentType and the slight html changes were
added just to make the doGet() code a little cleaner and more correct.  I
have a strong suspicion that adding the setContentType after the getWriter
was just an oversight.  Jim can certainly fix it in his version, but IMHO if
it causes a problem for anyone, we should fix it.

--G

----- Original Message -----
From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
To: <so...@xml.apache.org>
Sent: Friday, May 25, 2001 11:13 PM
Subject: Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3


> It appears that the setContentType was introduced between
> revisions 1.5 and 1.6 of RPCRouterServlet.java:
>
>
http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apache/soap/se
> rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h
>
> The change was committed October 17th, 2000.
>
> That means this code was exactly the same in v2.1 too. I am not
> inclined to changing it at this point .. without knowing why
> it was added. Also, the fact that it was not reported for so
> long means that it must work pretty much all the time.
>
> Conceptually, it seems to me that the change you're suggesting is
> correct. However, given the age of that code ..
>
> Sanjiva.
>
> ----- Original Message -----
> From: "Jim Hazen" <ji...@myplay.com>
> To: <so...@xml.apache.org>
> Sent: Friday, May 25, 2001 4:38 PM
> Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3
>
>
> > There seems to be a problem in the RPCRouterServlet doGet() method.
> >
> > Instead of printing the 'GET not supported.  Talk to me using POST' HTTP
> > response.  My server (old version of Weblogic) starts throwing
> > IllegalStateExceptions:
> >
> > java.lang.IllegalStateException: Attempt to change ContentType after
> calling
> > getPrintWriter()
> >
> > I've looked at the code and sure enough, this is the case.
> >
> > public void doGet (HttpServletRequest req, HttpServletResponse res)
> >     throws ServletException, IOException {
> >     PrintWriter out = res.getWriter ();
> >
> >     res.setContentType("text/html");
> >
> > ...
> >
> > If the setContentType and getWriter lines are swapped the problem goes
> away.
> >
> > Could someone please make this simple fix before the final release.
> >
> > Thanks,
> > Jim
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
It appears that the setContentType was introduced between
revisions 1.5 and 1.6 of RPCRouterServlet.java:

http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apache/soap/se
rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h

The change was committed October 17th, 2000.

That means this code was exactly the same in v2.1 too. I am not
inclined to changing it at this point .. without knowing why
it was added. Also, the fact that it was not reported for so
long means that it must work pretty much all the time.

Conceptually, it seems to me that the change you're suggesting is
correct. However, given the age of that code ..

Sanjiva.

----- Original Message -----
From: "Jim Hazen" <ji...@myplay.com>
To: <so...@xml.apache.org>
Sent: Friday, May 25, 2001 4:38 PM
Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3


> There seems to be a problem in the RPCRouterServlet doGet() method.
>
> Instead of printing the 'GET not supported.  Talk to me using POST' HTTP
> response.  My server (old version of Weblogic) starts throwing
> IllegalStateExceptions:
>
> java.lang.IllegalStateException: Attempt to change ContentType after
calling
> getPrintWriter()
>
> I've looked at the code and sure enough, this is the case.
>
> public void doGet (HttpServletRequest req, HttpServletResponse res)
>     throws ServletException, IOException {
>     PrintWriter out = res.getWriter ();
>
>     res.setContentType("text/html");
>
> ...
>
> If the setContentType and getWriter lines are swapped the problem goes
away.
>
> Could someone please make this simple fix before the final release.
>
> Thanks,
> Jim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
It appears that the setContentType was introduced between
revisions 1.5 and 1.6 of RPCRouterServlet.java:

http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/src/org/apache/soap/se
rver/http/RPCRouterServlet.java.diff?r1=1.5&r2=1.6&diff_format=h

The change was committed October 17th, 2000.

That means this code was exactly the same in v2.1 too. I am not
inclined to changing it at this point .. without knowing why
it was added. Also, the fact that it was not reported for so
long means that it must work pretty much all the time.

Conceptually, it seems to me that the change you're suggesting is
correct. However, given the age of that code ..

Sanjiva.

----- Original Message -----
From: "Jim Hazen" <ji...@myplay.com>
To: <so...@xml.apache.org>
Sent: Friday, May 25, 2001 4:38 PM
Subject: Bug in RPCRouterServlet doGet() in SOAP 2.2 rc3


> There seems to be a problem in the RPCRouterServlet doGet() method.
>
> Instead of printing the 'GET not supported.  Talk to me using POST' HTTP
> response.  My server (old version of Weblogic) starts throwing
> IllegalStateExceptions:
>
> java.lang.IllegalStateException: Attempt to change ContentType after
calling
> getPrintWriter()
>
> I've looked at the code and sure enough, this is the case.
>
> public void doGet (HttpServletRequest req, HttpServletResponse res)
>     throws ServletException, IOException {
>     PrintWriter out = res.getWriter ();
>
>     res.setContentType("text/html");
>
> ...
>
> If the setContentType and getWriter lines are swapped the problem goes
away.
>
> Could someone please make this simple fix before the final release.
>
> Thanks,
> Jim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org