How do I cast a webservice result to make it usable in a custom silverlight control?


i have designed custom silverlight control extends standard datagrid.  control provides method populate grid accepts instance of custom class have created.  control housed in number of different silverlight pages each of call web service obtain instance of custom class , pass off datagrid control populate itself.

my problem when silverlight container page receives object webservice, object's type tied service reference silverlight application.  so, example, if "silverlightcontainer" page calls webservice, type of object returned "silverlightcontainer.servicereference1.customdataobject".  gets passed data grid, because data grid in it's own class library, not part of "silverlightcontainer.servicereference1" namespace.  it, therefore, not know object.

i have tried importing identical service reference class library , casting shown below, receiving casting exception.

classlibrary.servicereference1.customdataobject obj =  (classlibrary.servicereference1.customdataobject)objectpassedfromcontainerpage;

does have ideas on how solve this?

 

when add reference web service, data types web service associated specific name space used when adding reference. can modifying web service return results in serialized string. means return type of web service type "string". in web service, can serialize return object json string or xml, whatever.. , in client side, deserialize return string object type again. , can provide assembly carries definitions of objects both service client.



Silverlight  >  Accessing Web Services with Silverlight



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........