Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to use Axis to access a web service through Authentication proxy

843833Apr 21 2005 — edited May 29 2007
Using axis access internat web service is success,but access a web service through Authentication proxy is failure.But other java classes connect through a proxy to the internet which works very well:

please help me ,thank you!!!


import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import javax.xml.namespace.QName;
//this is my access webservice faliure   codes
public class TestClient
{
   public static void main(String [] args) {
       try {
       	System.getProperties().setProperty("http.proxySet", "true");
       	System.getProperties().setProperty("http.proxyHost","proxy.com");
       	System.getProperties().setProperty("http.proxyPort", "8080");
       	System.getProperties().setProperty("http.proxyUser", "username");
       	System.getProperties().setProperty("http.proxyPassword","password");
           String endpoint = 
                    "http://nagoya.apache.org:5049/axis/services/echo";
     
           Service  service = new Service();
           Call     call    = (Call) service.createCall();

           call.setTargetEndpointAddress( new java.net.URL(endpoint) );
           call.setOperationName(new QName("http://soapinterop.org/", "echoString") );

           String ret = (String) call.invoke( new Object[] { "Hello!" } );

           System.out.println("Sent 'Hello!', got '" + ret + "'");
       } catch (Exception e) {
           System.err.println(e.toString());
       }
   }
I get an "(407)Proxy authorization required" error?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2007
Added on Apr 21 2005
3 comments
193 views