3 Replies Latest reply on Oct 28, 2009 12:16 PM by vimalm

    Consuming Web Services when WSDL access / UDDI discovery is

    vimalm

      One of the Vendors that we have, expose some .net web services end points but now prohibit access to WSDL via the ?WSDL mechanism as part of a their new security policy. Suddenly the code that used to work to consume their web services no longer works with this new security policy implementation. I have generated the web services stubs using wsconsume and using those stubs to make the calls. One of the thing that Service class does (From JBOSSWS which gets invoked by the generated Stubs) is to open an InputStream to WSDL URL which is now blocked and I get a FileNotFoundException and my process terminates and not able to invoke the business method on the endPoint.

      Is there a way around this problem or access to the WSDL URL is absolutely required where the web services are hosted?

      We have been using Jboss 4.2.1GA and the jbossws implementation that came with it. I am hoping that suggestion does not involve upgrading the JBOSS server to 5.X as we are not prepared to do that right now!

        • 1. Re: Consuming Web Services when WSDL access / UDDI discovery
          asoldano

          You can store the wsdl locally and point that copy instead of the remote one.

          • 2. Re: Consuming Web Services when WSDL access / UDDI discovery
            vimalm

            Hello Alessio

            Thanks for your response. My current code looks like

            URL wsdlURL = new URL ( "http://www.example.com/example.asmx?WSDL");
            QName serviceQName = new QName("http://www.example.com/example/", "Calculate");
            Calculate calc = new Calculate(wsdlURL, serviceQName);
            CalculateSoap calcSoap = calc.getCalculateSoap();
            calcSoap.execute();
            


            It fails on Line 3 with a FileNotFoundException. If I use a WSDL stored locally will I have to modify the WSDL to point to the correct soap address in the following WSDL fragment at the very tail end of the WSDl to let it know where the service is hosted?

            <wsdl:port CalculateSoap binding="tns:CalculateSoap">
             <soap:address location="http://www.example.com/example.asmx" />
             </wsdl:port>
            


            Thanks for your help!



            • 3. Re: Consuming Web Services when WSDL access / UDDI discovery
              vimalm

              Never mind I figured out that the above way will work. The only problem is that I need to attach multiple WSDL's for different environments (dev, uat and prod) inside my ear and then use the logic to dynamically figure out which WSDL URL to load depending on environment.