![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
Thanks for the suggestion but I am already doing this, the problem is not in the namespace attached to the web service via the WebService attribute, it is in the .net namespace that is being created when using typed datasets... Any other ideas ? "Kaustubh Vaze" <kaustubh (AT) maximizelearning (DOT) com> wrote in message news:eo$%232DIRDHA.2176 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Try to tag your Web Service like this :[WebService(Namespace=http://+"any valid namespace")] public class MyWebService { // implementation }This will work.Regards,Kaustubh. |
#2
| |||
| |||
|
|
Unless I am very much mistaken this is a feature. And this puzzled me for a while and I did the same as you, sensibly separating out the DataSet into its own assembly... reference this in the web service and also in the calling app. Good design. If the calling app can see the web service this is no problem, you reference the DataSet through the namespace of your web service but realistically this data could be heading for some backend service that cannot it, for very good security reasons. This is not unreasonable. What you need to do is a Merge from one to the other. You can set what happens when the Merge takes place and set the options so that it enforces type safety. The other chap is wrong about the namespace attribute of the web service as a solution, by the way. Don't try to cast, the compiler didn't seem to mind in VS 2002 but it was wrong and should have thrown an exception but a run time you start to get problems. E.g. namespace.webserivenamespace.classname srv = new namespace.webserivenamespace.classname(); namespace.webserivenamespace.datasetname ds = srv.mymethod(); namespace.datasetname ds2 = new namespace.datasetname(); ds2.Merge(ds); See .Merge for the details about enforcing type safetly (the strictess option); Regards Ben "Giri" <gtharman (AT) prologis (DOT) com> wrote in message news:eqgLLXIRDHA.2224 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Thanks for the suggestion but I am already doing this, the problem is not in the namespace attached to the web service via the WebService attribute, it is in the .net namespace that is being created when using typed datasets... Any other ideas ? "Kaustubh Vaze" <kaustubh (AT) maximizelearning (DOT) com> wrote in message news:eo$%232DIRDHA.2176 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Try to tag your Web Service like this :[WebService(Namespace=http://+"any valid namespace")] public class MyWebService { // implementation }This will work.Regards,Kaustubh. |
#3
| |||
| |||
|
|
Thanks for the input Ben, nice to know someone has struggled with the same issue. The problem I have with using merge for the solution is that it is clunky.. I have managed to pinpoint the underlying problem to the following. If a web service exposes a return type as a typed dataset the automatic proxy generator feels obliged to create a copy of the typed data set and resulting code on the consumer end. This is not unreasonable IF the typed dataset doesn't already exist as an available type in the consumer.. what the proxy generator is not able to do is recognise that a type is already there (in the right namespace) and then NOT generate its own... This gets even worse IF two asmx pages are referenced by the consumer, both of which return the same Typed Dataset type... (you then end up with the same type in 3 places ! ) phew.. Long winded but hopefully someone in Microsoft is watching this enough to see the issue and add the necessary option to the proxy code generator to stop this from happening or a least giving us the option. The "kludge" I have found and am currently using ? Well you open the code generated by the proxy generator in visual studio (Web references / MyWebService/ Reference.cs) and REMOVE the generated Type for the Typed Dataset. This is not ideal as touching codegen code is always a bad idea... but hey, it works ! Regards Giri "Ben" <mustbejoking (AT) 120spamsaday (DOT) con> wrote in message news:eAbbVKORDHA.1712 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Unless I am very much mistaken this is a feature. And this puzzled me for a while and I did the same as you, sensibly separating out the DataSet into its own assembly... reference this in the web service and also in the calling app. Good design. If the calling app can see the web service this is no problem, you reference the DataSet through the namespace of your web service but realistically this data could be heading for some backend service that cannot it, for very good security reasons. This is not unreasonable. What you need to do is a Merge from one to the other. You can set what happens when the Merge takes place and set the options so that it enforces type safety. The other chap is wrong about the namespace attribute of the web service as a solution, by the way. Don't try to cast, the compiler didn't seem to mind in VS 2002 but it was wrong and should have thrown an exception but a run time you start to get problems. E.g. namespace.webserivenamespace.classname srv = new namespace.webserivenamespace.classname(); namespace.webserivenamespace.datasetname ds = srv.mymethod(); namespace.datasetname ds2 = new namespace.datasetname(); ds2.Merge(ds); See .Merge for the details about enforcing type safetly (the strictess option); Regards Ben "Giri" <gtharman (AT) prologis (DOT) com> wrote in message news:eqgLLXIRDHA.2224 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Thanks for the suggestion but I am already doing this, the problem is not in the namespace attached to the web service via the WebService attribute, it is in the .net namespace that is being created when using typed datasets... Any other ideas ? "Kaustubh Vaze" <kaustubh (AT) maximizelearning (DOT) com> wrote in message news:eo$%232DIRDHA.2176 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Try to tag your Web Service like this :[WebService(Namespace=http://+"any valid namespace")] public class MyWebService { // implementation }This will work.Regards,Kaustubh. |
#4
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |