Click here to Skip to main content
15,991,360 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
I have added secured web service reference (https) into my c# project.

At first it works fine. But after that when i hit the service through my code, it ask to refresh web service reference each time. (exact error is:- "You have called an unsupported operation, refresh wsdl.")

I have no idea that how to get rid from this issue.

Any help would be appreciated.

Thanks
Posted
Comments
JoCodes 27-Feb-14 2:20am    
Can you post some code related?
Coddddder 27-Feb-14 2:35am    
Hi JoCodes, thnx for your reply.

sure, here is sample code:

MYHTTPsService.MYHTTPsServiceClient mYHTTPsServiceClient;
Uri uri = new Uri(serviceAddPath + bindingElement.Element("URL").Value);
var address = new EndpointAddress(uri);
mYHTTPsServiceClient = new MYHTTPsService.MYHTTPsServiceClient(bindingElement.Element("Name").Value, address);


myServiceResponse = mYHTTPsServiceClient.ServiceMethod(someData);

here whenever i am hitting "ServiceMethod", getting above mentioned error.

Thanks

1 solution

This message is quite obvious. Try to do exactly what it recommends.

It is designed to work around the situations when a service interface changes after deployment. Think what happens if developers decides to change the interface. In other words, the WSDL will be changed. This is not a problem if the change is incremental, say, new methods are added. Old applications with the service's proxy generated using the legacy WSDL will still work.

But what if the change is non-incremental, for example, some method is removed? In this case, legacy client may fail if tries to call this method. And the service generates this kind of error message. What to do? You need to fix your client. Download updated WSDL, update it in the client project and try to rebuild your project. With new proxy generated form new WSDL, you can get a compilation error message which will tell you what's missing.

—SA
 
Share this answer
 
Comments
Coddddder 27-Feb-14 3:38am    
Thanks for your reply Sergey...

You are right here but problem is my service will be hit by windows service in regular interval. There will be no manual intervention.

So when service will be hit, and if it required to update wsdl reference at that time, this will through an error.

Thats why I wants to update wsdl reference at run time.

Thanks
Sergey Alexandrovich Kryukov 27-Feb-14 8:48am    
You need to update WSDL and rebuild it manually. It's unlikely that you might need it ever again. But right now, you simply don't have a working client.
—SA
thatraja 27-Feb-14 7:58am    
5!
Sergey Alexandrovich Kryukov 27-Feb-14 8:46am    
Thank you, Raja.
—SA
Coddddder 27-Feb-14 22:54pm    
Thanks Sergey...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900