开发者

web services return type as complex

I have return a web services which return "Instances" from a datamining api. Now the problem is 开发者_如何学运维obvious web services by default cannot handle "Instances" as return type. What should be my approach.

Or

I may have to say User defined data types, please guide me of any documentation where I can implement this.

//////////////////////////////////////////////////////// 


    public Instances fetch(){ 

      Properties properties =
              Utils.readProperties("weka/experiment/DatabaseUtils.props"); 
      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); 
      String url = "jdbc:oracle:thin:@localhost:1521:XE"; 
      java.util.Properties props = new java.util.Properties(); 
          props.setProperty("user", "system"); 
          props.setProperty("password", "root") 

           DriverManager.registerDriver(new OracleDriver()); 
           Connection conn = DriverManager.getConnection(url, props); 

          Statement stmt = conn.createStatement(); 


        ResultSet rset1 = stmt.executeQuery("SELECT * FROM iris""); 
         return retrieveInstances(rset1); 
} 

//////////////////////////////////////////////////////// 

thanks in advance SR


Well, I think you should focus on data, rather than Instances. Try to serialize to XML or use JSON to pass data across.

Moreover, there are plenty of answers posted on this site:

https://stackoverflow.com/search?q=web+service+complex+data

Hope that helps,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜