read(): 1st argument can't be coerced to byte[]

Ype Kingma ykingma at accessforall.nl
Tue Mar 2 13:34:37 EST 2004


Etienne Antoniutti Di Muro wrote:

> Hi there everybody,
> I want to build a WEB Service client for a test Web Service of mine.
> I am using jython.
> The code is as follow:
> 
> (...)
> 1 response = request.POST() # posts SOAP to the web service  and waits for
> 2                           # response
> 3 instr = response.getInputStream()
> 4 reader = Sax2.Reader()
> 5 doc = reader.fromStream(instr)
> (...)
> 
> Well, at line 5, I get the error:
> 
> read(): 1st argument can't be coerced to byte[]

It seems that the instr argument to reader.fromStream(instr)
needs to be coerced to a java byte array.
You can do that by using the jarray module:
http://www.jython.org/docs/jarray.html

However, that probably conflicts with line 3.
Could you post how to do the same thing in java?

Regards,
Ype




More information about the Python-list mailing list