![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#21
| |||
| |||
|
|
"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote in message news:%23foHtY5XHHA.4552 (AT) TK2MSFTNGP05 (DOT) phx.gbl... 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. Sorry, I don't know where you get this from. Maybe you're talking about .NET 1.1? Of course proxies are created for the WebMethod return types. How do you expect a client to be able to access them? I think you're confusing Web Services and Remoting. In the case of Remoting, you_do_ share the data types. John |
#22
| |||
| |||
|
|
I am referring to .NET 1.1 and I'm not confusing remoting and Web Services. The proxy created by VS.NET is a proxy class to the web service class and exposes the web service class's web methods. The return types of those methods do not get proxies created for them. I think you are confusing the web service class itself and the class(es) that may be returned from them. |
#23
| |||
| |||
|
|
"N. Shehzad" <NShehzad (AT) discussions (DOT) microsoft.com> wrote in message news:BB274218-9B6B-4701-AE34-574BFD0A9E7B (AT) microsoft (DOT) com... 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? Are both datasets used as return values? As an experiment, try changing the return type of the method whose dataset is being created in the proxy class with one of those that is not: Now a proxy for class A is being created: [WebMethod] A Method1(){return new A();} [WebMethod] B Method2(){return new B();} Change it to this and see what happens: [WebMethod] B Method1(){return new B();} [WebMethod] A Method2(){return new A();} John |
#24
| |||
| |||
|
|
"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote in message news:uHht2u%23XHHA.4232 (AT) TK2MSFTNGP05 (DOT) phx.gbl... I am referring to .NET 1.1 and I'm not confusing remoting and Web Services. The proxy created by VS.NET is a proxy class to the web service class and exposes the web service class's web methods. The return types of those methods do not get proxies created for them. I think you are confusing the web service class itself and the class(es) that may be returned from them. You are making too many assumptions. Even in .NET 1.1, other classes were created in the proxy file. This includes the types used in return values and the types used in parameters. What's changed in 2.0 is that there appears to be some infrastructure that now permits the typed datasets to be created in the proxy. I'm enclosing a small VS.NET 2005 solution which demonstrates the new behavior. It has two projects: a Web Service project and a Windows Form client. The service has two methods, each of which returns a different typed dataset. The Windows Forms project has a web reference to the Web Service. If you look in the "WindowsApplication1\Web References\localhost" directory, you'll see that the XML Schema files for both typed datasets have been imported into the web reference. Further, the References.cs file includes proxy classes for both typed datasets. Note the comment: // This type definition was generated by System.Data.Design.TypedDataSetSchemaImporterExten sion schema importer extension. This is the magic that allows VS.NET to generate proxy classes for the typed datasets. And, if you look at the WSDL file, you'll see why: none of the structure of the typed datasets is present in the WSDL. A client other than ..NET would not be able to treat these return values as objects of a strong type. At best, such a client would be able to treat them as XML elements with a schema to validate against. At that, such a client would need to be able to interpret the schemaLocation attribute in the <s:import> element in the WSDL as an actual URL from which to retrieve the schemas, or else the schemas would need to be provided out-of-band. One more note, since I've mentioned strongly-typed datasets and schemas in the same post. ;-) I've found that the new DataSet designer in VS.NET 2005 does not preserve the structure of a schema. I had several VS2003 strongly-typed dataset schemas which, when "converted" to the VS2005 format lost their structure. Worse, the schema resulting from asking a typed dataset instance to do a WriteXmlSchema does not match the original schema. The DataSet itself is added as an outer XmlElement, for instance. It doesn't matter if you're just using strongly-typed datasets to represent database tables, but I thought I'd mention it for the benefit of any readers using XML schemas as XML schemas. John |
#25
| |||
| |||
|
|
John, Thanks that worked. It seems you need to have the webmethod as strongly typed dataset for all typed datasets in order for the proxy classes to be created on the client side. I had only one return type method that's why only 1 proxy class for the strongly typed dataset was being created. Thanks for your help again! |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |