Adding a new method will it break existing applications

J

Jay Balapa

Hello,

We have a webservice which is called by our pocket pc apps. We have a need
to filter data, so we want to add a another method on top to the existing
method.
Existing Service.asmx
Sync(DataSet myDataset)

New Service.asmx
Sync(DataSet myDataset);
Sync(DataSet myDataset,string filter);

If I recompile the app will this break the existing apps.

I posted this under asp.net/webservices and no reply.


Thanks,
-Jay Balapa
 
T

Teresa Church

Hello,

We have a webservice which is called by our pocket pc apps. We have a need
to filter data, so we want to add a another method on top to the existing
method.
Existing Service.asmx
Sync(DataSet myDataset)

New Service.asmx
Sync(DataSet myDataset);
Sync(DataSet myDataset,string filter);

If I recompile the app will this break the existing apps.

I posted this under asp.net/webservices and no reply.

Thanks,
-Jay Balapa

I ran into an issue with overloading methods when I first started -
I'm pretty sure it's possible it was caused by something else, but
just FYI.

As long as the new function is working properly and the old function
is not modifying, adding a function to a web service will not break
the service.
 
J

John Saunders [MVP]

Teresa Church said:
I ran into an issue with overloading methods when I first started -
I'm pretty sure it's possible it was caused by something else, but
just FYI.

As long as the new function is working properly and the old function
is not modifying, adding a function to a web service will not break
the service.

You do have to be careful here. Whether it breaks anything depends on what
"anything" is. You are changing the contract, and it's possible you'll find
some client that had a dependency on the old contract, in a way you didn't
expect.

That said, I don't know of a scenario where adding a method will break an
existing Windows client. I do not believe you can use overloading, however.
Give your new function a different name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top