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 "Duggan, Bryan (Exchange)" <bw...@bear.com> on 2001/04/10 18:50:09 UTC

Proxy user ID and password

Hi there,

Can anyone tell me how to invoke a service throght a proxy which requires
authentication? I've tried:

Call call = new Call();
        call.setTargetObjectURI( urn );
        call.setMethodName( "BableFish" );
        call.setEncodingStyleURI( Constants.NS_URI_SOAP_ENC );
        Vector params = new Vector();
        params.addElement( new Parameter( "translationmode", String.class,
"en_fr", null ) );
        params.addElement( new Parameter( "sourcedata", String.class,
sTranslate, null ) );
        call.setParams( params );
        SOAPHTTPConnection connection = new SOAPHTTPConnection();
        connection.setProxyHost("proxy");
        connection.setProxyPort(8080);
        connection.setUserName("...");
        connection.setPassword("...");
        call.setSOAPTransport(connection);

        try {
            System.out.println( "invoke service\n" + "  URL= " + url + "\n
URN= " + urn );

            Response response = call.invoke( url, "" ); // invoke the
service
	...
	...

But it keeps returning Username and Password unknown by the proxy server. I
guess setUserName and setPassword, set the "WWW-Authenticate" header and not
the "Proxy-Authorization" header. Is there any way to set the headers
directly like with URLConnection:

returnConnection.setRequestProperty("Proxy-Authorization", ...

I've also tried: connection.getHeader().put(), but getHeader returns null.

Any help would be appreciated!

Thanks,

Bryan

************************************************
Bryan Duggan
Bear Stearns Dublin Software Development Centre
4th Floor, Europa House, Harcourt Street, Dublin 2 , Ireland
Bear Net: 8981 6610
Direct Line:  + 353 1 4026610
Fax number: + 353 1 4026699
************************************************



***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation, 
offer or agreement or any information about any transaction, customer 
account or account activity contained in this communication.
***********************************************************************


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


Re: Proxy user ID and password

Posted by Wouter Cloetens <wo...@mind.be>.
On Tue, Apr 10, 2001 at 12:50:09PM -0400, Duggan, Bryan (Exchange) wrote:
> Can anyone tell me how to invoke a service throght a proxy which requires
> authentication? I've tried:
> 
>         SOAPHTTPConnection connection = new SOAPHTTPConnection();
>         connection.setProxyHost("proxy");
>         connection.setProxyPort(8080);
>         connection.setUserName("...");
>         connection.setPassword("...");

Just checked in a patch for that this weeked. It's setProxyUserName() and
setProxyPassword(). You will need the latest code from CVS. The xmethods
GetTemp sample supports this.

bfn, Wouter

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


Re: Proxy user ID and password

Posted by Wouter Cloetens <wo...@mind.be>.
On Tue, Apr 10, 2001 at 12:50:09PM -0400, Duggan, Bryan (Exchange) wrote:
> Can anyone tell me how to invoke a service throght a proxy which requires
> authentication? I've tried:
> 
>         SOAPHTTPConnection connection = new SOAPHTTPConnection();
>         connection.setProxyHost("proxy");
>         connection.setProxyPort(8080);
>         connection.setUserName("...");
>         connection.setPassword("...");

Just checked in a patch for that this weeked. It's setProxyUserName() and
setProxyPassword(). You will need the latest code from CVS. The xmethods
GetTemp sample supports this.

bfn, Wouter

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