Announcement

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

    Error if WSDL Server is not available

    Hi Folks,

    I'm running a WSDL-based catalog/configuration/basket server; all and everything is nice meanwhile, however if the server is down or someone entered an invalid URL, I get an SC run-time error. Of course I want to catch this error... what is the correct way to either pre-check the availability of the service, or catch the error message? Thx!

    Ekki

    * GWT Rocks! * SmartGWT Rocks Even Harder! *

    SmartGWT 1.3, GWT 1.7.1, App Engine 1.2.6, Eclipse 3.5.1, JRE 1.6.0_16

    CI-CUBE.BIZ feat. CubeBrowser.AppSpot.com
    Attached Files

    #2
    Hi Ekki,
    I would also like to catch WSDL availability - no success yet.
    For now I just created timer:
    Code:
            SC.showPrompt("Reading WSDL...");
            XMLTools.loadWSDL(wsdlAddress+".wsdl", new WSDLLoadCallback() {
    
                public void execute(WebService webService) {
                    wsdl = webService;
                    SC.clearPrompt();
                }
            });
            // Create a new timer
            Timer t = new Timer() {
    
                public void run() {
                    if (wsdl == null) {
                        SC.clearPrompt();
                        SC.say("Some error message");
                    }
                }
            };
            // Schedule the timer to run after 5 seconds
            t.schedule(5000);
    MichalG
    ps
    Where do you get SC run-time error ? What I can see is in the Developer Console log only and callback is never executed.

    Comment


      #3
      Timers are ugly. For that you should use Callbacks! The only concern I have is that SC error msg - one for each WSDL Service Description that couldn't be retrieved... This is I need to avoid. No matter if the server is up or down, no native error msgs should appear

      Ekki

      * GWT Rocks! * SmartGWT Rocks Even Harder! *

      SmartGWT 1.3, GWT 1.7.1, App Engine 1.2.6, Eclipse 3.5.1, JRE 1.6.0_16

      CI-CUBE.BIZ feat. CubeBrowser.AppSpot.com

      Comment


        #4
        Yes I know that callback should be used, but in my case it is not executed when wsdl is no available and I have no other way to clear prompt and print the error message.
        I got the following in the Developer Console only:
        Code:
        14:56:15.798:XRP0:WARN:parseXML:Error parsing XML: XML Parsing Error: mismatched tag. Expected: </HR>.
        Location: http://localhost:8080/SmartGWTUmowy/ Line Number 1, Column 1016:
        <html>
        <head>
        <title>
        Apache Tomcat/6.0.18 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head>
        <body>
        <h1>
        HTTP Status 404 - /SmartGWTUmowy/Umowy.wsdl</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/SmartGWTUmowy/Umowy.wsdl</u></p><p><b>description</b> <u>The requested resource (/SmartGWTUmowy/Umowy.wsdl) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3>
        </body>
        </html> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^

        Comment


          #5
          It seems to me that XMLTools.loadWSDL() completely ignores RPCManager.setHandleErrorCallback() so it is not possible to catch error this way.
          As partial workaround could be fetching wsdl (just to check if it is available and readable):
          Code:
                  RPCManager.setHandleErrorCallback(new HandleErrorCallback() {
          
                      public void handleError(DSResponse response, DSRequest request) {
                              SC.say("Some error");
                      }
                  });
          
                  //  WSDL exist ?
                  DataSource testDS = new DataSource();
                  testDS.setDataFormat(DSDataFormat.XML);
                  testDS.setDataURL(wsdlAddress);
                  testDS.fetchData();
          
                  XMLTools.loadWSDL(wsdlAddress, new WSDLLoadCallback() {
          
                      public void execute(WebService webService) {
                          wsdl = webService;
                      }
                  });
          If there is a better way, please let me know.
          Thanks,
          MichalG

          Comment


            #6
            Make a visual state info, set it initially to Bad and change it to Good after availability of the service. Alternatively, disable the GUI functionality on some global level, and enable it accordingly. Sometimes the GUI even doesn't make sense w/o availability of the services.

            No timers for that pls as it's theoretically impossible to define the optimal time out value ;-)

            Ekki

            * GWT Rocks! * SmartGWT Rocks Even Harder! *

            SmartGWT 1.3, GWT 1.7.1, App Engine 1.2.6, Eclipse 3.5.1, JRE 1.6.0_16

            CI-CUBE.BIZ feat. CubeBrowser.AppSpot.com

            Comment

            Working...
            X