Announcement

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

    Axis 1.4 / SmartClientOperations.wsdl

    Trying to develop an Axis 1 based web-service to back the live data grid. Reading the WSDL Binding section of the SmartClient reference guide it is suggested to use SmartClientOperations.wsdl contained as a sample in the SDK as a starting point.
    SmartClientOperations.wsdl uses "xsd:any" for the "data" request / response payload.
    This is translated by the Axis 1.4 wsdl2java ant-task to a server implementation requiring an array of org.apache.axis.message.MessageElement.
    Has anyone taken this route to power a paging ListGrid like the LiveGrid in the SmartGWT showcase? Is the SmartGWT WSDataSource fully equipped to do this? How would you go about populating the MessageElement?
    Any help would be greatly appreciated.

    #2
    WSDataSource is quite robust - you can see it doing all four CRUD operations here.

    It's true that Axis doesn't give you particularly useful objects for xsd:any. Because of this, RestDataSource integration is generally easier than WSDL if you are starting from scratch and Axis would be your WSDL approach.

    However if you are willing to craft your own services and generate WSDL that actually corresponds to the Java Beans you have on the server, you have the opportunity to have SmartClient pick up schema information from your generated WSDL so that you don't have to write DataSources for your beans.

    Comment


      #3
      attempt to use DataSource of type iscServer without SmartClient Server option

      Thank you very much for pointing out the WSDataSource example. Implemented the SmartClientOperations.wsdl, populating the xsd:any 'data' with an XML element in the format excepted by WSDataSource (<data><record><field1>...</field1>...</record></data>. Taking this for a first spin, I am getting a discouraging type of error:
      Code:
      attempt to use DataSource of type iscServer without SmartClient Server option.
      Was I wrong in reading the advertisement that is possible to create custom SOAP based back-ends using +- out of the box SmartClient LGPL DataSource functionality? I sure hope not.

      Comment


        #4
        HTTP Status 404 - /smartgwt-application/js/sc/IDACall

        This file appears to be required for a WSDataSource or custom WSDL based DataSource to function and does not appear to be in the LGPL distribution.
        Tried:
        1. custom WSDL based on SmartClientOperations.wsdl + custom DataSource, result:
        attempt to use DataSource of type iscServer without SmartClient Server option
        2. SmartClientOperations.wsdl implemented as is + WSDataSource: HTTP Status 404: IDACall

        Any suggestions anyone? Is RESTDataSource the only option using the SmartClient LGPL version?

        Comment


          #5
          WSDL binding does not require the SmartClient Server and people use it as the integration approach with SmartClient LGPL all the time (eg, binding to .NET webmethods).

          Given the errors you're getting, it sounds like with #1 you haven't set serviceNamespace on your custom DataSource and with #2 you haven't used loadWSDL to load the service definition before attempting to use the WSDataSource.

          Comment


            #6
            IDACall

            Thank you very much for your help. Your recommendations got me a little further, I think. Was already setting serviceNamespace on the custom DataSource but probably in the wrong spot (in the WSDLLoadCallback execute() method). Changing this, the
            Code:
            attempt to use DataSource of type iscServer
            went away. Now both methods appear to fail with HTTP Status: 404: IDACall in response to request:
            Code:
            http://localhost:8080/tpot-smartgwt-2008-01/js/sc/IDACall?dataSource=project-summary&operationType=fetch&data=%7B%7D&startRow=0&endRow=75
            .
            Should DataSource operations be routed through this Servlet? I should probably mention that I am using SmartGWT, not smartclient javascript directly.

            Comment


              #7
              Whether using the SmartClientOperations.wsdl or some other WSDL, SmartClient gets the URL to contact from the soap:address element in the WSDL file. In SmartClientOperations.wsdl it looks like this:

              Code:
                  <service name="SmartClientOperations">
                      <port name="SmartClientOperations" binding="tns:SmartClientOperationsBinding">
                          <soap:address location="/isomorphic/services/1.0/SmartClientOperations"/>
                      </port>
                  </service>
              This might be missing or absent from the WSDL file you're using?

              Comment


                #8
                For the custom WSDL I have
                Code:
                <soap:address location="/services/TPOTSOAP"/>
                , and for SmartClientOperations.wsdl I have
                Code:
                <soap:address location="/services/SmartClientOperations"/>
                . I can confirm both web-services to be accessible from these respective relative urls. Just to see what would happen, deployed isomorphic_core_rpc.jar as part of the application, adding the IDACall service to web.xml. Now HttpProxy reported missing (Status 404).

                Comment


                  #9
                  Looking back at this URL you reported:

                  Code:
                  http://localhost:8080/tpot-smartgwt-2008-01/js/sc/IDACall?dataSource=project-summary&operationType=fetch&data=%7B%7D&startRow=0&endRow=75
                  That would only come from a DataSource that didn't have a valid serviceNamespace set. It seems like you're still not setting serviceNamespace, or setting it too soon. Can you show your complete code for loading the WSDL and creating the DataSources? Also, can you check your Developer Console for any messages related to this?

                  Comment


                    #10
                    For the custom ws datasource I have:
                    Code:
                    	    public static ProjectSummaryDataSource getInstance() 
                    	    {
                    	        if (instance == null) 
                    	        {
                    	            instance = new ProjectSummaryDataSource("project-summary");
                    				instance.setServiceNamespace("urn:soap.server.tpot.dot.ca.gov");
                    				OperationBinding fetchBinding = new OperationBinding();
                    				fetchBinding.setOperationType(DSOperationType.FETCH);
                    				fetchBinding.setWsOperation("fetch");
                    				fetchBinding.setRecordXPath("//data/*");
                    				fetchBinding.setRecordName("record");
                    				
                    				instance.setOperationBindings(fetchBinding);
                    				
                    				DataSourceField ppnoField = 
                    					new DataSourceField("ppno", FieldType.TEXT);
                    				DataSourceField eaField = 
                    					new DataSourceField("ea", FieldType.TEXT);
                    				
                    				instance.setFields(ppnoField, eaField);
                    				instance.setDataFormat(DSDataFormat.XML);
                    	        }
                    	        return instance;
                    	    }
                    
                    	    public ProjectSummaryDataSource(String id)
                    	    {
                    	        setID(id);
                    
                    	        XMLTools.loadWSDL("http://localhost:8080/tpot-smartgwt-2008-01/TPOTSOAP.wsdl", 
                    	        	new WSDLLoadCallback()
                    	        	{
                    					public void execute(WebService webService)
                    					{	
                    					}
                    				}
                    	        );
                    	    }
                    Originally, had the call to setServiceNamespace in the execute callback function, which resulted in the original error message I reported.

                    Comment


                      #11
                      What did you find in the Developer Console?

                      What is ProjectSummaryDataSource a subclass of? Just DataSource or another class?

                      Comment


                        #12
                        ProjectSummaryDataSource is a direct subclass of DataSource. My alternate DataSource which homes in on a vanilla SmartClientOperations wsdl is derived from WSDataSource.
                        I am new to SmartGWT, coming from GWT-EXT, have not as of yet been able to make good use of Developer Console. Given the quality of the SmartClient documentation, was hoping for smooth sailing, powering live grids with web-services. Need to take a step back, get to know Developer Console before I can report back on this. What is the typical use case for Developer Console? Can it be used when deployment is on a separate Tomcat installation, or, should I get the web-services running in the embedded Tomcat in the SmartClientSDK?

                        Comment


                          #13
                          See this tip on how to setup the developer console

                          http://forums.smartclient.com/showthread.php?t=3033

                          Comment


                            #14
                            Thanks Mike.

                            And just a general note: you should always have the Developer Console open when working with SmartGWT/SmartClient. It's the sole way in which SmartGWT can report errors to you, so if you have something like a typo that SmartGWT can catch (certainly typos are part of any otherwise "smooth sailing" experience) you'll find out about it in the Developer Console.

                            Comment


                              #15
                              Thank you for your help. Added the CTRL-D key event handler + developer console. Why did I not do this before....Getting meaningful feedback:
                              Code:
                              11:39:48.842:WARN:DataSource:project-summary:No WebService definition has been loaded for serviceNamespace: urn:soap.server.tpot.dot.ca.gov [Stack trace not supported in this browser]
                              Using the developer console to load the WSDL I do get confirmation of my earlier report that this 'HttpProxy' provided by isomorphic_core_rpc.jar is required:
                              Code:
                              [WARN] Resource not found: sc/HttpProxy; (could a file be missing from the public path or a <servlet> tag misconfigured in module gov.ca.dot.tpot.Application.gwt.xml ?)
                              So, looks like the loading of a WSDL (from developer console, or smartgwt) requires this servlet provided by isomorphic server side.

                              Comment

                              Working...
                              X