You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Rich Johns <rj...@vignette.com> on 2000/09/27 17:07:27 UTC

trying to use byte[] parm

I've been trying to pass a byte[] array parameter and it
fails with this:

Ouch, the call failed:
  Fault Code   = SOAP-ENV:Client
  Fault String = No Deserializer found to deserialize a 'urn:submitTest:fileData' using encoding
style 'http://schemas.xmlsoap.org/soap/encoding/'.


Here is how I set it up:

 Call call = new Call ();
 call.setTargetObjectURI ("DoByteArrayTest");
 call.setMethodName ("putBytes");
  call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC );

 SOAPMappingRegistry smr = new SOAPMappingRegistry();
 ArraySerializer arySer = new ArraySerializer();

 // Map the types.
 smr.mapTypes(Constants.NS_URI_SOAP_ENC,
       new QName("urn:byteTest", "fileData"),
       byte[].class, arySer, arySer);

 call.setSOAPMappingRegistry(smr);

  Vector params = new Vector ();
  params.addElement (new Parameter("fileData", byte[].class, fileData, Constants.NS_URI_SOAP_ENC )
);
 call.setParams (params);


Has anyone done this? any help would be most appreciated.
thanks.


Re: trying to use byte[] parm

Posted by Frederic POIROT <po...@yahoo.com>.
For the common java data type, it seems you don't need to declare a
serializer. If so, you don't have return values sometimes...But don't forget
the Constants.NS_URI_SOAP_ENC attribute for the parameter
Regards
Fred




----- Original Message -----
From: "Rich Johns" <rj...@vignette.com>
To: "soap" <so...@xml.apache.org>; "soap-dev" <so...@xml.apache.org>
Sent: Wednesday, September 27, 2000 08:07
Subject: trying to use byte[] parm


> I've been trying to pass a byte[] array parameter and it
> fails with this:
>
> Ouch, the call failed:
>   Fault Code   = SOAP-ENV:Client
>   Fault String = No Deserializer found to deserialize a
'urn:submitTest:fileData' using encoding
> style 'http://schemas.xmlsoap.org/soap/encoding/'.
>
>
> Here is how I set it up:
>
>  Call call = new Call ();
>  call.setTargetObjectURI ("DoByteArrayTest");
>  call.setMethodName ("putBytes");
>   call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC );
>
>  SOAPMappingRegistry smr = new SOAPMappingRegistry();
>  ArraySerializer arySer = new ArraySerializer();
>
>  // Map the types.
>  smr.mapTypes(Constants.NS_URI_SOAP_ENC,
>        new QName("urn:byteTest", "fileData"),
>        byte[].class, arySer, arySer);
>
>  call.setSOAPMappingRegistry(smr);
>
>   Vector params = new Vector ();
>   params.addElement (new Parameter("fileData", byte[].class, fileData,
Constants.NS_URI_SOAP_ENC )
> );
>  call.setParams (params);
>
>
> Has anyone done this? any help would be most appreciated.
> thanks.


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Re: trying to use byte[] parm

Posted by Jim Adrig <ji...@trampolining.com>.
I had a similar problem: try removing the mapping altogether (the
'smr.mapTypes' and 'call.setSOAPMappingRegistry(smr)' calls) and just
let SOAP handle the byte[] automatically.

It worked for me !

-- 
                                 __o
Jim Adrig                      _ \<,_
jim@trampolining.com          ' `/ ' `
                  ___________ `-'  `-'


Rich Johns wrote:
> 
> I've been trying to pass a byte[] array parameter and it
> fails with this:
> 
> Ouch, the call failed:
>   Fault Code   = SOAP-ENV:Client
>   Fault String = No Deserializer found to deserialize a 'urn:submitTest:fileData' using encoding
> style 'http://schemas.xmlsoap.org/soap/encoding/'.
> 
> Here is how I set it up:
> 
>  Call call = new Call ();
>  call.setTargetObjectURI ("DoByteArrayTest");
>  call.setMethodName ("putBytes");
>   call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC );
> 
>  SOAPMappingRegistry smr = new SOAPMappingRegistry();
>  ArraySerializer arySer = new ArraySerializer();
> 
>  // Map the types.
>  smr.mapTypes(Constants.NS_URI_SOAP_ENC,
>        new QName("urn:byteTest", "fileData"),
>        byte[].class, arySer, arySer);
> 
>  call.setSOAPMappingRegistry(smr);
> 
>   Vector params = new Vector ();
>   params.addElement (new Parameter("fileData", byte[].class, fileData, Constants.NS_URI_SOAP_ENC )
> );
>  call.setParams (params);
> 
> Has anyone done this? any help would be most appreciated.
> thanks.

Re: trying to use byte[] parm

Posted by Frederic POIROT <po...@yahoo.com>.
For the common java data type, it seems you don't need to declare a
serializer. If so, you don't have return values sometimes...But don't forget
the Constants.NS_URI_SOAP_ENC attribute for the parameter
Regards
Fred




----- Original Message -----
From: "Rich Johns" <rj...@vignette.com>
To: "soap" <so...@xml.apache.org>; "soap-dev" <so...@xml.apache.org>
Sent: Wednesday, September 27, 2000 08:07
Subject: trying to use byte[] parm


> I've been trying to pass a byte[] array parameter and it
> fails with this:
>
> Ouch, the call failed:
>   Fault Code   = SOAP-ENV:Client
>   Fault String = No Deserializer found to deserialize a
'urn:submitTest:fileData' using encoding
> style 'http://schemas.xmlsoap.org/soap/encoding/'.
>
>
> Here is how I set it up:
>
>  Call call = new Call ();
>  call.setTargetObjectURI ("DoByteArrayTest");
>  call.setMethodName ("putBytes");
>   call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC );
>
>  SOAPMappingRegistry smr = new SOAPMappingRegistry();
>  ArraySerializer arySer = new ArraySerializer();
>
>  // Map the types.
>  smr.mapTypes(Constants.NS_URI_SOAP_ENC,
>        new QName("urn:byteTest", "fileData"),
>        byte[].class, arySer, arySer);
>
>  call.setSOAPMappingRegistry(smr);
>
>   Vector params = new Vector ();
>   params.addElement (new Parameter("fileData", byte[].class, fileData,
Constants.NS_URI_SOAP_ENC )
> );
>  call.setParams (params);
>
>
> Has anyone done this? any help would be most appreciated.
> thanks.


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Re: trying to use byte[] parm

Posted by Jim Adrig <ji...@trampolining.com>.
I had a similar problem: try removing the mapping altogether (the
'smr.mapTypes' and 'call.setSOAPMappingRegistry(smr)' calls) and just
let SOAP handle the byte[] automatically.

It worked for me !

-- 
                                 __o
Jim Adrig                      _ \<,_
jim@trampolining.com          ' `/ ' `
                  ___________ `-'  `-'


Rich Johns wrote:
> 
> I've been trying to pass a byte[] array parameter and it
> fails with this:
> 
> Ouch, the call failed:
>   Fault Code   = SOAP-ENV:Client
>   Fault String = No Deserializer found to deserialize a 'urn:submitTest:fileData' using encoding
> style 'http://schemas.xmlsoap.org/soap/encoding/'.
> 
> Here is how I set it up:
> 
>  Call call = new Call ();
>  call.setTargetObjectURI ("DoByteArrayTest");
>  call.setMethodName ("putBytes");
>   call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC );
> 
>  SOAPMappingRegistry smr = new SOAPMappingRegistry();
>  ArraySerializer arySer = new ArraySerializer();
> 
>  // Map the types.
>  smr.mapTypes(Constants.NS_URI_SOAP_ENC,
>        new QName("urn:byteTest", "fileData"),
>        byte[].class, arySer, arySer);
> 
>  call.setSOAPMappingRegistry(smr);
> 
>   Vector params = new Vector ();
>   params.addElement (new Parameter("fileData", byte[].class, fileData, Constants.NS_URI_SOAP_ENC )
> );
>  call.setParams (params);
> 
> Has anyone done this? any help would be most appreciated.
> thanks.