dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] return values arrays


From: hector
Subject: [Pnet-developers] return values arrays
Date: Mon, 21 Jul 2003 08:33:05 -0400 (BOT)

Hello:

I want to work with DataBase.
I made one exercice for example:
----------------------------------------------------------------
namespace BD {
  using System;
  using System.Data;
  using DotGNU.XmlRpc;
  using Npgsql;
  [WebService(Description="BD testes", Namespace="http://localhost";)]
  public sealed class BD {
    public BD() : base () {}

  [WebMethod("example.bd",Description="connect bd with arrays")]
  public static string[] conexion2(string dato){
    string[] dates;
    NpgsqlConnection conn = new      
NpgsqlConnection(Server=localhost;Database=test;User 
Id=user;Password='linuxdb';);
    conn.Open();
    NpgsqlCommand command = new NpgsqlCommand(select val1, val2 from ttest
where val1="+dato, conn);
    try {
      NpgsqlDataReader leer = command.ExecuteReader();
      if (leer.Read()) {
        dates = new string[leer.FieldCount];
        for (int i=0; i< leer.FieldCount;i++) {
          dates[i] = leer[i].ToString();
        }
      }
      else {
        dates = new string[1];
        dates[1]= "error";
      }
      return dates;
    }
    finally {
      conn.Close();
    }
  }
}
}
-------------------------------------------------------------
this example compile and run with dgee.
 But when with python want to access this procedure don't response nothing.

I SUPOSE THAT MY WEBSERVICES DON'T RESPONSE NOTHING, MY WEBSERVICES IT'S BAD.

this exercices I made with only string
   for example:
      where
           dates[i]= leer[i].ToString();
      change
           dates += leer[i].ToString();

with this line my webservices work with any change clear :).
-------------------------------------------
I WANT TO WORK WITH DINAMIC ARRAY AND THAT'S MY WEBSERVICES RESPONSE
DINAMIC ARRAY AND IN PYTHON I CANT READ THIS VALUES.

I need your help;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]