C#으로 WebService가 있는데이 응용 프로그램에서이 웹 서비스에 액세스하려고합니다. Ex. localhost에서 하나의 webservice를 실행하고 있고 또한 localhost에서 실행중인 웹 사이트를 가지고 있으며이 두 프로젝트는 다른 위치에 있습니다. 질문 : 어떻게 내 웹 사이트에서 ajax를 사용하여이 웹 서비스를 localhost에서 호출 할 수 있습니까? "HTTP :다른 응용 프로그램에서 웹 서비스에 액세스
URL을 :
$.ajax({
type: "POST",
url: "localhost:52137/Service1.asmx?op=HelloWorld",
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: '',
success: function (data, status) {
alert(data.d);
},
error: function(data, status){
alert(status);
}
});