Web services 如何在SOAP web服务中添加头参数作为java中的WS-producer
我不熟悉JavaWeb服务。我想向我的web服务添加标题,我试图在web方法的输入参数中添加@WebParam(name=“noon”,header=true)。我试过类似的东西。我需要一个具有以下输出XML格式的示例。有人能帮我在标题部分添加认证信息吗Web services 如何在SOAP web服务中添加头参数作为java中的WS-producer,web-services,soap,header,wsdl,Web Services,Soap,Header,Wsdl,我不熟悉JavaWeb服务。我想向我的web服务添加标题,我试图在web方法的输入参数中添加@WebParam(name=“noon”,header=true)。我试过类似的东西。我需要一个具有以下输出XML格式的示例。有人能帮我在标题部分添加认证信息吗 // Sample XML <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service
// Sample XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.reports.cfr.nesl.com/">
<soapenv:Header>
<AuthenticationInfo>
<userName>User</userName>
<password>password<password/>
</AuthenticationInfo>
</soapenv:Header>
<soapenv:Body>
<ser:getCreditFacilReport>
<arg0>
<!--Optional:-->
<info_type>?</info_type>
<!--Optional:-->
<info_value>?</info_value>
<!--Optional:-->
<output_type>?</output_type>
<!--Optional:-->
<requester_pan>?</requester_pan>
</arg0>
</ser:getCreditFacilReport>
</soapenv:Body>
</soapenv:Envelope>
===========The below java code which i have without header param==================
// Service implements calss
@WebService(endpointInterface = "com.nesl.cfr.reports.service.CreditFacilReportService")
public class CreditFacilReportServiceImpl implements CreditFacilReportService
{
@Override
public CreditFacilReportResponseBean getCreditFacilReport(CreditFacilReportRequestBean requestbean)
{
/*
....
....
*/
}
}
//Service class
@WebService
@SOAPBinding(style=SOAPBinding.Style.RPC)
public interface CreditFacilReportService {
@WebMethod
public CreditFacilReportResponseBean getCreditFacilReport(CreditFacilReportRequestBean requestbean);
}
//示例XML
使用者
密码
?
?
?
?
============下面的java代码,我没有头参数==================
//服务实现calss
@WebService(endpointInterface=“com.nesl.cfr.reports.service.CreditFacilReportService”)
公共类CreditFacilReportServiceImpl实现CreditFacilReportService
{
@凌驾
公共CreditFacilReportResponseBean getCreditFacilReport(CreditFacilReportRequestBean requestbean)
{
/*
....
....
*/
}
}
//服务等级
@网络服务
@SOAPBinding(style=SOAPBinding.style.RPC)
公共接口CreditFacilReportService{
@网络方法
公共CreditFacilReportResponseBean getCreditFacilReport(CreditFacilReportRequestBean requestbean);
}