3 Replies Latest reply on Jul 14, 2006 6:16 PM by Sam Ansari

    Any known issue with being behind an HTTP proxy?

    Chris Laprun Master

      Could the following error be caused by being behind an HTTP proxy?

      org.jboss.ws.metadata.wsdl.WSDLException: WSDLException (at /wsdl:definitions/import/wsdl:definitions/import/wsdl:definitions/wsdl:types/schema/schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'http://www.w3.org/2001/xml.xsd', relative to 'file:/C:/Program Files/jboss-4.0.4.GA/server/default/tmp/deploy/portal-wsrp-exp.war/WEB-INF/wsdl/wsrp_v1_types.xsd'.: Cannot access imported wsdl [http://www.w3.org/2001/xml.xsd], Connection refused: connect: java.lang.RuntimeException: Cannot access imported wsdl [http://www.w3.org/2001/xml.xsd], Connection refused: connect
       at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory$WSDLLocatorImpl.getImportInputSource(WSDLDefinitionsFactory.java:310)


      Isn't the XML schema locally cached, resolved by an Entity resolver, anyway? If it isn't, is there a way to achieve this, if it's even necessary?

        • 1. Re: Any known issue with being behind an HTTP proxy?
          rls124 Newbie

          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?
            alberto sarubbi Newbie

            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?
              Sam Ansari Newbie

              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