0
안녕하세요 아래 모두는 내가 사용하고자하는 WebService 클래스입니다 (작성했습니다). 문제는 그것을 사용하는 방법에 대해 잘 모르겠습니다. DataAccessObject
의 다른 인스턴스를 통해 DB에 연결하는 WinForm이 있습니다.웹 서비스로 작업하는 방법
사용자는 양식의 웹 사이트 버전을 열고 거기에서 데이터베이스를 수정하는 버튼을 클릭 할 수 있어야합니다.
문제는 내가 할 수있는 서비스를 사용하는 방법을 모른다 그래서
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Xml.Linq;
using System.Configuration;
/// <summary>
/// Summary description for DataManager
/// </summary>
[WebService(Namespace = "/201103578Site//Default.aspx")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
//[System.Web.Script.Services.ScriptService]
public class DataManager : System.Web.Services.WebService
{
XElement[] xmlCompany = null;
XElement[] xmlCandidate = null;
XElement[] xmlQualification = null;
public DataManager()
{
//Uncomment the following line if using designed components
//InitializeComponent();
DataAccessObject.DataAccessObject daoDataBase = new DataAccessObject.DataAccessObject(ConfigurationManager.ConnectionStrings[1].ToString());
daoDataBase.openConnection();
xmlCompany = daoDataBase.sqlSelectCompany(new SQL.SqlImplementation(), "Select * From Company");
xmlCandidate = daoDataBase.sqlSelectCandidate(new SQL.SqlImplementation(), "Select * From Candidate");
xmlQualification = daoDataBase.sqlSelectQualification(new SQL.SqlImplementation(), "Select * From Qualification");
daoDataBase.closeConnection();
}
[WebMethod]
public XElement[] getXmlCompany()
{
return xmlCompany;
}
[WebMethod]
public XElement[] getXmlCandidate()
{
return xmlCandidate;
}
[WebMethod]
public XElement[] getXmlQualification()
{
return xmlQualification;
}
}
나는
getXmlCompany
과 Company.aspx.cs에서 다른 방법 중 하나처럼 파일을 호출하고 싶은
가능
친절 감사
마르쿠스는
디버거에서 웹 서비스 프로젝트를 시작한 다음이를 소비 할 프로젝트로 이동하여 웹 참조를 추가해야합니다. –