Home > Net >  Consult webservice, token
Consult webservice, token

Time:10-28

Now to do a winform tool, you need to call other people to provide Web Service getMaterialList method, the document is as follows:
webservice interface1. Webservice interfaces are provided by the access control, before invoke the web service interface to get the data, you must first by calling tokenService interface to get access authorization token token,
2. When call other interface must be in the request header head bring a token information, webservice server according to the access token validation, validation data, through the server did not return to request
3. The token for the duration of 120 minutes, more than time token will fail, to regain some token can continue to call other interfaces,
Access token address:
http://XXX/tokenService? WSDL
Interface methods
Public String getToken (String userId, String password)

Call interface to get the data of the method:
A. in the request header increase auth and token header node element, bring a token information, as follows:

123 & lt;/token>

B. call related interface

The interface address
http://XXXXXX/materialService? WSDL

Interface methods
Public List GetMaterialList (String startDate, String endDate)
.


Before only in practice directly call a web service method, used access authorization token token,
Could you tell me how the steps should be? Could you help write a demo? Thank you

CodePudding user response:

This is the commonly used method, you need to fill the knowledge:
1. The HTTP protocol (especially the header related content)
2. The OAuth2
3. The HttpClient or RestSharp class library base class library.
  •  Tags:  
  • C #