-
1. Re: Any known issue with being behind an HTTP proxy?
rls124 Jul 12, 2006 2:35 PM (in response to claprun)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? -
2. Re: Any known issue with being behind an HTTP proxy?
asarubbi Jul 13, 2006 10:45 AM (in response to claprun)Got another problem with proxied network and jboss trying to access external urls...
My SQUID reports:1152805871.888 4 jboss_ip_address TCP_DENIED/400 1730 POST http://proxy_ip_address:proxy_porthttp://external_url - NONE/- text/html
It prefixes the proxy address on the url..
Obviously, this results in 400 Bad Request
Dumping proxy, connects directly
Any tip?
Thanks. -
3. Re: Any known issue with being behind an HTTP proxy?
sansari13 Jul 14, 2006 6:16 PM (in response to claprun)JBoss should be configured for HTTP proxy server, that you will be
using to access dtd/schema, etc behind the firewall.
Open run.sh and add the following lines before the java run command.
rem Setup JBoss HTTP proxy server configuration
set JAVA_OPTS=%JAVA_OPTS% -Dhttp.proxyHost=<proxy server>
-Dhttp.proxyPort=<proxy port> -DproxySet=true
-saM