Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services...
-
Upload
rafe-kelley -
Category
Documents
-
view
269 -
download
1
Transcript of Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services...
![Page 1: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/1.jpg)
www.renad.org
ContentsBuilding Web Services
כתב
אקת'ם חאג' יחיא
BuildingBuilding Web Web ServicesServices
www.renad.org
![Page 2: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/2.jpg)
www.renad.org
ContentsBuilding Web Services
פתח את תוכנת Visual Studio לחץ על File->New->Web Site בחר את התבנית ASP.NET Web
Service בחר שם לפרויקט
![Page 3: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/3.jpg)
www.renad.org
ContentsBuilding Web Services
הסר את הקבציםService.asmx -ו Service.cs
הוסף קובץ חדש מסוגWeb Service בשם Math.asmx
![Page 4: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/4.jpg)
www.renad.org
ContentsBuilding Web Services
ו- Math.csוודא שהקובציםMath.asmx התווספו
לפרויקט
המבנה של הפרויקט ייראה כך:
![Page 5: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/5.jpg)
www.renad.org
ContentsBuilding Web Services
using System;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;
public class Math : System.Web.Services.WebService {
public Math () { }
[WebMethod] public decimal Add (decimal num1,decimal num2) { return num1+num2; {
o לחץ לחיצה כפולה על הקובץ Math.csoהוסף את הקוד הבא לקובץ שנפתח
![Page 6: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/6.jpg)
www.renad.org
ContentsBuilding Web Services
[WebMethod] public decimal Sub (decimal num1, decimal num2) { return num1 - num2; }
[WebMethod] public decimal Mult (decimal num1, decimal num2) { return num1 * num2; }
[WebMethod] public decimal Div (decimal num1, decimal num2) { return num1 / num2; }}
המשך לקוד של המחלקה Math.cs
![Page 7: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/7.jpg)
www.renad.org
ContentsBuilding Web Services
]WebService(Namespace = "http://tempuri.org/")[
המלצה לשנות את מרחב השמות שנמצא כמאפיין
WSבראש מחלקת ה-
oהרץ את הפרויקט o בדוק אם כל המתודות נמצאות
בדף
![Page 8: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/8.jpg)
www.renad.org
ContentsBuilding Web Services
לחיצה על הקישור Service Description
שבראש הדף תציג לנו שמתאר WSDLאת ה- WSאת ה-
![Page 9: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/9.jpg)
www.renad.org
ContentsBuilding Web Services
יוצג לנו הדף הבאAddבלחיצה על שם המתודה
הכנס שני ערכים לתיבות הטקסט
כדי Invokeולחץ על להפעיל את המתודה
![Page 10: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/10.jpg)
www.renad.org
ContentsBuilding Web Services
התוצאה היא XMLתמיד קובץ
זה הקובץ שמקבל WSהצרכן של ה-
![Page 11: Www.renad.org Contents Building Web Services כתב אקת'ם חאג' יחיא BuildingWeb Services Building Web Services .](https://reader036.fdocuments.in/reader036/viewer/2022082317/5697bfe11a28abf838cb3c88/html5/thumbnails/11.jpg)
www.renad.org
ContentsBuilding Web Services
o -מבנה הודעת ה Soap o בחלק העליון נמצא בין
השאר את הערכים שהמתודה מקבלת
o בחלק התחתון נמצא בין השאר את הערך
שהמתודה מחזירה