On 6/14/07, Rick Reumann <[EMAIL PROTECTED]> wrote:

On 6/14/07, robert lazarski <[EMAIL PROTECTED]> wrote:
> Rick, to send a byte array is easy. Try the following:
>
> ArrayList args = new ArrayList();
> String hello = "hello";
> args.add(hello.getBytes());
> OMElement response = sender.invokeBlocking(operationName, args.toArray
());
>
> Hint: POJO's use the RPCMessageReceiver. There are unit tests for all
the
> receivers. So 'use the source'  ;-) .
>
>
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java?revision=526324&view=markup

Thanks Robert (and others) for the help. So am I too assume you can't
just use wsdl2java to create client stubs that will work for sending a
byte[]? I was assuming I could take the easy way out of simply
generating easy to use stubs - apparently I now have to learn more
about what's really going on 'behind the scenes' and send it in a more
low-level way?


Sorry, I thought you were using POJO's . I think mentioned using base64.
Doing this though wsdl would be sort of like:

  <element name="RCZipperRecieveZip">
       <complexType>
         <sequence>
           <element name="zipfile" type="xsd:base64Binary"/>
         </sequence>
       </complexType>
   </element>

The code would then be:

File file = new File(filePath);
byte[] fileBytes = Utils.getBytesFromFile(file);
rcZipperRecieveZip.setZipfile(fileBytes);

As I think I stated, you could reduce the size of the payload about by about
a third via mtom - the above code was used long ago, before mtom became
stable.

HTH,
Robert



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to