Skip to main content

Content-Description with extra whitespace

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
mcanix
Offline
Joined: 2008-01-22

Hello,

When receiving a SOAPMessage with Attachments (signed using XWSS) the receiving server inserts an additional space in front of the Attachment Part Content-Description value which is causing signature validation to fail.

I suspect the following assumption "// SAAJ RI returns trimmed (at start) Content-Description values" might be incorrect.

Client: Content-Description: My Payload file
Server: Content-Description:  My Payload file

I've checked what the server is receiving over the line and it matches the client exactly; something breaks during SOAPMessage creation on the server side.

I've added the following system properties which I suspect could be adding (if not causing) to the problem. However I need 'saaj.mime.optimization:false' in order for my server to accept the message correctly.

System.setProperty("saaj.mime.optimization", "false");
System.setProperty("saaj.lazy.mime.optimization", "false");
System.setProperty("saaj.lazy.contentlength", "true");
System.setProperty("saaj.mime.multipart.ignoremissingendboundary", "true");

Thanks,

Mike

Versions:

Metro: 2.3 (latest April 2013)
Java: 1.6.0_51 Mac OS X

System Properties:

java.runtime.name: Java(TM) SE Runtime Environment
saaj.mime.multipart.ignoremissingendboundary: true
sun.boot.library.path: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries
java.vm.version: 20.51-b01-457
awt.nativeDoubleBuffering: true
gopherProxySet: false
mrj.build: 11M4509
java.vm.vendor: Apple Inc.
java.vendor.url: http://www.apple.com/
path.separator: :
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
file.encoding.pkg: sun.io
sun.java.launcher: SUN_STANDARD
user.country: US
sun.os.patch.level: unknown
java.vm.specification.name: Java Virtual Machine Specification
user.dir: /Users/mike/workspace/
java.runtime.version: 1.6.0_51-b11-457-11M4509
java.awt.graphicsenv: apple.awt.CGraphicsEnvironment
java.endorsed.dirs: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/endorsed
os.arch: x86_64
java.io.tmpdir: /var/folders/mk/gkp6w0qn4l3cnp5mps3kptnw0000gn/T/
line.separator:

java.vm.specification.vendor: Sun Microsystems Inc.
os.name: Mac OS X
sun.jnu.encoding: MacRoman
java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.specification.name: Java Platform API Specification
java.class.version: 50.0
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
saaj.lazy.contentlength: true
os.version: 10.8.4
http.nonProxyHosts: local|*.local|169.254/16|*.169.254/16
user.home: /Users/mike
user.timezone:
java.awt.printerjob: apple.awt.CPrinterJob
saaj.mime.optimization: false
file.encoding: MacRoman
java.specification.version: 1.6
java.class.path: /Users/mike/workspace/build:/Users/mike/workspace/izpack/standalone-compiler.jar:/Users/mike/workspace/libs/apache-log4j-extras-1.0.jar:/Users/mike/workspace/libs/bcmail-jdk16-145.jar:/Users/mike/workspace/libs/bcprov-jdk16-145.jar:/Users/mike/workspace/libs/commons-discovery-0.2.jar:/Users/mike/workspace/libs/commons-logging-1.1.jar:/Users/mike/workspace/libs/jackson-core-asl-1.7.4.jar:/Users/mike/workspace/libs/jackson-mapper-asl-1.7.4.jar:/Users/mike/workspace/libs/jcalendar-1.3.3.jar:/Users/mike/workspace/libs/jcommon-1.0.16.jar:/Users/mike/workspace/libs/jep.jar:/Users/mike/workspace/libs/jfreechart-1.0.13.jar:/Users/mike/workspace/libs/jna.jar:/Users/mike/workspace/libs/jython.jar:/Users/mike/workspace/libs/libintl.jar:/Users/mike/workspace/libs/local_policy.jar:/Users/mike/workspace/libs/log4j-1.2.14.jar:/Users/mike/workspace/libs/postgresql-8.4-701.jdbc4.jar:/Users/mike/workspace/libs/postgresql-9.1-902.jdbc4.jar:/Users/mike/workspace/libs/stringtree-json-2.0.5.jar:/Users/mike/workspace/libs/syslog4j-0.9.46-bin.jar:/Users/mike/workspace/libs/US_export_policy.jar:/Users/mike/workspace/libs/webservices-api.jar:/Users/mike/workspace/libs/webservices-extra.jar:/Users/mike/workspace/libs/webservices-rt.jar:/Users/mike/workspace/libs/webservices-extra-api.jar:/Users/mike/workspace/libs/webservices-tools.jar
user.name: mike
java.vm.specification.version: 1.0
sun.java.command: com.flame.core.Messenger
java.home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
sun.arch.data.model: 64
user.language: en
java.specification.vendor: Sun Microsystems Inc.
awt.toolkit: apple.awt.CToolkit
java.vm.info: mixed mode
java.version: 1.6.0_51
java.ext.dirs: /Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
sun.boot.class.path: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar
java.vendor: Apple Inc.
saaj.lazy.mime.optimization: false
file.separator: /
java.vendor.url.bug: http://bugreport.apple.com/
sun.io.unicode.encoding: UnicodeLittle
sun.cpu.endian: little
mrj.version: 1070.1.6.0_51-457
socksNonProxyHosts: local|*.local|169.254/16|*.169.254/16
ftp.nonProxyHosts: local|*.local|169.254/16|*.169.254/16
sun.cpu.isalist: