Bug 38192 - Multiple uses of <io:soap> fails
Summary: Multiple uses of <io:soap> fails
Alias: None
Product: Taglibs
Classification: Unclassified
Component: IO Taglib (show other bugs)
Version: nightly
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2006-01-09 11:33 UTC by Kell S
Modified: 2009-11-29 19:39 UTC (History)
0 users

diff for org.apache.taglibs.io.HttpSoapTag.java (74 bytes, patch)
2006-01-09 11:35 UTC, Kell S
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kell S 2006-01-09 11:33:39 UTC
When using the <io:soap> tag in a JSP file more than once an error occurs the
second time:
java.net.ProtocolException: cannot write to a URLConnection if doOutput=false -
call setDoOutput(true)

The implementation in org.apache.taglibs.io.HttpSoapTag has a constructor which
calls setAction("SOAP"). But the instantiation is done only once per JSP page.
As the URL connection in URLTag, which HttpSoapTag extends, is released after
the first use of <io:soap> the action is reset to the default GET action thus
resulting in the abovementioned error at the second call.

Proposed fix:
Move the setAction() call from instantiation to configureConnection():
diff HttpSoapTag.java.orig HttpSoapTag
<         setAction( "POST" );
>         setAction( "POST" );

This seems to work.
Comment 1 Kell S 2006-01-09 11:35:20 UTC
Created attachment 17368 [details]
diff for org.apache.taglibs.io.HttpSoapTag.java
Comment 2 Henri Yandell 2009-11-29 19:39:24 UTC
Resolving. Taglib has been retired.