Announcement

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

    Upgrade from 2.5 to 6.0 DataSourceField custom type multiple="true" and valueXPath

    Hi Isomorphic,

    I'm trying to upgrade my SmartGWT app from version 2.5 to the newest 6.0 and having some problems with existing datasource fields declared as type="OtherDataSource" multiple="true" and valueXPath is set.

    It seems that JXpath is only extracting known types of fields and custom types with multiple set are ignored. Maybe is something wrong with JXPath iterating over collection?
    If I remove multiple and set valueXPath to the first item in collection then it works.
    I'm sending datasources(with and without multiple set) and responses(Dev console RPC tab) in attachment.
    Classes for this datasources are generated with axis2 WSDL2Java version 1.7.4
    This works in version 2.5 and is in production for couple of years now.

    SmartGWT version: SmartClient/SmartGWT Framework (v11.0p_2017-01-11/Pro Deployment 2017-01-11)
    Browsers: Firefox, Chrome

    Thanks,
    Dejan






    Attached Files

    #2
    Hi again.
    I can confirm that everything works fine in SmartGWT 5.0 (v10.0p_2017-01-13/Pro Deployment (built 2017-01-13)).

    Comment


      #3
      Sending requests and responses from both 5.0 and 5.1 version of SmartGWT so you can see differences(there are many). Requests are the same except 5.1 version added one line to the end of request:
      Code:
      dataProtocol:"getParams"
      DataSources are the ones in OriginalDataSources.xml from the first post.


      You've also changed serialization of datetime field type:
      Code:
      <field name="timeFrom" type="datetime" valueXPath="timeFrom/time">
      in 5.0 returns:
      2016-12-31T23:00:00.000,
      and in 5.1
      1483225200000
      but that is not a problem, just need to remove valueXPath expression.



      Also encoding has changed in response
      5.0 version:
      name:"uravnoteženje"
      5.1 version:
      name:"uravnote�enje"
      Thanks,
      Dejan

      Attached Files

      Comment


        #4
        Hi dsijakovic,

        regarding your last encoding problem, please see this thread regarding an encoding problem I had when switching from 5.0 to 5.1. Most likely this is related.

        Best regards
        Blama

        Comment


          #5
          Originally posted by dsijakovic View Post
          Sending requests and responses from both 5.0 and 5.1 version of SmartGWT so you can see differences(there are many).
          Can you provide sample data for the datasources (as a .data.xml file)? If the fetch is something other than completely default, please also provide SGWT sample code.

          Comment


            #6
            Hi Blama thank you for response i'll look into it.

            I'm providing sample data (Contract.data.xml) and all datasources needed for sample data (AllDataSources.xml).

            Best regards
            Dejan
            Attached Files

            Comment


              #7
              Hi,do you have any info for this issue?

              Thanks,
              Dejan

              Comment


                #8
                Thanks for providing a test case, this is queued to be looked at. It may be a while, since issues from customers with Support contracts come first.

                Comment


                  #9
                  Originally posted by dsijakovic View Post
                  Hi Blama thank you for response i'll look into it.

                  I'm providing sample data (Contract.data.xml) and all datasources needed for sample data (AllDataSources.xml).

                  Best regards
                  Dejan
                  Did you pursue Blama's suggestion above - a potential solution?

                  You've provided a DataSource definition with a bunch of inner nested DataSources (some of them missing, apparently). Can you simplify the repro case any further?

                  There seems to be an inconsistency between the case of the fields in your XML DataSource specification and the data file - in the data file, all the fields start with uppercase. For some DataBases, this may not be an issue, but you haven't specified what you're using. Even after the case problem is corrected, we hit other errors trying to import your sample data. Can you provide your server.properties file or let us know precisely what you're using?

                  Comment


                    #10
                    Hi Isomorphic, didn' had time to pursue Blama's suggestion yet.
                    I'm using Apache Axis2 (1.7.4) generated classes from WSDL (ADBBeans) for DataSources. I' ve created test project and tried to simplify the problem. Because of the axis2 generated classes i think i need to send you
                    • WSDL file,
                    • ant script that generates classes from WSDL
                    • Xml data
                    • server fetch method that deserializes xml data into objects and returns DSResponse.
                    • All datasources included in project
                    I've already prepared all but some of files contains sensitive data, can i send files to some mail address?

                    Thanks,

                    Dejan

                    Comment


                      #11
                      We're not going to try to set up your Axis backend, the far simpler way to try out a WSDL issue is to just use hardcoded XML files as server responses. You can use WebService.setLocation() to point each operation in the WebService to a different URL that is just an XML file. So all we need is:

                      1. WSDL file

                      2. hardcoded XML response(s)

                      3. SGWT code to load your WSDL, configure the WebService to use the hardcoded responses, and trigger whatever operation is misbehaving. Please make this ready-to-run and minimal.

                      We'll also need an explanation of how the responses differ from your expectations / previous versions. If the test case you provide demonstrates the same problem as described in your post #3 above, just let us know that.


                      Comment


                        #12
                        Also, if the information is confidential, you can email it to support@isomorphic.com.

                        Comment


                          #13
                          Hi Isomorphic.
                          Tried all of that, then realized that we didn't understood each other well. At least I think so.
                          I'm not using WSDL binding. I'm not loading/using WSDL on client side.
                          My Java server side class ( for example in eeshowcase javabeans: SupplyItemDMI.java) fetch method is calling WCF service (with axis2 generated stubs) on other server. I'm not calling web service from client.
                          DSResponse object from that fetch method is populated with a list of axis2 generated objects (javabeans...adbbeans...).
                          So the problem is when SmartClient is serializing objects (calling getters methods on generated axis2 classes) to javascript. Difference in responses between 5.0 and 5.1 version is visible in post #3.

                          So I think you can't reproduce issue without those axis2 objects.
                          ​ Is post #10 good to go or do you have another idea?

                          Thank you,

                          Dejan

                          Comment


                            #14
                            It seems like you're saying that the issue is server-side execution of a valueXPAth against some Java beans. In that case a minimal test case would be some POJOs, a DataSource declaring a valueXPath, and code to cause the valueXPath or be executed (a standalone Java program that just calls DataSource.getProperties() should do it).

                            That would consistute a minimal, ready-to-run test case that clearly demonstrates a framework bug.

                            Comment


                              #15
                              Hi, again. I don't know is this good or bad.
                              DataSource.getProperties() works well. I've used
                              Code:
                              DataSource ds =  DataSourceManager.get("Contract")
                              in my method.
                              Then called
                              Code:
                              ds.getProperties()
                              for loaded Axis2 object from xml and everything is there.
                              Server side execution of a valueXPath is working. Used JSTranslator to write returned Map from getProperties() method to JS and that's the data i'm expecting on client side isn't it (will send files to support@isomorphic.com)?
                              Next step is creating DSResponse object and call setData. I even used JSTranslator to write DSResponse.getData() to JS and that is also good.

                              But, returning DSResponse object causes DataSources warnings can't get value for valueXPath which ds.getProperties() didn't. And finally there is response in RPC tab of console and that response is missing some objects and properties that should be there.
                              I'l send
                              • ContractData.json(test data),
                              • DataSourceGetPropertiesMapToJS.json ( DataSource.getProperies() result),
                              • ResponseInRPCtab.json( response in rpc tab) and
                              • all datasources
                              to support@isomorphic.com

                              So problem is when i return DSResponse from my method. How can i inspect what's hapening after that?

                              Maybe this is important. I'noticed that till version 5.1 SmartClient pooling for DataSource objects was disabled, and now is enabled. Maybe in pooling process is some kind of error and DataSource can't be found or something like that.
                              I'm loading DataSources with
                              Code:
                              <isomorphic:XML> <jsp:include page="/ds/MyDataSource.ds.xml"></jsp:include>
                              inside JSP



                              Comment

                              Working...
                              X