You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Zhou Ruiyi <zh...@sunjapan.com.cn> on 2001/05/18 07:46:51 UTC

proxy problem with soap

hi,
    i was testing proxy function but i encountered a few problems.

as my proxy uses user authentication,i made up my client side class as this:

        ...........
        ...........

        SOAPHTTPConnection st = new SOAPHTTPConnection();
        if (proxyHost != null) {
            st.setProxyHost(proxyHost);
            st.setProxyPort(proxyPort);
            st.setUserName(userNameOfProxy);
            st.setPassword(userPasswdOfProxy);
        }

        // build the call.
        Call call = new Call();
        call.setSOAPTransport(st);
        call.setTargetObjectURI("urn:xmethods-Temperature");
        call.setMethodName("getTemp");
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

         ...........
        ...........

when i run it , it throws exception as this:


Caught SOAPException (SOAP-ENV:Protocol): Unsupported response content type
"text/html", must be: "text/xml". Response was:
<HTML><HEAD>
<TITLE>ERROR: Cache Access Denied</TITLE>
</HEAD>
<BODY>
<H1>ERROR</H1>
<H2>Cache Access Denied</H2>
<HR>
<P>
While trying to retrieve the URL:
<A
HREF="http://localhost:7001/soap/servlet/rpcrouter">http://localhost:7001/so
ap/servlet/rpcrouter</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Cache Access Denied.
</STRONG>
</UL>
</P>

<P>Sorry, you are not currently allowed to request:
<PRE>    http://localhost:7001/soap/servlet/rpcrouter</PRE>
from this cache until you have authenticated yourself.
</P>

<P>
You need to use Netscape version 2.0 or greater, or Microsoft Internet
Explorer 3.0, or an HTTP/1.1 compliant browser for this to work.
Please contact the <A HREF="mailto:root">cache administrator</a> if you have
difficulties authenticating yourself or
<A HREF="http://hyper/cgi-bin/chpasswd.cgi\">change</a> your default
password.
</P>

<br clear="all">
<hr noshade size=1>
Generated Fri, 18 May 2001 05:29:51 GMT by hyper (Squid/2.3.STABLE4)
</BODY></HTML>

I think SOAP v2.1 haven't done authenticate work , how can i fix it?


Regards

Zhou


Re: proxy problem with soap

Posted by Scott Nichol <sn...@computer.org>.
Authentication directly to a Web server does work.  I vaguely recall some
activity on this list previously regarding authentication with a proxy.
There is some chance that the problem you are seeing with release 2.1 has
been fixed in the current code.

My recommendation would be to first try the nightly build distribution of
Apache SOAP.  If you still have the problem, then use TcpTunnelGui to
capture the request from the SOAP client to the proxy, then again to capture
a request from your browser to the proxy, to see what the browser is doing
differently.  You can then either change the code yourself (and submit the
changes, I hope), or post the information you captured to this list for
someone else to analyze.

Scott


----- Original Message -----
From: "Zhou Ruiyi" <zh...@sunjapan.com.cn>
To: <so...@xml.apache.org>
Sent: Friday, May 18, 2001 1:46 AM
Subject: proxy problem with soap


> hi,
>     i was testing proxy function but i encountered a few problems.
>
> as my proxy uses user authentication,i made up my client side class as
this:
>
>         ...........
>         ...........
>
>         SOAPHTTPConnection st = new SOAPHTTPConnection();
>         if (proxyHost != null) {
>             st.setProxyHost(proxyHost);
>             st.setProxyPort(proxyPort);
>             st.setUserName(userNameOfProxy);
>             st.setPassword(userPasswdOfProxy);
>         }
>
>         // build the call.
>         Call call = new Call();
>         call.setSOAPTransport(st);
>         call.setTargetObjectURI("urn:xmethods-Temperature");
>         call.setMethodName("getTemp");
>         call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
>          ...........
>         ...........
>
> when i run it , it throws exception as this:
>
>
> Caught SOAPException (SOAP-ENV:Protocol): Unsupported response content
type
> "text/html", must be: "text/xml". Response was:
> <HTML><HEAD>
> <TITLE>ERROR: Cache Access Denied</TITLE>
> </HEAD>
> <BODY>
> <H1>ERROR</H1>
> <H2>Cache Access Denied</H2>
> <HR>
> <P>
> While trying to retrieve the URL:
> <A
>
HREF="http://localhost:7001/soap/servlet/rpcrouter">http://localhost:7001/so
> ap/servlet/rpcrouter</A>
> <P>
> The following error was encountered:
> <UL>
> <LI>
> <STRONG>
> Cache Access Denied.
> </STRONG>
> </UL>
> </P>
>
> <P>Sorry, you are not currently allowed to request:
> <PRE>    http://localhost:7001/soap/servlet/rpcrouter</PRE>
> from this cache until you have authenticated yourself.
> </P>
>
> <P>
> You need to use Netscape version 2.0 or greater, or Microsoft Internet
> Explorer 3.0, or an HTTP/1.1 compliant browser for this to work.
> Please contact the <A HREF="mailto:root">cache administrator</a> if you
have
> difficulties authenticating yourself or
> <A HREF="http://hyper/cgi-bin/chpasswd.cgi\">change</a> your default
> password.
> </P>
>
> <br clear="all">
> <hr noshade size=1>
> Generated Fri, 18 May 2001 05:29:51 GMT by hyper (Squid/2.3.STABLE4)
> </BODY></HTML>
>
> I think SOAP v2.1 haven't done authenticate work , how can i fix it?
>
>
> Regards
>
> Zhou
>
>


Re: proxy problem with soap

Posted by Wouter Cloetens <wo...@mind.be>.
On Fri, May 18, 2001 at 01:46:51PM +0800, Zhou Ruiyi wrote:
> as my proxy uses user authentication,i made up my client side class as this:
> 
>         SOAPHTTPConnection st = new SOAPHTTPConnection();
>         if (proxyHost != null) {
>             st.setProxyHost(proxyHost);
>             st.setProxyPort(proxyPort);
>             st.setUserName(userNameOfProxy);
>             st.setPassword(userPasswdOfProxy);

That's incorrect. You want to use setProxyUserName() and setProxyPassword(). The
methods you're using set authentication information for the target website, not
the proxy.

Be sure to pick up a recent nightly build, as this was a post-2.1 enhancement.

bfn, Wouter