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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Etienne Antoniutti Di Muro

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

    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.getInp utStream()
    4 reader = Sax2.Reader()
    5 doc = reader.fromStre am(instr)
    (...)

    Well, at line 5, I get the error:

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

    Does not seem to be a DOM parsing problem.

    Any tip about this ?


    Thanks in advance
    Etienne



  • Diez B. Roggisch

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

    > 1 response = request.POST() # posts SOAP to the web service and waits for[color=blue]
    > 2 # response
    > 3 instr = response.getInp utStream()
    > 4 reader = Sax2.Reader()
    > 5 doc = reader.fromStre am(instr)
    > (...)
    >
    > Well, at line 5, I get the error:
    >
    > read(): 1st argument can't be coerced to byte[][/color]

    What is that Sax2 thingy? It looks to me that the fromStream-method passes
    the instr to something that expects a byte-array - so you could try to read
    all the stuff from instr into an array and pass that.
    [color=blue]
    > Does not seem to be a DOM parsing problem.[/color]

    how could it, its SAX.....

    --
    Regards,

    Diez B. Roggisch

    Comment

    • Ype Kingma

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

      Etienne Antoniutti Di Muro wrote:
      [color=blue]
      > 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.getInp utStream()
      > 4 reader = Sax2.Reader()
      > 5 doc = reader.fromStre am(instr)
      > (...)
      >
      > Well, at line 5, I get the error:
      >
      > read(): 1st argument can't be coerced to byte[][/color]

      It seems that the instr argument to reader.fromStre am(instr)
      needs to be coerced to a java byte array.
      You can do that by using the jarray module:


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

      Regards,
      Ype

      Comment

      Working...