ก่อนที่เราจะเรียกใช้ Web Service
ใน ASP.NET เราจะต้องสร้าง Web Service
และเพิ่ม Web Reference เข้าไปใน ASP.NET ก่อน
http://www.asp.net/learn/videos/video-280.aspx
มี 2 วิธีในการเรียกใช้
Web Service
1. synchronous approach
2. asynchronous approach
- Synchronous approachในการเรียกใช้
Web Service:
YourWebServiceName.ServicesomeWS = new YourWebServiceName.Service();
someWS.WebServiceMethod();
- Asynchronous approachในการเรียกใช้
Web Service:
YourWebServiceName.ServicesomeWS = new YourWebServiceName.Service();
System.AsyncCallbackcb = new AsyncCallback(showmsg);
someWS.BeginWebServiceMethod(cb,someWS);
void showmsg(IAsyncResult ar)
{
YourWebServiceName.Service someWS = (YourWebServiceName.Service)ar.AsyncState;
Response.Write(someWS.EndWebServiceMethod(ar));
}
ข้อมูลเพิ่มเติม
http://msdn2.microsoft.com/en-us/library/t745kdsh.aspx.
ฟอรัมที่เกี่ยวข้อง
http://forums.asp.net/t/1204640.aspx
Supa Sethasiripong [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.