简体   繁体   English

如何从 ASP.Net C# 中的其他项目或解决方案调用 Web 服务

[英]How to call a web service from the other project or solution in ASP.Net C#

I want to call a web service using the JQuery-Ajax.我想使用 JQuery-Ajax 调用 Web 服务。 I know in your local folder, you can do that, how about if I transfer my web service to other project.我知道在您的本地文件夹中,您可以这样做,如果我将我的 Web 服务转移到其他项目如何。 What is the code?代码是什么?

I tried to change the URL but it gives me a request method: OPTION.我试图更改 URL,但它给了我一个请求方法:OPTION。

You have search How to Consume Webservice to other project.您已经搜索了如何使用Webservice到其他项目。 For Example if you are running your webservice in your system, it will give you URL like this例如,如果您运行的webservice在您的系统,它会给你一个URL喜欢这个

http://localhost:54808/WebSite4/Service.asmx

http://127.0.0.1/WebSite4/Service.asmx

If you want to consume your webservice to other project you have to host your webservice or you need to have webserver to do this.如果你想消耗你的webservice的其他项目,你必须承载您的webservice ,或者你需要有网络服务器来做到这一点。

to consume your webservice you have to use Your system Network IP address消耗你的webservice ,你必须使用你的system Network IP address

Example:例子:

http://192.2.0.1/WebSite4/Service.asmx

by using this URL ,you can consume it in any other project according to you convenient.通过使用此URL ,您可以根据自己的方便在任何其他项目中使用它。

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

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