简体   繁体   中英

Is it possible to add a reference to an asmx web service of a web site without redeploying?

We have a legacy ASP.NET web site (not web application, so I can freely edit the code) where I'm pretty sure that the live code doesn't match the version we have in source control.

I have to make a small change where I move the logic of a method to a webservice.

So the old method was something like:

public byte[] CreatePivot(DataTable D, string PivotPath, string Parms)
{
 ...LOGIC!
}

The new method is going to be something like:

public byte[] CreatePivot(DataTable D, string PivotPath, string Params)
{
       ConsoleApplication4.PivotService.Service1 pivotService = new ConsoleApplication4.PivotService.Service1();
       byte[] bob = pivotService.CreatePivot(D, PivotPath, Params);
}

When referencing the new service the following is added to the web.config...

<applicationSettings>
        <ConsoleApplication4.Properties.Settings>
            <setting name="ConsoleApplication4_PivotService_Service1" serializeAs="String">
                <value>http://aservice.com/PivotWebservice.asmx</value>
            </setting>
        </ConsoleApplication4.Properties.Settings>
    </applicationSettings>

Is it possible to add a reference to the new service without redeploying? Is the only needed change the addition to the web.config or is there something more to it?

Edit:

I see that there is a App_Webreferences folder in the directory of the live site with a folder for each web service. This folder has a .disco, discomap and .wsdl file in it. Maybe it'll work if I copy those files across too.

So, to recap, your production site doesn't match your "local source". Are you using source control? Doesn't sound like it.

In any case, you want to do software development in your production site, right? Just edit and go, no testing, no "deployment"?

Yeah, you can do that. It's your choice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM