Hello,
I'm new to Axis, using Axis 2 Java v1.2 and am having
trouble moving binary data.
What I've done so far is successfully write and deploy
some POJO's. I'd now like to transfer some binary
data and have added a field like this:
public byte[] getData()
{
...
}
public void setData(byte[] data)
{
...
}
If I run java2wsdl, it does just what I expect--it
defines the "data" field as "xs:base64Binary". If I
then create a client from that WSDL (tried both Java
and C++) and make the soap call with my data, the
server chokes with this:
java.lang.NumberFormatException: For input string:
"/9j/4A...(long base64 string)../9k="
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Byte.parseByte(Byte.java:151)
at java.lang.Byte.<init>(Byte.java:325)
at
org.apache.axis2.databinding.typemapping.SimpleTypeMapper.getSimpleTypeObject(SimpleTypeMapper.java:85)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:361)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:349)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:403)
at
org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:676)
at
org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:624)
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:560)
at
org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:118)
at
org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:83)
at
org.apache.axis2.receivers.AbstractInMessageReceiver.receive(AbstractInMessageReceiver.java:33)
at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:279)
at
org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:216)
at
org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:275)
at
org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:184)
at
org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:74)
[...]
Of course, I can force it to work if I change the type
to String and just have both clients "know" that it's
base64, but I'd really like to avoid that if possible
(it's both bad style and extra headache).
Should I expect the technique I'm using above to work?
It looks like Axis is passing the entire
base64-encoded String to the java.lang.Byte(String)
constructor for some reason. Should I use something
other than byte[] to help the POJO mechanism figure it
out? Do I need to abandon the POJO approach?
Thanks,
David
____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]