The server sent HTTP status code 401: Unauthorized

The client code is generated according to the wsdl connection, and an error is reported when calling the interface: the server sent HTTP status code 401: Unauthorized. The reason for querying this error is that there is no access right. It is thought that the customer provided the user name and password when providing the interface wsdl access connection.
Solution:
Add this class
insert image description here
and add this code segment before the interface runs insert image description here
to successfully access the interface!

Guess you like

Origin blog.csdn.net/weixin_44812604/article/details/126542877
Recommended