Announcement

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

    Infinite loop when calling WSDL from client

    (I am evaluating SmartClient and intend to purchase the Pro version if the evaluation is successful. The main reason for my interest in this is the rich widgets and the client-side WSDL/SOAP support)

    This happens on both Smartclient_80 and the 2011-05-15 nightly. The results posted here are from the nightly.

    Browser: Chrome 11.0.696.68 (Ubuntu 11.04)

    See the attachment (InfiniteLoop.gif) for the stack trace of the loop.

    I switched the default tracing on the Console to "debug" and it showed no output before the loop.

    Below is the entire code of the web page. I am simply loading this page into the browser and running it, there is no server. I cleared the browser cache.

    The ECGridOS.js file was generated using the Console/WSDL generation feature from the following WSDL:

    https://ecgridos.net/v2.2/prod/ECGridOS.asmx?WSDL

    Alternative #1:

    I tried to cut back the WSDL to only have the portions related to the Login message (and I put it in a local file) - you can see the commented out code where I reference it (and I comment out the ECGridOS.js import), and that avoids the infinite loop, but it fails because according to the DEBUG trace, it's trying to do an HTTP POST to the URL associated with the file, rather than the URL of the web service (which seems wrong, but I'm not sure). You can easily try that out with this code.

    Alternative #2:

    When I use the XMLTools.loadWSDL on the actual WSDL on the site (note I have to move the XMLTools.loadWSDL into the doLogin() to be able to capture the console debug output after I hit the Login button). I get the failure indicated in the LoadWSDL.txt.

    It seems there is something in the WSDL that is not liked.

    When running the code, the username and password don't matter because it never even sends the message to the server.

    Code:
     <HTML><HEAD>
     <SCRIPT>var isomorphicDir="../isomorphic/";</SCRIPT>
     <SCRIPT SRC=../isomorphic/system/modules/ISC_Core.js></SCRIPT>
     <SCRIPT SRC=../isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
     <SCRIPT SRC=../isomorphic/system/modules/ISC_Containers.js></SCRIPT>
     <SCRIPT SRC=../isomorphic/system/modules/ISC_Grids.js></SCRIPT>
     <SCRIPT SRC=../isomorphic/system/modules/ISC_Forms.js></SCRIPT>
     <SCRIPT SRC=../isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
     <SCRIPT SRC=../isomorphic/skins/SmartClient/load_skin.js></SCRIPT>
     <SCRIPT SRC=../js/ECGridOS.js></SCRIPT>
     </HEAD>
     <BODY>
     
     
     <SCRIPT>
    
     console.log("starting");
    //isc.XMLTools.loadWSDL("file:///mnt/sda1/home/francis/d/main/transform/com.oaklandsw.transform.console/WebContent/ecgridos.wsdl");
    //isc.XMLTools.loadWSDL("https://ecgridos.net/v2.2/prod/ECGridOS.asmx?WSDL");
      
     var userName;
     var password;
     var sessionId;
     
     var loginForm = isc.DynamicForm.create({
        ID: "exampleForm",
        width: 250,
        fields: [
     	        {name: "username",
     	         title: "Username",
     	         type: "text",
     	         required: true,
     	        },
     	        {name: "password",
     	         title: "Password",
     	         required: true,
     	         type: "password",
     	        }
     	    ]
      });
    
      isc.Button.create({
        left: 300,
        title: "Login",
        click: function () {
    		doLogin();
        }
      });
     
      function loginCallback(data,xmlDoc,rpcResponse,wsRequest) {
    	  console.log("got back"); 
          if (rpcResponse.status < 0) {
              console.log("did not work out: " + rpcResponse.status);
          }
          //	  sessionId = data[0];
      }  
      
      function doLogin() {
    	  userName = loginForm.getValue("username");
    	  password = loginForm.getValue("password");
    	  var ws = isc.WebService.get("http://ecgridos.net/");
    	  console.log("ws: " + ws);
    	  console.log("userName: " + userName + ", password: " + password);
    	  ws.callOperation(
    	        	"Login",                         // operation name
    	    	    { LoginName: userName, Password: password },    // inbound data for operation
    		        "//LoginResult",                               // XPath, Type, or ElementName to extract result
    	    	    loginCallback     // script to execute when operation returns
    		    );	  
    	  console.log("Session: " + sessionId);
      }
      
      </SCRIPT>
      
      </BODY>
     </HTML>
    Attached Files

    #2
    We traced this to an issue with declarations like these where a simpleType element has the same name as it's type:

    <s:element name="string" nillable="true" type="s:string"/>
    The problem has been corrected, so grab the next nightly build (smartclient.com/builds) to try out the fix.

    As far as whether the right URL is being contacted, see WebService.setLocation().

    Comment


      #3
      Thanks for the amazingly fast response, I look forward to trying the nightly. When does it build?

      There are a couple of other problems I found with the WSDL in playing around with it in other tools, but they must not give you any trouble:

      1) The

      <s:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

      Statement did not include the schemaLocation

      2) There were odd: element refs in some of the types that make no sense:

      <s:element ref="s:schema" />

      These both choked the CXF WSDLToJava generator.

      Francis

      Comment


        #4
        We agree these are both invalid, but we wouldn't choke on either definition.

        Comment

        Working...
        X