Lirux
Lirux

Reputation: 125

Performance issue with line breaks in base64 data with Spring-ws and Castor

I have a SOAP service implemented with spring-ws 2.2.0 with a Castor 1.3.3 marshaller. In the WSDL file there is a base64Binary element:

<xs:element type="xs:base64Binary" xmlns:xs="http://www.w3.org/2001/XMLSchema" maxOccurs="1" minOccurs="1" name="bytes"/>

With a CXF client the bytes are encoded on one line:

JVBERi0xLjQKJcfsj6IKNzkxIDAgb2JqCjw8L0xpbmVhcml6ZWQgMS9MIDEwMDQ1NzM1L0hbIDEwMjcxMyA0MDBdL08gNzkzL0UgMTAyNzEzL04...

With 9Mb file, the request is worked in about 40 seconds.

With a SAP client the bytes are encoded with 76 char blocks:

JVBERi0xLjMNCiXi48/TDQolUlNUWFBERjMgUGFyYW1ldGVyczoNCjIgMCBvYmoNCjw8DQovRmls
dGVyIDMgMCBSDQovTGVuZ3RoIDQgMCBSDQo+Pg0Kc3RyZWFtDQp4nB1Su60YMQzjKByFo2gUjcIi
yBysM0MKjfD6FBfJBg5nCLL4E4DGff1+/W7Z8ze///yIKKIJEyGGgEBBQgktWIgwAgosqFCFLriQ
...

And Every LF is encoded with the proper xml entity &#xA;

JVBERi0xLjMNCiXi48/TDQolUlNUWFBERjMgUGFyYW1ldGVyczoNCjIgMCBvYmoNCjw8DQovRmls&#xA;dGVyIDMgMCBSDQovTGVuZ3RoIDQgMCBSDQo+Pg0Kc3RyZWFtDQp4nB1Su60YMQzjKByFo2gUjcIi&#xA;yBysM0MKjfD6FBfJBg5nCLL4E4DGff1+/W7Z8ze///yIKKIJEyGGgEBBQgktWIgwAgosqFCFLriQ&#xA;

With a 3Mb file the request is worked in about 2 minutes and 40 seconds with the cpu at 100%.

Can the performance issue be related to the line breaks in the base64 stream? Could be a Castor, a spring-ws or a JDK issue?

Any advice?

Thanks

Upvotes: 3

Views: 282

Answers (0)

Related Questions