Guest User

Untitled

a guest
Aug 16th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Calling from javascript to WCF
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Runtime.Serialization;
  6. using System.ServiceModel;
  7. using System.Text;
  8.  
  9. namespace ISTL
  10. {
  11. public class MatchesListService : IMatchesListService
  12. {
  13. public bool AcceptRequestToChangeMatchTime(int matchId)
  14. {
  15. return MatchesListManager.AcceptRequestToChangeMatchTime(matchId);
  16. }
  17. }
  18. }
  19.  
  20. using System;
  21. using System.Collections.Generic;
  22. using System.Linq;
  23. using System.Runtime.Serialization;
  24. using System.ServiceModel;
  25. using System.Text;
  26.  
  27. namespace ISTL
  28. {
  29. [ServiceContract(Namespace = "ISTL")]
  30. public interface IMatchesListService
  31. {
  32. [OperationContract]
  33. bool AcceptRequestToChangeMatchTime(int matchId);
  34. }
  35. }
  36.  
  37. <system.serviceModel>
  38. <services>
  39. <service name="ISTL.MatchesListService">
  40. <endpoint binding="webHttpBinding" contract="ISTL.IMatchesListService"></endpoint>
  41. </service>
  42. </services>
  43. <behaviors>
  44. <endpointBehaviors>
  45. <behavior>
  46. <enableWebScript />
  47. </behavior>
  48. </endpointBehaviors>
  49. </behaviors>
  50. </system.serviceModel>
  51.  
  52. <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
  53. <Services>
  54. <asp:ServiceReference Path="~/MatchesListService.svc" />
  55. </Services>
  56. </asp:ScriptManager>
  57.  
  58. ISTL.IMatchesListService.AcceptRequestToChangeMatchTime(matchId);
Add Comment
Please, Sign In to add comment