chris,

i am getting a similar error when i try to connect to a remote service from a 
machine that is located behind a proxy server.

my source code:

public class HolidaysClient {
        
        public static void main(String[] args) throws NamingException, 
ServiceException, RemoteException, MalformedURLException {
                URL url =  new 
URL("http://www.holidaywebservice.com/Holidays/HolidayService.asmx?WSDL";);

        QName qname = new QName("http://www.27seconds.com/Holidays/";, 
"HolidayService");

        ServiceFactory factory = ServiceFactory.newInstance();
        HolidayService service = (HolidayService) factory.createService(url, 
qname);

        HolidayServiceSoap hs   = (HolidayServiceSoap) 
service.getHolidayServiceSoap();
        GetHolidaysAvailable request = new GetHolidaysAvailable();
        request.setCountryCode("US");
        GetHolidaysAvailableResponse response = 
hs.getHolidaysAvailable(request);
        
        GetHolidaysAvailableResponseGetHolidaysAvailableResult result = 
response.getGetHolidaysAvailableResult();
        
                System.out.println(result);
        }
}

My error:

Exception in thread "main" org.jboss.ws.metadata.wsdl.WSDLException: 
java.net.UnknownHostException: www.holidaywebservice.com
        at 
org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.getDocument(WSDLDefinitionsFactory.java:198)
        at 
org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:106)
        at 
org.jboss.ws.metadata.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:273)
        at 
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:110)
        at 
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
        at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)
        at 
org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
        at 
org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
        at client.HolidaysClient.main(HolidaysClient.java:27)
Caused by: java.net.UnknownHostException: www.holidaywebservice.com
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
        at java.net.Socket.connect(Socket.java:516)
        at java.net.Socket.connect(Socket.java:466)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
        at sun.net.www.http.HttpClient.(HttpClient.java:214)
        at sun.net.www.http.HttpClient.New(HttpClient.java:287)
        at sun.net.www.http.HttpClient.New(HttpClient.java:299)
        at 
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:795)
        at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:747)
        at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:672)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:916)
        at java.net.URL.openStream(URL.java:1007)
        at 
org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.getDocument(WSDLDefinitionsFactory.java:181)
        ... 8 more

when i replace the code above with this test code i can connect to the remote 
host and retrieve its content:

InetAddress iAddress = InetAddress.getByName(MY_PROXY_SERVER);
InetSocketAddress address = new InetSocketAddress(iAddress, 80);
Proxy proxy = new Proxy(Type.HTTP, address);
URLConnection connection = url.openConnection(proxy);

i believe there needs to be some way to configure JBossWS to utilize a proxy 
server...but i could be mistaken. can anyone at Jboss enlighten me?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957455#3957455

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957455
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to