开发者社区 问答 正文

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?

展开
收起
蛮大人123 2016-02-26 17:53:12 2518 分享 版权
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪

    在使用wsimport时,加上如下参数:
    -Xauthfile <file>
    file中的内容是:
    http://<user name>:<password>@<host name>/<Web service name>?wsdl
    这样生成的class就是带有basic authentication信息的了。
    username和password是通过http header Authorization 传输的。

    2019-07-17 18:48:34
    赞同 展开评论
问答分类:
问答标签:
问答地址: