Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从java客户端使用FSETService时出错_Java_Soap_Axis2 - Fatal编程技术网

从java客户端使用FSETService时出错

从java客户端使用FSETService时出错,java,soap,axis2,Java,Soap,Axis2,任何人都在使用来自java的California EDD FSETService 正在尝试使用基于.Net的WCF服务 我正在使用基本的UserNameToken身份验证并发布到 使用Axis2 wsdl2code maven插件生成存根 把错误找回来 org.apache.axis2.AxisFault: **An error occurred when verifying security for the** message. org.apache.axis2.util.Ut

任何人都在使用来自java的California EDD FSETService

正在尝试使用基于.Net的WCF服务

我正在使用基本的UserNameToken身份验证并发布到

使用Axis2 wsdl2code maven插件生成存根

把错误找回来

    org.apache.axis2.AxisFault: **An error occurred when verifying security for the** message.
    org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
    org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
    org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
    org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at gov.ca.edd.stub.FsetServiceStub.ping(FsetServiceStub.java:649)
    at com.preludesoftware.edd.client.Edd.initiateService(Edd.java:233)
    at com.preludesoftware.edd.client.Edd.main(Edd.java:79)
从SOAP用户界面使用相同的服务时效果良好。

示例java代码:

    FsetServiceStub stub = new FsetServiceStub("https://fsettestprod.edd.ca.gov/FSETWCFProxyWebService/FsetService.svc/basic");         
    HttpTransportProperties.Authenticator basicAuthenticator = new HttpTransportProperties.Authenticator();
    List<String> authSchemes = new ArrayList<String>();
    authSchemes.add(Authenticator.BASIC);
    basicAuthenticator.setAuthSchemes(authSchemes);
    basicAuthenticator.setUsername("uName");
    basicAuthenticator.setPassword(StringEscapeUtils.unescapeHtml4("pwd"));         
    basicAuthenticator.setPreemptiveAuthentication(true);
    stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,basicAuthenticator);           
    stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,"false");           
    stub._getServiceClient().getOptions().setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    stub.print();
FsetServiceStub stub=新的FsetServiceStub(“https://fsettestprod.edd.ca.gov/FSETWCFProxyWebService/FsetService.svc/basic");         
HttpTransportProperties.Authenticator basicAuthenticator=新的HttpTransportProperties.Authenticator();
List authSchemes=new ArrayList();
添加(Authenticator.BASIC);
basicAuthenticator.setAuthSchemes(authSchemes);
basicAuthenticator.setUsername(“uName”);
basicAuthenticator.setPassword(StringEscapeUtils.unescapeHtml4(“pwd”);
basicAuthenticator.setPreemptiveAuthentication(真);
stub.\u getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,basicAuthenticator);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,“false”);
存根._getServiceClient().getOptions().setSoapVersionURI(SOAP11Constants.SOAP\u信封\u命名空间\u URI);
stub.print();
任何帮助/想法都很好

编辑: 工作副本:

    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setServiceClass(IFsetService.class);
    factory.setAddress("https://fsettestprod.edd.ca.gov/FSETWCFProxyWebService/FsetService.svc/basic"); 
    IFsetService service = (IFsetService)factory.create();
    Client client = ClientProxy.getClient(service);
    Endpoint cxfEndpoint = client.getEndpoint();
    Map<String,Object> outProps = new HashMap<String,Object>();
    outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
    outProps.put(WSHandlerConstants.USER, "<uName>");
    outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
    outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,ClientPasswordCallback.class.getName());
    WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
    cxfEndpoint.getOutInterceptors().add(wssOut);
    String pingResponse = service.ping();
JaxWsProxyFactoryBean工厂=新的JaxWsProxyFactoryBean();
factory.setServiceClass(IFsetService.class);
工厂设置地址(“https://fsettestprod.edd.ca.gov/FSETWCFProxyWebService/FsetService.svc/basic"); 
IFsetService=(IFsetService)factory.create();
Client Client=ClientProxy.getClient(服务);
端点cxfEndpoint=client.getEndpoint();
Map outProps=new HashMap();
put(WSHandlerConstants.ACTION,WSHandlerConstants.USERNAME\u令牌);
outProps.put(WSHandlerConstants.USER,“”);
outProps.put(WSHandlerConstants.PASSWORD_类型,WSConstants.PW_文本);
put(WSHandlerConstants.PW_CALLBACK_类,ClientPasswordCallback.CLASS.getName());
WSS4JOutInterceptor wssOut=新的WSS4JOutInterceptor(输出程序);
cxfEndpoint.getOutiterCeptors().add(wssOut);
字符串pingResponse=service.ping();

“验证安全性时出错”:表示您没有正确的用户/密码?我们可以使用uName/pwd进行测试吗?请同时发布您的pom.xml。我使用的凭据与使用SOAP-UI进行测试时使用的凭据相同(有效)。uName/pwd是虚拟的。我通过从Axis2切换到Apache CXF成功地使用了EDD服务“验证应用程序的安全性时出错”:表示您没有正确的用户/密码?我们可以使用uName/pwd进行测试吗?请同时发布您的pom.xml。我使用的凭据与使用SOAP-UI进行测试时使用的凭据相同(有效)。uName/pwd是虚拟的。我通过从Axis2切换到Apache CXF成功地使用了EDD服务