Thursday, November 18, 2004

VJs Tip Of The Day - November 18th 2004

Whidbey Days - Sharing Types Across Web Service Proxies

I do not know how many of you have faced this problem but I have always had a complain that about not being able to share types across different web service proxies... Take this scenario... I have a business application which exposes many different web services... These web services might be sharing some common object across themselves... For example Lets say I have a Auto Insurance application... I build one web service to do Policy related jobs and the other to do Premium related jobs but then in both the condition my Automobile object goes along... Now, as my proxy generator will generate service proxy for each of the service individually so I will get two Automobile classes and if I have a single client application dealing with it I will have to either create different namespaces or do some manual editing...
Although the editing might not be much the problem is that regeneration causes those changes to go away... Also there needs to be some documentation around this problem etc... Well enough of problem statement, I think you must have got it by now... :-) Anyways, in Whidbey the problem is resolved...
The WSDL exe has a switch called /sharetypes and you can give the services for which you want to share the types and it will do it for you... The syntax will be something like...

Wsdl.exe /sharetypes http:(doubleSlash)AutoInsuranceServics/PolicyService.asmx?wsdl http:(doubleSlash)AutoInsuranceServics/PremiumService.asmx?wsdl


PS: A quick observation, I see many posts and queries on our UserGroups and Newsgroup which are so simple that typing just the first word in the google (also MSDN sometimes... Just kidding!!.. :-)) will result into sufficient information to answer the query... The point which I want to make is that it is also important to develop a good habit to try resolve to our own queries, ourselves... No one knows everything, but each one of us learn over a period of time right!!... Asking our own usergroup peers is not wrong but then at times its spoon feeding, it just makes us develop a bad habit... All I am saying is let us just try to make sure that we have exhausted all the resources at our end either time or material before we ask it out; might be trying for another 10 minutes will give us the answer we want!!...
Please do not get me wrong, do not stop asking me questions whenever you feel like, I do try answering as many as I can and I continue doing that!! (but now after the vacation.. :-))

1 comment:

HimaBindu Vejella said...

nice information from U
I agree with U 100%
Some times it even irritates the other person .One should think before asking is it really worth or not,since we may waste the precious time of other person too

--HimaBindu Vejella