![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#11
| |||
| |||
|
|
"N. Shehzad" <NShehzad (AT) discussions (DOT) microsoft.com> wrote in message news:B4DCE955-F2E5-4BEE-98E5-DC13E6DDF717 (AT) microsoft (DOT) com... Actually, I got it to work with one dataset, but if my webservice has multiple typed datasets, they do not show up as proxy xsd when I create or update the web reference. See my other post, and which version of VS.NET are you using? John |
#12
| |||
| |||
|
|
I am using vs 2005. It seems like vs 2005 only creates proxy xsd class for only one strongly typed dataset. if the webservice is using multiple datasets, it does not create multiple classes how can I make the reference map to reflect both classes? |
#13
| |||
| |||
|
|
N. Shehzad, The main reason for the problem is that you are bundling the TypedDataset into an class library (dll). Please do not package the TypedDataset into an assembly. If you do that, you will end-up in the namespace conflicts. Try using the .xsd for TypedDataset at the Webservice side and the Client Side. I've used .xsd (instead of bundling .xsd inside assembly), it works. I could able to successfully pass the TypedDataset back-and-forth between webservice and client. Please let me know if this helps -- Thanks & Regards, Sundar Narasiman "N. Shehzad" wrote: All, I have a webservice webmethod which does returns a strongly typed dataset called MyStronglyTypedDataSet correctly. On the client side, when I cast the dataset to my strongly typed dataset, it throws the following error "Cannot convert type ClientConsumer.localhost.MyStronglyTypedDataSet" to "MyNameSpace.WebServices.MyStronglyTypedDataSe t' If I cast it as a regular dataset on client side, it works fine, but that defeats the whole purpose of having strongly typed DS in first place. I am using a web reference from the client application to the web service, and also reference to the StronglyTpedDataSet dll that I created using SDK Command Prompt What am I doing wrong? |
#14
| |||
| |||
|
|
"N. Shehzad" <NShehzad (AT) discussions (DOT) microsoft.com> wrote in message news:65D9D99F-99A5-47A5-BFAB-3CF4EE2034EC (AT) microsoft (DOT) com... Hi Sundar, I did create an .xsd schema first, and created a class file for that xsd schema using SDK Command prompt. How would I reference that class on the client side if I do not create a .dll library. Do I need to include that class on the client project as well? You don't need to do _anything_ to reference the class on the client side. Simply define your web service to return the strongly-typed dataset. Then use Add Web Reference in your client application to cause VS.NET to create the necessary proxy classes. One of those classes will be a client-side version of the server-side dataset. You will use that class on the client side. You will _never_ reference server-side classes on the client side. NEVER. John |
#15
| |||
| |||
|
|
"N. Shehzad" <NShehzad (AT) discussions (DOT) microsoft.com> wrote in message news:94B17407-1DCC-4937-BBD5-975380BBC72D (AT) microsoft (DOT) com... John, The problem is it does not create those client proxy classes for the dataset. When I add the web reference, it only creates the localhost reference that's all Select the "localhost" reference in Solution Explorer. Turn on "Show All Files", either by clicking the icon at the top of the Solution Explorer, or else using Project->Show All Files. This will add a "+" sign in front of "localhost". Click the plus signs a few times, and you'll find a Reference.cs (or .vb) file. Open that, and you should see all of the proxy classes. OTOH, which version of VS.NET are you using? This may be a VS2005 feature. John |
#16
| |||
| |||
|
|
Actually, I got it to work with one dataset, but if my webservice has multiple typed datasets, they do not show up as proxy xsd when I create or update the web reference. "John Saunders" wrote: "N. Shehzad" <NShehzad (AT) discussions (DOT) microsoft.com> wrote in message news:65D9D99F-99A5-47A5-BFAB-3CF4EE2034EC (AT) microsoft (DOT) com... Hi Sundar, I did create an .xsd schema first, and created a class file for that xsd schema using SDK Command prompt. How would I reference that class on the client side if I do not create a .dll library. Do I need to include that class on the client project as well? You don't need to do _anything_ to reference the class on the client side. Simply define your web service to return the strongly-typed dataset. Then use Add Web Reference in your client application to cause VS.NET to create the necessary proxy classes. One of those classes will be a client-side version of the server-side dataset. You will use that class on the client side. You will _never_ reference server-side classes on the client side. NEVER. John |
#17
| |||
| |||
|
|
This is not correct. When you reference a web service, a proxy class for the web service is created on the web service consumer. BUT, proxies for all possible webMethod return types are NOT created. If the client will be receiving a strongly-typed DataSet, then the client will need this class referenced directly. This can be accomplished by the strongly-typed DataSet existing in a separate assembly that both the web service and it's consumer can both reference separately, or a copy of the class exists in another place for the client to reference. |
#18
| |||
| |||
|
|
No John, only the web service class gets a proxy created for it. Not the return types of the web method calls. |
#19
| |||
| |||
|
|
XSD's can't be proxies as XSD's aren't classes. You are confusing Schemas with typed dataSets. |
#20
| |||
| |||
|
|
"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote in message news:%23M4AxZ5XHHA.992 (AT) TK2MSFTNGP02 (DOT) phx.gbl... XSD's can't be proxies as XSD's aren't classes. You are confusing Schemas with typed dataSets. Scott, have you noticed any .xsd files associated with strongly-typed DataSets? Do you have strongly-typed datasets in your projects which do NOT have an .XSD file nearby? John |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |