Adding a new method will it break existing applications

  • Thread starter Thread starter Jay Balapa
  • Start date Start date
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
 
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.
 
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.
 
Back
Top