Various Problems with Edit Data Services Wizard

tbuss's picture
Just trying WSO2 dataservices for the first time, using the 2.0 download and have run into some problems with the Edit Data Services Wizard. Think some of these are bugs but I'm a new user so I thought I'd ask first. Note: I have tried both IE 6.0 SP2 on Windows 2003 and Firefox 3.52 and on Windows XP both running in batch mode. 1. I have found the Edit Data Services Wizard does not produce a result that works. It appears to add some additional attributes that cause the created data service definition to not work. Specifically, operations with arguments have incorrect .wsdl and are presented as having no arguments by the "try this service" page. The attributes are added to the "param" element and are type and ordinal. eg: param name="employeeNumber" sqlType="INTEGER" type="null" ordinal="1" All the existing elements get changed by the wizard whether the parent "query" is edited or not. See attached, DataServiceSample1.dbs.installed and DataServicesSample1.dbs.wizard Removing the added attributes from the xml like this: param name="employeeNumber" sqlType="INTEGER" appears to fix the problem. 2. It seems the only way to get the server to take changes made to a published data service definition is to restart the server. The changes do get saved to the disk in the repository\dataservices folder but have no effect on the already published service. I tried deactivating the service and reactivating it but the published service remains the same until the server is restarted. The changes then take effect and new operations appear as expected (assuming the attributes I mentioned above are not present). This restart may be intentional, a limitation or a configuration option but the UI gives no hint that a restart is required for changes to take effect which leaves the impression that server just doesn't work. Other minor problems I have noticed are: 1. Probably because of https config, the web based management console does not start up quite as described out of the box. Running the server in batch mode, it is necessary to first go to http://localhost:9763/ where a link to "carbon" is presented. Following that link get you to the Management console. Using http://localhost:9443/ds directly as described in the Quick Start Guide does not work. I think there is a typo and it should read https://localhost:9443/ds as is indicated in the User Guide. However that doesn't work either at least not without some configuration. According to the User guide it seems the start url depends how the server is run. The quick start guide and the user guide could be clearer on this. 2. The "Try this service" page often presents a blank page and it is necessary to manually refresh it to get it to present its content. Generally this happens after editing a published service but I have seen it happen after restarting the server and logging in. 3. The defaulted jdbc configuration for SQL server appears to be incorrect. I added sqljdbc.jar to the lib\extensions folder, restarted the server and selected MS SQL Server as the Database Engine in the Data Source Wizard config setting [HOST]:[PORT] to localhost:1433 and [DB] to my database name, sample. Test connection resulted in the error "Driver class com.microsoft.jdbc.sqlserver.SQLServerDriver can not be loaded. The reason for the error is that the actual class is com.microsoft.sqlserver.jdbc.SQLServerDriver and not the provided default "com.microsoft.jdbc.sqlserver.SQLServerDriver". Changing that allows the driver to load, however I still was not able to connect getting the error "Could not connect to database jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=sample with username sa" Quite possibly this is user error but the process of adding a jdbc driver to the server configuration is not particularly well described. It seems only the sample documentation mentions the extensions folder and it is inconsistent about that. Note: I was able to connect by using the jtds-1.2.jar driver instead using the jdbc url jdbc:jtds:sqlserver://localhost:1433/sample and the same user so this problem is something specific to the Microsoft driver. 4. While there appears to be a way to control the namespace to of the XML that results from a query via the Row namespace fields in the wizard, this value seems to have no effect on the XML defintion and and the resulting namespace at runtime is always something like xmlns:datas1="http://ws.wso2.org/dataservice. I have not yet found any documentation as to how this value is supposed to be expressed in the Data Service definition XML. 5. It is unclear of the "employeesByNumber" query in the sample, DataServiceSample1.dbs works. I have not found a "Employee Number" that returns anything and I suspect that the Employees table is not in the installed Derby sample database. 6. Just a usability note. The Data Service Wizard seems a bit inconsistent in its flow. Sometimes there is a "return.." button sometimes a "cancel" button etc. It is not always clear what the next action should be. Something to look at for the next release maybe?
AttachmentSize
DataServiceSample1.dbs_.installed.xml3.02 KB
DataServiceSample1.dbs_.wizard.xml3.5 KB
DataServiceSample1.dbs_.fixed_.xml3.43 KB
kalpanie's picture

Hi, Thanks for pointing us

Hi, Thanks for pointing us to the problems which are in Data services. 1.For your first major issue, i was trying to recreate, but i could not reproduce the issue you have mentioned here. If you could send us more information really appreciated. 2.You do not have to restart the server always when you have done a change. By editing the axis2.xml inside DS_HOME/conf as follows you can make hotupdates. Make sure to restart the server after you edit the axis2.xml true By default this comes as false, that's why you have to restart the server after you have done a change. Minor issues, 1. Yea, there's a bug in the quick start guide and have raised a jira (https://wso2.org/jira/browse/CARBON-5174)> It should be https://localhost:9443/carbon. 2. This may be because it takes few seconds to deploy the service. 3. System provides the driver class for Microsoft2000, but microsoft has changed the driver class and the URL for 2005 version. This has been fixed in our next release. 4. This works at the moment and the data service is giving xmlns:datas1="http://ws.wso2.org/dataservice" always because that is the default namespace. If you have given other namespace data service will get the given namespace. I will write a blog on how you can use the namespace and response you. 5. It has been installed. Eg : use employee number as 1504 and check. 6. We will consider your comments for our next release. Thanks /kalpanie
kalpanie's picture

Hi, Thanks for pointing us

Hi, Thanks for pointing us to the problems which are in Data services. 1.For your first major issue, i was trying to recreate, but i could not reproduce the issue you have mentioned here. If you could send us more information really appreciated. 2.You do not have to restart the server always when you have done a change. By editing the axis2.xml inside DS_HOME/conf as follows you can make hotupdates enable. Make sure to restart the server after you edit the axis2.xml  <parameter name="hotupdate">true</parameter> By default this comes as false, that's why you have to restart the server after you have done a change. Minor issues, 1. Yea, there's a bug in the quick start guide and have raised a jira (https://wso2.org/jira/browse/CARBON-5174)> It should be https://localhost:9443/carbon. 2. This may be because it takes few seconds to deploy the service. 3. System provides the driver class for Microsoft2000, but microsoft has changed the driver class and the URL for 2005 version. This has been fixed in our next release. 4. This works at the moment and the data service is giving xmlns:datas1="http://ws.wso2.org/dataservice" always because that is the default namespace. If you have given other namespace data service will get the given namespace. I will write a blog on how you can use the namespace and response you. 5. It has been installed. Eg : use employee number as 1504 and check. 6. We will consider your comments for our next release. Thanks /kalpanie
tbuss's picture

Hi, Thanks for you reply.

Hi, Thanks for you reply. Some feedback 1.For your first major issue, i was trying to recreate, but i could not reproduce the issue you have mentioned here. If you could send us more information really appreciated. [Tim] Think I would have to debug it to get any more details. I may try that if I have time but have you tried testing a clean install of the binary download in Windows XP SP3 or Windows 2003 SP3. Have you checked that the offending attributes are present once you run the Wizard. There are not present in the original sample .dbs files. I only ask because this problem seem very clear cut and specific to those particular attributes. The only other thought might the the version of Java. I am using jdk 1.5.0_05 or jdk 1.5.0_11 2.You do not have to restart the server always when you have done a change. By editing the axis2.xml inside DS_HOME/conf as follows you can make hotupdates enable. Make sure to restart the server after you edit the axis2.xml true By default this comes as false, that's why you have to restart the server after you have done a change. [Tim] Ok - so it's just the UI that is misleading by default. You might want to consider adding some text indicating "a reboot may be necessary depending on you configuration" or doing something more sophisticated. Minor issues, 1. Yea, there's a bug in the quick start guide and have raised a jira (https://wso2.org/jira/browse/CARBON-5174)> It should be https://localhost:9443/carbon. [Tim] I tried this and it works better for getting into the admin console but then the samples would not work. The "try this service" function gets a "Server Connection Failed" popup error. This does not occur if I start from http://localhost:9763/ and follow the carbon link. Odd. Haven't checked the bug to see if this is detailed but I suspect not. 2. This may be because it takes few seconds to deploy the service. [Tim] Make sense but would be nice if that could be handled in some way 3. System provides the driver class for Microsoft2000, but microsoft has changed the driver class and the URL for 2005 version. This has been fixed in our next release. [Tim] ok. I had trouble with the latest Microsoft driver too (cannot connect) Maybe I'll try the development build of dataservices and see if this is improved. 4. This works at the moment and the data service is giving xmlns:datas1="http://ws.wso2.org/dataservice" always because that is the default namespace. If you have given other namespace data service will get the given namespace. I will write a blog on how you can use the namespace and response you. [Tim] Thx, Appreciate the Blog when you get to it. I was able to figure out how to do it by editing the XML directly by adding the defaultNamespace attribute to the "result" element like this result element="customers" rowName="customer" defaultNamespace="urn:test" however the Wizard does not work and you cannot specify the empty namespace "" in the XML - you get a Null pointer error. Empty namespace should be allowed I think 5. It has been installed. Eg : use employee number as 1504 and check. [Tim] thx that worked 6. We will consider your comments for our next release. Thanks, Tim
jr97's picture

For SQL Server, download and

For SQL Server, download and use the jtds driver instead: http://jtds.sourceforge.net/
tbuss's picture

Hi, I have just tried the

Hi, I have just tried the new version 2.2.0 so I thought I update this

1. This issue appears to be fixed. The "Try this service" feature now works when the wizards edits a query that has parameters

2. It appears the out of the box default is to hot update the service. I notice the parameter is configured via a substituted value so it's unclear how you control it. Is this documented somewhere?

Minor issues,

1. https://localhost:9443/carbon now works - the "Try this service" feature now works if you start from that link

2. It seems that the deployment delay has been handled. I have not had to refresh the "Try this service" page.

3. It seems you still have the old SQLserver information which doesn't work out of the box. jtdc works as I mentioned and you also pointed out. One point. You have changed the location of the extensions folder where the driver .jar must be placed from CARBON_HOME\lib\extensions to CARBON_HOME\repository\components\extensions. Not sure where that is documented. I found it by accident.

4. I understand this feature now and I confirmed it works in 2.2.0. My problem with it is that you cannot control the prefix name and you canont make the namespace the default (ie no prefix) The latter was a show stopper for us but we have worked around it so this is just a nice to have at this point.

5. Still works. An example to add a query for allEmployees might help.

6. The wizard and xml editors appear unchanged. thanks for the new version.

 

I appreciate the improvements

Thanks, Tim

jr97's picture

namespace prefix was a show

namespace prefix was a show stopper for me as well. So I strip the namespace prefix altogether with a regular expression.