>More datails.....
>
[quoted text clipped - 28 lines]
>>
>> Someone can help me
Thank You Marvin. I am progresing but i do not complete the task.
I Have:
Web service :
<WebMethod()> Public Function GetByCatId(ByVal nCt_id As Integer) As
producto()
....
....
Return productos.ToArray(GetType(producto))
End Function
ServiciosProductos Class :
Public Class ServicioProductos
Public Shared Function GetProductosPorCatWS(ByVal nCt_id As Integer) As
ProductoWSR.producto()
Dim oWeb As New ProductoWSR.ProductoWS
Dim Productos As ProductoWSR.producto() = oWeb.GetByCatId(nCt_id)
oWeb.Dispose()
oWeb = Nothing
'*1
Return Productos
End Function
End Class
Note: ProductoWSR = Producto Web Service reference
In the *1, the code works perfectly. Now.. this function is used from the
web page :
....
....
Me.Lista.DataSource =
Service.ServicioProductos.GetProductosPorCatWS(nCt_id)
Me.Lista.DataBind()
In the Databind see this error:
DataBinder.Eval: 'Service.ProductoWSR.producto' no contiene una propiedad
con el nombre 'nombre'
But in the point '*1' i see the property 'nombre'.
I Inspect 'Me.Lista.DataSource' and see perfectly the property 'nombre'..
but in the databing.. crash.
Thank You.
> Hi,
>
[quoted text clipped - 46 lines]
> >>
> >> Someone can help me
Marvin Smit - 25 Oct 2005 17:19 GMT
Hi,
I'm glad we got the duplicate definition out of the code. I'm sorry
to say, but i must yield to someone else now. I have little experience
in using the databinding functionality.
The little info i can provide would be;
- I'm sure the de-serialization is correct because you show that souce
(with the *1) does return exactly what you expected.
But i'm sure an databinding expert on this list will be able to help
you further with this problem.
one last thing that jumped into my mind was that you might have
special characters in the naming (Italian, Spanish?)
Marvin Smit.
>Thank You Marvin. I am progresing but i do not complete the task.
>
>I Have:
>
>Web service :
> <WebMethod()> Public Function GetByCatId(ByV
b
l nCt_id As Integer) As
>producto()
>....
[quoted text clipped - 92 lines]
>> >>
>> >> Someone can help me
RYoung - 30 Oct 2005 23:20 GMT
> Me.Lista.DataSource =
> Service.ServicioProductos.GetProductosPorCatWS(nCt_id)
[quoted text clipped - 5 lines]
> DataBinder.Eval: 'Service.ProductoWSR.producto' no contiene una propiedad
> con el nombre 'nombre'
If I'm not mistaken, in order for an object to act as a DataSource for a
control, it needs to have property accessors. The generated code for the web
service, the Product class, only generates public field accessors, therefore
cannot be databound
Your Product class may look like this:
[Serializable]
public class Product
{
private int productId;
public int ProductId{ get{ return productId; } set{ productId =
value; }}
}
The proxy generated class will look like this:
public class Product
{
public int ProductId
}
So, on the client side you'll need to do some transformation to map the
proxy Product class to a domain Product class so that you can databind.
Alternatively, I believe the XsdObjectGen utility will generate proxy
classes with property accessors. Google for XsdObjectGen.
Ron