[JBossWS] - MTOM/SwA enabled file transfer
by biroj
Hi,
My configuration is:
JBossAS 4.0.5
JBossWS 1.2.0GA
EJB3 shipped with JBossAS 4.0.5
I've tried to publish an EJB3 WS (using contract-first model) with MTOM enabled file transfer as it is proposed by the JBossWS guideline.
I compiled the WSDL with wsconsume as appropriate and added the following annotations to the EJB3 POJO.
| @Stateless
| @Remote(ETI_Receiver.class)
| @WebService(endpointInterface="generated.wsdl.EMServicesPortType"
| , wsdlLocation="META-INF/wsdl/Services.wsdl"
| , targetNamespace="http://my.com/ws"
| , portName = "EMServicesPort")
| @BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)
| public class ETI_ReceiverBean extends ETI_CommonReceiverServices implements ETI_Receiver {
|
The endpoint works well, till I try to send send an attachment with MTOM/SwA enabled. The normal attachments are works fine, but if I enable MTOM or simple SwA at client side (Axis2 code, see below)
| EMServicesStub emstub = new EMServicesStub(uri);
| Options options = new Options();
| options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
| //options.setProperty(Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
| emstub._getServiceClient().setOptions(options);
|
it drops a SOAPRequest exception
| 2007-03-26 20:24:06,062 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 1m:16s:344ms
| 2007-03-26 20:25:10,234 DEBUG [org.jboss.ws.core.server.AbstractServiceEndpointServlet] doPost: /ETI-ETI_Framework/ETI_ReceiverBean
| 2007-03-26 20:25:10,250 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@e0e9d5 (Thread http-0.0.0.0-8080-1)
| 2007-03-26 20:25:10,250 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] BEGIN handleRequest: jboss.ws:context=ETI-ETI_Framework,endpoint=ETI_ReceiverBean
| 2007-03-26 20:25:10,312 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=multipart/related;
| boundary=MIMEBoundaryurn_uuid_6BC0C2D8E13C69924211749335100931;
| type="application/xop+xml";
| start="<0.urn:uuid:6BC0C2D8E13C69924211749335100932@apache.org>";
| start-info="text/xml"; charset=UTF-8]
| 2007-03-26 20:25:10,343 DEBUG [org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource] Using memory buffer, size = 8044
| 2007-03-26 20:25:10,750 DEBUG [org.jboss.ws.metadata.umdm.EndpointMetaData] Configure SOAPBinding
| 2007-03-26 20:25:10,750 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
| java.lang.IllegalArgumentException: multipart/related stream invalid, no root part was found
| at org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder.decodeMultipartRelatedMessage(MultipartRelatedDecoder.java:156)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:211)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:171)
| at org.jboss.ws.core.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:185)
| at org.jboss.ws.core.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:440)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
|
Could you help me a little how to solve this issue? Any idea?
Thanks a lot for your help in advance,
Bye,
Janos
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031742#4031742
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031742
17 years, 9 months
[JBossWS] - Problem for publish a Web Service
by nicolemans72
Hy!
I try to publish a Web Service (with the Eclipse JBoss IDE) with this simple class
| package gen;
|
| import javax.jws.soap.SOAPBinding;
|
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.ws.annotation.EndpointConfig;
|
| @EndpointConfig(configName = "Standard WSSecurity Endpoint")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @javax.jws.WebService(name="HelloImpl", targetNamespace="urn:gen", serviceName="HelloImplService")
| public class HelloImpl implements Hello
| {
|
| @WebMethod
| public String saluer()
| {
| return "Hello ";
| }
|
| }
|
By when I click on the "generate" button, I have this error:
| Running JBossWS wstools for [testWS]
| directory: D:\workspace\testWS
| command: cmd.exe /C D:\Program Files\Java\jboss-4.0.5.GA\bin\wstools.bat -cp bin -config C:\TEMP\wstools-config22402.xml -dest D:\workspace\testWS\src
| ========================================================================="
| .
| WSTools Environment
| .
| JBOSS_HOME: D:\Program Files\Java\jboss-4.0.5.GA\bin\\..
| .
| JAVA: D:\Program Files\Java\jdk1.5.0_06\bin\java
| .
| JAVA_OPTS:
| .
| ========================================================================="
| .
| Exception in thread "main" java.lang.NoClassDefFoundError: javax/jws/soap/SOAPBinding$ParameterStyle
| at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(ToolsHelper.java:106)
| at org.jboss.ws.tools.WSTools.process(WSTools.java:133)
| at org.jboss.ws.tools.WSTools.generate(WSTools.java:69)
| at org.jboss.ws.tools.WSTools.generate(WSTools.java:119)
| at org.jboss.ws.tools.WSTools.main(WSTools.java:58)
|
|
I looked in my libraries and I have the class "javax/jws/soap/SOAPBinding", so I don't understand my problem
Have anybody ever had this problem and solved it?
Thank you for your help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031623#4031623
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031623
17 years, 9 months
[JBossWS] - Re: WS-Security - Invalid timestamp, message claimed to be c
by rmartony
A workaround using a system property (jboss.ws.timestampTolerance) to set tolerance:
| // Source File Name: TimestampVerificationOperation.java
|
| package org.jboss.ws.wsse;
|
| import java.io.PrintStream;
| import java.util.Calendar;
| import org.jboss.ws.wsse.element.Timestamp;
| import org.w3c.dom.Document;
|
| // Referenced classes of package org.jboss.ws.wsse:
| // WSSecurityException, FailedCheckException
|
| public class TimestampVerificationOperation
| {
|
| public TimestampVerificationOperation()
| {
| now = null;
| }
|
| public TimestampVerificationOperation(Calendar now)
| {
| this.now = null;
| this.now = now;
| }
|
| public void process(Document message, Timestamp timestamp)
| throws WSSecurityException
| {
| Calendar expired = timestamp.getExpires();
| Calendar created = timestamp.getCreated();
| Calendar now = this.now != null ? this.now : Calendar.getInstance();
| if(Math.abs(created.getTimeInMillis() - now.getTimeInMillis()) > TIMESTAMP_TOLERANCE)
| throw new WSSecurityException("Invalid timestamp, message claimed to be created after now");
| if(expired != null && Math.abs(now.getTimeInMillis() - expired.getTimeInMillis()) > TIMESTAMP_TOLERANCE)
| throw new FailedCheckException("Expired message.");
| else
| return;
| }
|
| private Calendar now;
| private static long TIMESTAMP_TOLERANCE;
| private static String TIMESTAMP_TOLERANCE_PROPERTY;
|
| static
| {
| TIMESTAMP_TOLERANCE = 60000L;
| TIMESTAMP_TOLERANCE_PROPERTY = "jboss.ws.timestampTolerance";
| String value = null;
| System.out.println((new StringBuilder()).append("Setting the property value ").append(TIMESTAMP_TOLERANCE_PROPERTY).toString());
| try
| {
| value = System.getProperty(TIMESTAMP_TOLERANCE_PROPERTY);
| if(value != null)
| TIMESTAMP_TOLERANCE = Long.parseLong(value);
| else
| System.out.println("The value of the property has not been set as a system property");
| }
| catch(Throwable e)
| {
| System.out.println((new StringBuilder()).append("Error ocurred during setting of property value ").append(TIMESTAMP_TOLERANCE_PROPERTY).append(" con el valor: ").append(value).toString());
| }
| System.out.println((new StringBuilder()).append("The new timestamp tolerance is ").append(TIMESTAMP_TOLERANCE_PROPERTY).append(" = ").append(TIMESTAMP_TOLERANCE).toString());
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031566#4031566
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031566
17 years, 9 months
[JBossWS] - Re: Getting access to X509Certificate
by rmartony
I have the solve the same problem.
My configuration:
JDK 1.5
JBoss AS 4.0.5
JBossWS 1.0.4
WS-Security
Any ideas on how to interact with WS-Security with JSR 181-POJO Endpoint to obtain X509Certificate, Subject, Principal, etc.?
grey727, maybe the JWSDP and JSR-109 approach may help me...
Regards,
Rafael.
"gray727" wrote : My configuration:
| JDK 1.5
| JBoss AS 4.0.5
| JBossWS 1.2.0
| WS-Security
|
| The configuration of my web service requires an incoming SOAP message to be digitally signed (using Message Level Security; not BASIC authentication over SSL), and this works fine. However, I have an audit requirement to log the credentials of the client trying to access the service, whether successful or not. In the past (using JWSDP and JSR-109 style web services), I've used security callback functions to meet these sort of requirements.
|
| Is there a way to interact with WS-Security during authentication and authorization and obtain the X509Certificate, Subject, Principal, etc. to log security related events? I've experimented with the WebServiceContext.getUserPrincipal(), but it seems that this is only useful for BASIC authentication, which I'm not using.
|
| thanks.
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031545#4031545
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031545
17 years, 9 months