Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASMX Web Reference not Updating After Service Return Type Updated

I have a webservice - called MyCompany.WebService1

I reference this using a web reference in my ASP.net web application.

Theres a method called "GetDeal" in this web service, that returns a "Deal" Object. The deal object currently looks (for example) like this:

public class Deal
{
    Public string Name {get;set;}
    Public string Description {get;set;}
}

This class is in a different assembly: MyCompany.Model

The web service references this assembly.

In my web app, I can call the GetDeal method. This returns Service1.Deal (service1 is just the name of the web reference)

I can access both properties above.

I have now changed the Deal class, and added a couple more properties. However, I can't see these new properties in my web application.

I've updated the web service in the web application. I rebuilt the web service several times, tried removing the MyCompany.Model reference and re-addding it etc...

I can't figure out what has changed... This was working - I have changed the model before, and it's updated the reference correctly...

Anything I've missed?

like image 354
Alex Avatar asked Dec 11 '25 06:12

Alex


1 Answers

As long as the following points are fulfilled, this should work:

  • the new property is marked as Public and must be read/write (must have a getter and a setter)
  • you have compiled the host web application (the web app which exposes the web service).
  • (You can try calling the web service in a web browser to check whether the new property is visible).
  • you have updated the web reference the client application (and rebuilt the app)
like image 188
M4N Avatar answered Dec 12 '25 19:12

M4N



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!