Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    404 error trying to load WSDL

    I'm using SmartGWT EE 1.2.2 with client and server running locally and trying to load a WSDL via XMLTools.loadWSDL(). I can load the same URL in a browser successfully. Is there an extra configuration setting I need? This is the full error from the developer console.
    Code:
    14:50:08.489:XRP8:WARN:RPCManager:Transport error - HTTP code: 404 for URL: http://192.168.9.24:8085/IPServices/ClassFinder?wsdl (via proxy: http://localhost:8080/demoapp/sc/HttpProxy), response: {operationId: "custom",
    clientContext: undef,
    context: Obj,
    transactionNum: 6,
    httpResponseCode: 404,
    httpResponseText: "<html>\n<head>\n<meta http-equiv="Content-..."[1406],
    xmlHttpRequest: [object XMLHttpRequest],
    transport: "xmlHttpRequest",
    status: -90,
    clientOnly: undef,
    httpHeaders: Obj,
    isStructured: true,
    callbackArgs: null,
    results: Obj,
    data: "Transport error - HTTP code: 404 for URL..."[150]}

    #2
    When you use the HttpProxy the server is initiating the HTTP request - it's likely that from the server's perspective that 192.168 address leads to a different host.

    Comment


      #3
      I'm running the server and client locally via the GWT eclipse plugin and the embedded server/browser.

      Comment


        #4
        I've also tried other publicly accessible web services and they all get the 404 error.

        Comment


          #5
          Anyone else run into this? I'm not sure what else to try. A browser running on the same machine can access the URL but the HttpProxy cannot.

          Comment


            #6
            Do you have any firewall installed? If so, try temporarily disabling it and see if that helps.

            Comment


              #7
              Firewall is turned off. Still no luck.

              Comment


                #8
                The Google Search WebService example at http://www.smartclient.com/smartgwtee/showcase/#data_integration_server_wsdl_fetch has the same problem. It gets a 404 error as well.

                Comment


                  #9
                  Quite strange. It could be possible that the proxy is returning 404 even though the underlying error condition is something else.

                  Probably worth trying to write a simple Java program that connects to the URL and reads the contents. It will help narrow down the problem. You can use the sample code found here to do this.

                  Comment


                    #10
                    A little test java app runs just fine and gets the WSDL back as expected. Here's the code in case it helps. I'm just running in from the same eclipse instance that I'm using for the SmartGWT development. I pass it the same URL that I'm passing to the loadWSDL function. In this case it is a free address verification service at http://www.webservicex.net/usaddressverification.asmx?WSDL

                    Code:
                    import java.net.*;
                    import java.io.*;
                    
                    public class SocketCat {
                    
                      public static void main(String[] args) {
                    
                        for (int i = 0; i < args.length; i++) {  
                          int port = 80;
                          String file = "/";
                          try {
                            URL u = new URL(args[i]);
                            if (u.getPort() != -1) port = u.getPort();
                            if (!(u.getProtocol().equalsIgnoreCase("http"))) {
                              System.err.println("I only understand http.");
                            }
                            if (!(u.getFile().equals(""))) file = u.getFile();
                            Socket s = new Socket(u.getHost(), port);
                            OutputStream theOutput = s.getOutputStream();
                            OutputStreamWriter out = new OutputStreamWriter(theOutput);
                            out.write("GET " + file + " HTTP/1.0\r\n");
                            out.write("Accept: text/plain, text/html, text/*\r\n");
                            out.write("\r\n");
                            out.flush();
                            theOutput.flush();
                            
                            InputStream in = s.getInputStream();
                            InputStreamReader isr = new InputStreamReader(in);
                            BufferedReader br = new BufferedReader(isr);
                            int c;
                            while ((c = br.read()) != -1) {
                              System.out.print((char) c);
                            }
                          }
                          catch (MalformedURLException ex) {
                            System.err.println(args[i] + " is not a valid URL");
                          }
                          catch (IOException ex) {
                            System.err.println(ex);
                          }
                          
                        }
                      
                      }
                    
                    }

                    Comment


                      #11
                      As a sanity check can you try running from a different machine / environment? The Smart GWT EE webservice samples work fine and others have been using it successfully too.

                      Comment


                        #12
                        I tried the showcase example at http://www.smartclient.com/smartgwtee/showcase/#data_integration_server_wsdl_fetch from a different machine using a different browser and it gets the 404 error. Not sure why a different environment would make a difference when the showcase proxy is running at www.smartclient.com.

                        Comment


                          #13
                          Is see now that the showcase is looking for a URL that is actually not there. http://api.google.com/GoogleSearch.wsdl doesn't exist per any browser I point at it. My URL does exist on the other hand, only the HttpProxy can't find it.
                          http://www.webservicex.net/usaddressverification.asmx?WSDL. It's slow, but it does respond. Is there a wait limit that could be too short?

                          Comment


                            #14
                            Yes, Google removed the SOAP version of their search service and we have not found a good replacement demo yet. What about the other sample:

                            http://www.smartclient.com/smartgwtee/showcase/#data_integration_server_wsdl_generic

                            Comment


                              #15
                              The generic WSDL sample at http://www.smartclient.com/smartgwtee/showcase/#data_integration_server_wsdl_generic never finishes loading the WSDL. It just keeps showing the "Please try again in a moment. Still loading web services descriptor" message. I tried using http://www.webservicex.net/uszip.asmx?WSDL locally and its the same as the other sites; browser finds it, java test code finds it and HttpProxy does not.

                              Comment

                              Working...
                              X