java - Wildfly 8.2 and SOAP web service - sending files over https -
server: have soap web service. of methods of web service handle receiving , saving files db. web service requires it called client-cert authentication. authentication resolved custom login module.
@stateless @webservice @mtom(enabled = true) @webcontext(authmethod = "client-cert", securewsdlaccess = false, transportguarantee = "confidential") @rolesallowed("meo_ws") public class edvws implements iedvws { ...
client: created unit tests call ws. before secured web service (https + client-cert) able invoke of methods via tests. added security , still able call services not handle files. when try send files services, 403 forbidden error. not error small files (less 1mb).
error:
caused by: org.apache.cxf.transport.http.httpexception: http response '403: forbidden' when communicating https://localhost:8443/jedro-edv/edvws @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.handleresponseinternal(httpconduit.java:1577) @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.handleresponse(httpconduit.java:1532) @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.close(httpconduit.java:1330) @ org.apache.cxf.transport.abstractconduit.close(abstractconduit.java:56) @ org.apache.cxf.transport.http.httpconduit.close(httpconduit.java:652) @ org.apache.cxf.interceptor.messagesenderinterceptor$messagesenderendinginterceptor.handlemessage(messagesenderinterceptor.java:62) ... 33 more
the weird thing if add file call rejected before gets login module. tried set max-post-size no luck.
<https-listener name="default-ssl" socket-binding="https" security-realm="sslrealm" max-post-size="52428800"/>
client configuration:
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); }
i appreciate tip :)
Comments
Post a Comment