Hi,

I've been trying to serialize a SealedObject (which according to the Sun
docs implements Serializable) and keep getting back SOAP errors whining
that it doesn't know how to serialize the object. Am I missing something
here?

Here's the error:

[SOAPException: faultCode=SOAP-ENV:Client; msg=No Serializer found to
serialize a 'javax.crypto.SealedObject' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.;
targetException=java.lang.IllegalArgumentException: No Serializer found to
serialize a 'javax.crypto.SealedObject' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.]
        at
org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:324)
        at org.apache.soap.rpc.Call.invoke(Call.java:205)
        at Client.gupReg(Client.java:90)
        at Client.main(Client.java:144)

Here's the code:

        import javax.crypto.*;

        ### snip ###

        SealedObject so2 = new SealedObject(obj, c2);

        Call call = new Call ();
        call.setTargetObjectURI ("urn:test-gup-server"); //remember this name for the 
deployment descriptor.
        call.setMethodName ("GUPReg");
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);


        Vector params = new Vector ();
        params.addElement (new Parameter("spo1", SealedObject.class, so1, null));


        SOAPMappingRegistry smr = new SOAPMappingRegistry();
        BeanSerializer beanSer = new BeanSerializer();

        smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                new QName("urn:xml-soap-sealed-pub-object", "sealed-pub-object"),
                SealedPubObject.class, beanSer, beanSer);

        call.setSOAPMappingRegistry(smr);
        call.setParams (params);
        Response resp = call.invoke (/* router URL */ SOAPUrl, /* actionURI */ "" );

Thanks,
Kevin

Reply via email to