首页 > Web Service的Basic Anthentication是怎么一回事?

Web Service的Basic Anthentication是怎么一回事?

我要访问一个有安全认证的Web Service,他们提供了SOAP和WSDL,我在SoapUI里,输入了username和password,能得到响应,他们说Web Service用的是Basic的认证。那么username和password是怎么传输的?是http://xxx/xxxService?userId=&password=这样?还是存在SOAP报文里?

还有在我用wsimport生成的客户端代码里怎么处理username和password?我在哪里输入username和password?


在使用wsimport时,加上如下参数:

-Xauthfile <file>

file中的内容是:

http://<user name>:<password>@<host name>/<Web service name>?wsdl

这样生成的class就是带有basic authentication信息的了。
username和password是通过http header Authorization 传输的。


题主可能值的是HTTP Basic Authentication,参考下wiki吧:

HTTP Basic Authentication

【热门文章】
【热门文章】