Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes Trying to Develop Web Services Client. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Trying to Develop Web Services Client." Watch "Trying to Develop Web Services Client." New topic
Author

Trying to Develop Web Services Client.

Kel Walker
Greenhorn

Joined: Apr 04, 2002
Posts: 19
Please help. I'm stressed and depressed.
I am trying to write a web service client using jax-rpc.
I downloaded Java Web Services Development Pack from Sun and Java Web Services Tutorial.
I am now trying to develop my first ever Web Service client.
The web service I wish to use is hosted by ServiceObjects. See http://www.serviceobjects.com/products/dots_email.asp .
I have run the WSDL document at http://ws.serviceobjects.net/ev/EmailValidate.asmx?WSDL through the xrpcc.bat tool.
I received 2 warnings :
warning: ignoring port "EmailValidateHttpGet": no SOAP address specified.
warning: ignoring port "EmailValidateHttpPost": no SOAP address specified.
I ignored these because I do not know what they mean. Ha ha.
I then wrote the client as so:
package com.walker.util.webservice;
import java.rmi.Remote;
import java.rmi.RemoteException;
import com.walker.util.webservice.emailvalidation.artifact.*; // Xrpcc generated artifacts.
public class EmailValidationClient {

public static void main(String[] args) {
java.lang.String email = "walkerk@farnell.com";
java.lang.String licenseKey = "0"; // Use a license key of 0 for testing.
try {
EmailValidateSoap stub = (new EmailValidate_Impl().getEmailValidateSoap() );
Email mail = stub.validateEmail(email, licenseKey);
System.out.println(mail.getDNSCheck() );
} catch (java.lang.Throwable trouble) {
System.out.println(trouble);
trouble.printStackTrace(System.out);
}
}
}
When I ran it I got :
java.rmi.RemoteException: HTTP transport error: java.net.ConnectException: Connection timed out: connect; nested exception is:
HTTP transport error: java.net.ConnectException: Connection timed out: connect
java.rmi.RemoteException: HTTP transport error: java.net.ConnectException: Connection timed out: connect; nested exception is:
HTTP transport error: java.net.ConnectException: Connection timed out: connect
at com.walker.util.webservice.emailvalidation.artifact.EmailValidateSoap_Stub.validateEmail(EmailValidateSoap_Stub.java:76)
at com.walker.util.webservice.EmailValidationClient.main(EmailValidationClient.java:46)
Caused by: HTTP transport error: java.net.ConnectException: Connection timed out: connect
at com.sun.xml.rpc.client.http.HttpClientTransport.invoke(HttpClientTransport.java:189)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:73)
at com.walker.util.webservice.emailvalidation.artifact.EmailValidateSoap_Stub.validateEmail(EmailValidateSoap_Stub.java:60)
... 1 more
I am behind a firewall and use a proxy to connect to the internet. Not sure if that is the problem.
Please help, this is taking years off my life.
I appreciate any suggestions.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Maybe the service is overloaded and thats why your request timed out? Do you have independent confirmation that the service is still there and not overloaded?
Bill
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
I would suspect that yes, the fact you have an HTTP proxy is the reason it's not working. Instead of using a service on the internet, why don't you do one of the examples provided with the Apache Axis toolkit first? Then you can start a web service on your own machine inside Tomcat and not have to worry about the proxies.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Kel Walker
Greenhorn

Joined: Apr 04, 2002
Posts: 19
Hey,
William and Kyle. Thank you for your advise.
It was the HTTP proxy which was giving me the headache.
For those who are interested, I have found a workaround. It is possible to set the proxy programmatically. Not sure this is the best way to go about things but it does work.
System.getProperties().put("proxySet","true");
System.getProperties().put("proxyHost","myProxy");
System.getProperties().put("proxyPort","myPort");
I also noticed that the xrpcc tool has the option -Xhttpproxy:host ort (specifies an HTTP proxy server). I have tried this but not sure exactly what it does (doesn't seem to do anything). Does anyone know what this option does.
p.s. William, just bought your exam cram book. Excellent. Good work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to Develop Web Services Client.
 
Similar Threads
exception: java.net.ConnectException: Connection timed out: connect
Unable to access AMAZON Web Service
Problem when create client for web services because of XSD import url
SOAPException: Error opening socket
Licensekey error (again)