I need to consume some methods on my page through a Web-Service. This Web-Service is in Europe.
What is the best way to do this? What are End-Points?
I need to consume some methods on my page through a Web-Service. This Web-Service is in Europe.
What is the best way to do this? What are End-Points?
According to link , an endpoint is defined in translated text below:
An endpoint is a connection point from where the HTML or dynamic files are exposed. Endpoints provide information needed to access a Webservice . The endpoint provides a reference or specification that is used to define a group or family of message-addressing properties and provide end-to-end message characteristics such as references to the origin and destination of the endpoints, as well as the identity of messages to allow uniform addressing of "independent" messages. The endpoint can be a PC, PDA, or point-of-sale terminal.
In your case, the endpoint is the WebService address itself that you want to access.
To add a WebService to your application, do the following:
Right click on the project > Add > Service Reference
Onthisscreen,clickAdvanced
Click Add Web Reference ...
PastetheWebServiceaddressyouwanttoaccessintheURLfield.IfitisevenaWebServicewithavalidWSDL,themethodswillappearinthebottomsquare.JustclickAddReferencetoaddaclassthatrepresentsaccesstotheWebServicetoyourproject.
To access the data from your WebService in Controller, use a statement something like this:
var wsMeuWebService = new wsMeuWebService.MeuWebService();
wsMeuWebService.MetodoDoWebService();
Do the following, right-click the project and choose the Adicionar referência de serviço
option.
Paste the WS URL, change the namespace, and click OK.