Java Wildfly 8.2和SOAP web服务-通过https发送文件

Java Wildfly 8.2和SOAP web服务-通过https发送文件,java,web-services,ssl,soap,wildfly,Java,Web Services,Ssl,Soap,Wildfly,服务器: 我有一个soapweb服务。web服务的某些方法处理接收文件并将文件保存到db。web服务要求它使用客户端证书进行身份验证。身份验证由自定义登录模块解析 @Stateless @WebService @MTOM(enabled = true) @WebContext(authMethod = "CLIENT-CERT", secureWSDLAccess = false, transportGuarantee = "CONFIDENTIAL") @RolesAllowed("meo_

服务器: 我有一个soapweb服务。web服务的某些方法处理接收文件并将文件保存到db。web服务要求它使用客户端证书进行身份验证。身份验证由自定义登录模块解析

@Stateless
@WebService
@MTOM(enabled = true)
@WebContext(authMethod = "CLIENT-CERT", secureWSDLAccess = false, 
transportGuarantee = "CONFIDENTIAL")
@RolesAllowed("meo_ws")
public class EDVWs implements IEDVWS
{
 ...
客户: 我创建了一个单元测试,它调用WS。在我保护web服务(HTTPS+客户端证书)之前,我能够通过测试调用它的所有方法。然后我添加了安全性,仍然能够调用不处理文件的服务。当我尝试将文件发送到服务时,我得到一个403禁止的错误。对于小文件(小于1MB),我不会遇到这种错误

错误:

Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '403: Forbidden' when communicating with https://localhost:8443/Jedro-EDV/EDVWs
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1577)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1532)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 33 more
奇怪的是,如果我将文件添加到调用中,它甚至在进入登录模块之前就被拒绝了。我试着设置最大邮件大小,但没有成功

<https-listener name="default-ssl" socket-binding="https"
                security-realm="SslRealm" max-post-size="52428800"/>

如果有任何提示,我将不胜感激:)

这个问题有什么解决办法吗?
public static void initServicePort(String endpoint, URL wsdlLocation)
{
    TLSClientParameters tlsClientParameters = initTLSClientParameters();

    service = new EDVWsService(wsdlLocation);
    edvWs = service.getEDVWsPort();
    BindingProvider bp = (BindingProvider) edvWs;
    SOAPBinding binding = (SOAPBinding) bp.getBinding();
    binding.setMTOMEnabled(true);

    log.debug("Success!");

    configureClient(tlsClientParameters, ClientProxy.getClient(edvWs));
}

private static void configureClient(TLSClientParameters tlsClientParameters, Client client)
{
    HTTPConduit http = (HTTPConduit) client.getConduit();
    http.setTlsClientParameters(tlsClientParameters);

    HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
    httpClientPolicy.setConnectionTimeout(new Long(30000));
    httpClientPolicy.setReceiveTimeout(new Long(30000));
    http.setClient(httpClientPolicy);
}