xml-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From duft...@us.ibm.com
Subject Re: Uisng the base64 serializer
Date Fri, 18 Aug 2000 16:34:33 GMT
Hi Simon & Jeff,

I just spent some time playing with the base64 logic from Xerces. While I
don't have much experience encoding/decoding with base64, I think there are
problems with the implementation there. I tried encoding/decoding some byte
arrays, and they don't round-trip correctly. Simon's test code (from below)
also produces several errors. I have switched back to our original impl of
the Base64Serializer, which used some code from XML Security Suite. I'll
commit the code, and then go find out from the author of XSS if this is ok.
Simon, I ran your test code using the revised serializer, and it appears to
work fine. Can you please try it out? If it works ok, we can post release
2.0.

Thanks,
-Matt

"Jeff MAURY" <jfmaury@scort.com> on 08/18/2000 03:40:37 AM

Please respond to soap-dev@xml.apache.org

To:   soap-dev@xml.apache.org
cc:
Subject:  Re: Uisng the base64 serializer





Simon Fell wrote:
>
> so, is no one else seeing this problem ?
Hello,

I used the base64 encoder in another context. I have met several
problems so I think there are some mistakes. I will try to recover my
changes and publish them.

Jeff

>
> Cheers
> Simon
>
> On Sun, 13 Aug 2000 11:13:48 -0700, in soap you wrote:
>
> >ok, i've got a bit further, but now i get an exception in
> >Base64.encode
> >
> >Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
> >        at org.apache.xerces.utils.Base64.encode(Base64.java:177)
> >        at
>
>org.apache.soap.encoding.soapenc.Base64Serializer.marshall(Base64Serializer.java:38)

> >        at
>
>org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(ParameterSerializer.java:100)

> >        at
> >org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:335)
> >        at
> >org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:305)
> >        at org.apache.soap.Body.marshall(Body.java:141)
> >        at org.apache.soap.Envelope.marshall(Envelope.java:180)
> >        at
>
>org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:100)

> >        at org.apache.soap.rpc.Call.invoke(Call.java:145)
> >        at
> >interop_tests.apacheSoap.testBase64.main(testBase64.java:53)
> >
> >and here's my code
> >
> >    byte items[] = new byte[512] ;
> >    for ( int i = 0 ; i < 512 ; ++i )
> >    {
> >               items[i] = (byte)(i % 256) ;
> >    }
> >
> >    // register the base64 serializer
> >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> >    Base64Serializer Ser = new Base64Serializer();
> >    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> >                 new QName("SOAP-ENC", "base64"),
> >                 byte[].class, Ser, Ser);
> >
> >    // Build the call.
> >    Call call = new Call ();
> >    call.setSOAPMappingRegistry(smr);
> >    call.setTargetObjectURI ("http://simon.fell.com/trickyTypes");
> >    call.setMethodName ("image_match");
> >    call.setEncodingStyleURI(encodingStyleURI);
> >    Vector params = new Vector ();
> >    params.addElement (new Parameter("imageData", byte[].class, items,
> >null));
> >    call.setParams (params);
> >
> >
> >This is using Apache SOAP 2.0 rc2 & Xerces-J 1.1.3
> >
> >Cheers
> >Simon
> >
> >On Sun, 13 Aug 2000 10:55:04 -0700, in soap you wrote:
> >
> >>I'm trying to use the base64Serializer to encode a byte array,
> >>currently the generated output is
> >>
> >><SOAP-ENV:Envelope
> >>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> >>xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> >>xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> >><SOAP-ENV:Body>
> >><ns1:image_match xmlns:ns1="http://simon.fell.com/trickyTypes"
> >>SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> >><imageData xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/"
> >>xsi:type="ns2:Array" ns2:arrayType="xsd:byte[512]">
> >><item xsi:type="xsd:byte">0</item>
> >><item xsi:type="xsd:byte">1</item>
> >><item xsi:type="xsd:byte">2</item>
> >>... etc
> >>
> >>
> >>Looking in SOAPMappingRegistry it doesn't appear to know about the
> >>base64Serializer, how do i register the base64Serializer at runtime ?
> >>
> >>Thanks
> >>Simon

--
Jeff MAURY
SCORT CTO


 #####   #####  ####### ######  #######
#     # #     # #     # #     #    #
#       #       #     # #     #    #
 #####  #       #     # ######     #
      # #       #     # #   #      #
#     # #     # #     # #    #     #
 #####   #####  ####### #     #    #

  Extending the net to the mainframe
  ==================================





Mime
View raw message