简体   繁体   中英

asp.net web service on local server

I create a new web service in VS and I create a function that return a value

This the code of my function

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
 Public Class Service
 Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function CalculerTaxe() As String
    Dim tps As Double = 0.095
    Dim tvq As Double = 0.05
    Dim PrixHors As Double
    Dim PrixFinal As Double = PrixHors * tps * tvq
    Return PrixFinal.ToString()
End Function

End Class

So I don't change the namespace because I don't know what write for a virtual server?...

What I have to do to make my service work in a another web site?

First you need to host your web service on iis (same way you do for website).

Then you can call your webservice from other applications or websites.

A simple webservice call might look like this.. http://hostname/sample.ashx?tps=222&tvq=655

What I have to do to make my service work in a another web site?

Nothing; you just need to expose your web service on a public URL. Other websites should be able to code against your web service transparently.

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