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.
"Marvin Smit" wrote:
Hi,
I think the issue you are experiencing is the following;
You have a duplkicate definition of the data classes.
- 1 definition is comming from the original assembly (the one used by
your WebSerivice server)
- 1 definition is comming from the Proxy generated for the client
based on the WSDL.
You should remove the reference 'to the assembly with dataclasses'
from the client. The generated webservice proxy class already contains
the proxy classes for the data types too.
Hope this helps,
Marvin Smit.
On Sat, 22 Oct 2005 18:04:03 -0700, Lumina <lu****@nospam.com> wrote:
More datails.....
"No se puede convertir un valor de tipo '1-matriz dimensional
de Service.ProductoWSR.producto' en '1-matriz dimensional
de Common.producto' debido a que 'Service.ProductoWSR.producto'
no se deriva de 'Common.producto'."
code in Web Services
<WebMethod()> Public Function GetByCatId(ByVal nCt_id As Integer) As
Common.producto()
Code in Web page
Dim oWeb As New ProductoWSR.ProductoWS
Dim Productos As producto() = oWeb.GetByCatId(nCt_id)
"S.M. Altaf [MVP]" wrote:
Hi Lumina,
Does the web service have a reference to the class library containing the definitions for the Product Class?
-Altaf[MVP]
--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com
"Lumina" <lu****@nospam.com> wrote in message news:F8**********************************@microsof t.com...
I have a class "product" in a Web Project with the ensamblie.
In otherside I Have a Web Service and I want to return an product class
object,
but when I want to received this object in the Web Application I have an
error saying "can't not convert product in product".
Someone can help me