In <[EMAIL PROTECTED]>, Dan Winsor wrote: > Sybren Stuvel wrote: >> [EMAIL PROTECTED] enlightened us with: >> > I want to send thorugh the API. However, no matter how I try it, >> > Java on the other end doesn't like what I'm passing it there. >> >> What have you tried and how did it fail? > > See below. > >> > How can I mimic a byte array in python? >> >> Strings? > > OK, I'll put that attempt up front. Here's a couple of tries: > > <test code snippet> > fileobj = open('testfile.txt', mode='r') > chararray = fileobj.read() > fileobj.close() > > soap.addAttachmentsToIssue(auth,'TST-4','testfile.txt',chararray) > > <fails with> > SOAPpy.Types.faultType: <Fault soapenv:Server.userException: > org.xml.sax.SAXException: Found character data inside an array element > while deserializing: <SOAPpy.Types.structType detail at -1216265236>: > {'hostname': '<removed>', 'faultData': <SOAPpy.Types.structType > faultData at -1216226708>: {'exception': None, 'message': 'Found > character data inside an array element while deserializing'}}>
In the Java snippet from your initial post the `chararray` argument was an *array* of `Byte` arrays. A string is just an one dimensional "byte array". Maybe it helps if you put `chararray` into a list!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list