简体   繁体   English

是否可以在不重新部署的情况下添加对网站的asmx Web服务的引用?

[英]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. 我们有一个遗留的ASP.NET网站(不是Web应用程序,因此我可以自由地编辑代码),在这里我可以确定实时代码与源代码控制中的版本不匹配。

I have to make a small change where I move the logic of a method to a webservice. 在将方法的逻辑移至Web服务的地方,我必须进行一些小的更改。

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... 引用新服务时,会将以下内容添加到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? 是仅需更改web.config的附加内容还是其他内容?

Edit: 编辑:

I see that there is a App_Webreferences folder in the directory of the live site with a folder for each web service. 我看到在实时站点的目录中有一个App_Webreferences文件夹,其中包含每个Web服务的文件夹。 This folder has a .disco, discomap and .wsdl file in it. 此文件夹中有一个.disco,discomap和.wsdl文件。 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. 这是你的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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