일(job)/MS(Microsoft)
[ASP] ASP에서 웹서비스_웹메소드 호출2
뽀&쏭
2016. 1. 8. 17:52
1) Webservice 호출 include file 제공 (첨부파일참고)
<!--#include file="webservice.asp"-->
<%
dim ws ‘ 웹 서비스 변수선언
set ws = new webservice ‘ 웹 서비스 객체 선언
‘ 웹 서비스 URL
ws.url = “http://웹서비스URL/웹서비스.asmx”
‘ 웹 서비스 메소드 선언
ws.method = "ReadDuplicate"
‘ 파라미터 ADD (cstname)
ws.parameters.Add "cstname", "테스트"
‘ 파라미터 ADD (email)
ws.parameters.Add "email", “test@nate.com”
‘ 파라미터 ADD (user)
ws.parameters.Add "user", "836"
ws.execute ‘ 웹 메소드 실행
response.Write ws.response ‘ 결과값 리턴
set ws = nothing ‘ 웹 서비스 객체 해제
%>
3) 웹 메소드 실행 후 결과값은 xml 태그형태로 리턴
<?xml version="1.0" encoding="utf-8'' ?> <string xmlns="url주소">24339136</string>