axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Roder <mro...@wamnet.com>
Subject Issue - exception being ignored in Call.registerTypeMapping
Date Mon, 28 Jan 2002 14:29:16 GMT


My client code is doing this:

    Service service = new Service();
    Call aCall = (Call) service.createCall();
    aCall.setTargetEndpointAddress(url);
    aCall.setOption(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
    aCall.setOption(AxisEngine.PROP_SEND_XSI, Boolean.FALSE);
    aCall.setOption(Call.SEND_TYPE_ATTR, Boolean.FALSE);
        QName userQName = new QName("",
                                    "User");
        LOG.debug("Here we go");
        
        aCall.registerTypeMapping(User.class,
                                  userQName,
                                  new BeanSerializerFactory(User.class,
                                                            userQName,
 
BeanSerializer.FORCE_UPPER),
                                  new BeanDeserializerFactory(User.class,
                                                              userQName));

        
        
        aCall.setReturnType(Constants.XSD_STRING);

        RPCParam userParam = new RPCParam("User", aUser) ;
        String ret = (String)aCall.invoke("Login",
                                          new Object [] {userParam });
	
        Message msg = aCall.getResponseMessage();
        SOAPEnvelope env=msg.getSOAPPart().getAsSOAPEnvelope();
        SOAPHeader sessionHeader = env.getHeaderByName(
"urn:schemas-wamnet-com:Session","SessionID");
        String aString = (String) sessionHeader.getValueAsType(new
QName(Constants.URI_2001_SCHEMA_XSD, "string"));
	
        sessionId = aString.trim();


I added the following logging code to Call

    public void registerTypeMapping(Class javaType, QName xmlType,
                                    SerializerFactory sf,
                                    DeserializerFactory df,
                                    boolean force) {
        // Get the TypeMappingRegistry
        TypeMappingRegistry tmr = msgContext.getTypeMappingRegistry();
        category.debug("tmr of " + tmr);
        
        // If a TypeMapping is not available, add one.
        TypeMapping tm = (TypeMapping)
tmr.getTypeMapping(Constants.URI_CURRENT_SOAP_ENC);
        category.debug("tm of " + tm);
        
        try {
            if (tm == null) {
                tm = (TypeMapping) tmr.createTypeMapping();
                tmr.register(tm, new String[]
{Constants.URI_CURRENT_SOAP_ENC});
                category.debug("after tmr.register" + tmr);
                
            }
            if (!force && tm.getClassForQName(xmlType) != null)
                {
                category.debug("going to just return");
                
                return;
                }
            

            // Register the information
            tm.register(javaType, xmlType, sf, df);
            category.debug("after tm.register" + tm);
            
        } catch (Exception e)
            {
            category.error("Caught and eating exception",e);
            
            }
    }

Here is the trace of the run.


2002-01-28 08:21:58,788 DEBUG archive.soapclient.ArchiveService :: Enter
login
2002-01-28 08:21:59,379 DEBUG apache.axis.AxisEngine :: Enter:
AxisEngine::init
2002-01-28 08:21:59,750 DEBUG apache.axis.AxisEngine :: Exit:
AxisEngine::init
2002-01-28 08:21:59,870 INFO  axis.client.Call :: Transport is
org.apache.axis.transport.http.HTTPTransport@200185
2002-01-28 08:21:59,870 DEBUG archive.soapclient.ArchiveService :: Here we
go
2002-01-28 08:21:59,870 DEBUG axis.client.Call :: tmr of
org.apache.axis.encoding.TypeMappingRegistryImpl@43c315
2002-01-28 08:21:59,870 DEBUG axis.client.Call :: tm of
org.apache.axis.encoding.DefaultTypeMappingImpl@3c9c31
2002-01-28 08:21:59,900 ERROR axis.client.Call :: Caught and eating
exception
javax.xml.rpc.JAXRPCException
	at org.apache.axis.encoding.TypeMappingImpl.register(Unknown Source)
	at org.apache.axis.client.Call.registerTypeMapping(Unknown Source)
	at org.apache.axis.client.Call.registerTypeMapping(Unknown Source)
	at
com.wamnet.archive.soapclient.ArchiveService.login(ArchiveService.java:115)
	at
com.wamnet.archive.soapclient.ArchiveServiceLoginTEST.testLogin_Invalid(Arch
iveServiceLoginTEST.java:28)
	at java.lang.reflect.Method.invoke(Native Method)
	at junit.framework.TestCase.runTest(TestCase.java:166)
	at junit.framework.TestCase.runBare(TestCase.java:140)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:131)
	at junit.framework.TestSuite.runTest(TestSuite.java:173)
	at junit.framework.TestSuite.run(TestSuite.java:168)
	at junit.framework.TestSuite.runTest(TestSuite.java:173)
	at junit.framework.TestSuite.run(TestSuite.java:168)
	at junit.swingui.TestRunner$17.run(TestRunner.java:644)
2002-01-28 08:21:59,900 DEBUG axis.client.Call :: Enter:  Call::invoke(ns,
meth, args)
2002-01-28 08:21:59,920 DEBUG axis.client.Call :: Enter:
Call::invoke(RPCElement)
2002-01-28 08:21:59,950 DEBUG apache.axis.Message :: Attachment support is
enabledfalse
2002-01-28 08:21:59,970 DEBUG apache.axis.Message :: Enter SOAPPart ctor
(FORM_SOAPENVELOPE)
2002-01-28 08:21:59,990 DEBUG axis.encoding.SerializationContextImpl ::
register 'SOAP-ENV' - 'http://schemas.xmlsoap.org/soap/envelope/'
2002-01-28 08:22:00,040 DEBUG axis.utils.NSStack :: NSPush (0)
2002-01-28 08:22:00,040 DEBUG axis.encoding.SerializationContextImpl ::
register 'xsd' - 'http://www.w3.org/2001/XMLSchema'
2002-01-28 08:22:00,040 DEBUG axis.encoding.SerializationContextImpl ::
register 'xsi' - 'http://www.w3.org/2001/XMLSchema-instance'
2002-01-28 08:22:00,040 DEBUG axis.encoding.SerializationContextImpl ::
Start element [http://schemas.xmlsoap.org/soap/envelope/]:Envelope
2002-01-28 08:22:00,070 DEBUG axis.utils.NSStack :: NSPush (1)
2002-01-28 08:22:00,070 DEBUG axis.message.SOAPEnvelope :: 0 headers
2002-01-28 08:22:00,070 DEBUG axis.encoding.SerializationContextImpl ::
Start element [http://schemas.xmlsoap.org/soap/envelope/]:Body
2002-01-28 08:22:00,070 DEBUG axis.utils.NSStack :: NSPush (2)
2002-01-28 08:22:00,070 DEBUG axis.encoding.SerializationContextImpl :: End
element SOAP-ENV:Body
2002-01-28 08:22:00,110 DEBUG axis.utils.NSStack :: NSPop (2)
2002-01-28 08:22:00,110 DEBUG axis.encoding.SerializationContextImpl :: End
element SOAP-ENV:Envelope
2002-01-28 08:22:00,110 DEBUG axis.utils.NSStack :: NSPop (1)
2002-01-28 08:22:00,110 DEBUG apache.axis.Message :: Setting current message
form to: FORM_SOAPENVELOPE (currentMessage is now <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <SOAP-ENV:Body/>
</SOAP-ENV:Envelope>)
2002-01-28 08:22:00,140 DEBUG axis.message.SOAPEnvelope :: Adding body
element to message...
2002-01-28 08:22:00,140 DEBUG axis.client.Call :: Enter:  Call::invoke()
2002-01-28 08:22:00,140 DEBUG apache.axis.Message :: Enter:
SOAPPart::getAsSOAPEnvelope; currentForm is FORM_SOAPENVELOPE
2002-01-28 08:22:00,140 DEBUG apache.axis.MessageContext :: MessageContext:
setTargetService()
2002-01-28 08:22:00,140 DEBUG apache.axis.MessageContext :: MessageContext:
setServiceHandler(null)
2002-01-28 08:22:00,180 DEBUG axis.client.Call :: TargetService:
2002-01-28 08:22:00,180 DEBUG apache.axis.MessageContext :: MessageContext:
setTargetService(null)
2002-01-28 08:22:00,180 DEBUG apache.axis.MessageContext :: MessageContext:
setServiceHandler(null)
2002-01-28 08:22:00,180 DEBUG axis.encoding.SerializationContextImpl ::
register 'SOAP-ENV' - 'http://schemas.xmlsoap.org/soap/envelope/'
2002-01-28 08:22:00,180 DEBUG axis.utils.NSStack :: NSPush (0)
2002-01-28 08:22:00,200 DEBUG axis.encoding.SerializationContextImpl ::
register 'xsd' - 'http://www.w3.org/2001/XMLSchema'
2002-01-28 08:22:00,200 DEBUG axis.encoding.SerializationContextImpl ::
register 'xsi' - 'http://www.w3.org/2001/XMLSchema-instance'
2002-01-28 08:22:00,200 DEBUG axis.encoding.SerializationContextImpl ::
Start element [http://schemas.xmlsoap.org/soap/envelope/]:Envelope
2002-01-28 08:22:00,200 DEBUG axis.utils.NSStack :: NSPush (1)
2002-01-28 08:22:00,251 DEBUG axis.message.SOAPEnvelope :: 0 headers
2002-01-28 08:22:00,251 DEBUG axis.encoding.SerializationContextImpl ::
Start element [http://schemas.xmlsoap.org/soap/envelope/]:Body
2002-01-28 08:22:00,251 DEBUG axis.utils.NSStack :: NSPush (2)
2002-01-28 08:22:00,251 DEBUG axis.encoding.SerializationContextImpl ::
Start element []:Login
2002-01-28 08:22:00,251 DEBUG axis.utils.NSStack :: NSPush (3)
2002-01-28 08:22:00,281 DEBUG axis.client.Call :: <?xml version="1.0"
encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://www.w3.org/2001/06/soap-encoding"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <SOAP-ENV:Body>
  <Loginjava.io.IOException: No serializer found for class
com.wamnet.archive.soapclient.value.User in registry
org.apache.axis.encoding.SerializationContextImpl@c5e9c
	at
org.apache.axis.encoding.SerializationContextImpl.serializeActual(Unknown
Source)
	at
org.apache.axis.encoding.SerializationContextImpl.serialize(Unknown Source)
	at org.apache.axis.message.RPCParam.serialize(Unknown Source)
	at org.apache.axis.message.RPCElement.outputImpl(Unknown Source)
	at org.apache.axis.message.MessageElement.output(Unknown Source)
	at org.apache.axis.message.SOAPEnvelope.outputImpl(Unknown Source)
	at org.apache.axis.message.MessageElement.output(Unknown Source)
	at org.apache.axis.client.Call.invoke(Unknown Source)
	at org.apache.axis.client.Call.invoke(Unknown Source)
	at org.apache.axis.client.Call.invoke(Unknown Source)
	at org.apache.axis.client.Call.invoke(Unknown Source)
	at
com.wamnet.archive.soapclient.ArchiveService.login(ArchiveService.java:135)
	at
com.wamnet.archive.soapclient.ArchiveServiceLoginTEST.testLogin_Invalid(Arch
iveServiceLoginTEST.java:28)
	at java.lang.reflect.Method.invoke(Native Method)
	at junit.framework.TestCase.runTest(TestCase.java:166)
	at junit.framework.TestCase.runBare(TestCase.java:140)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:131)
	at junit.framework.TestSuite.runTest(TestSuite.java:173)
	at junit.framework.TestSuite.run(TestSuite.java:168)
	at junit.framework.TestSuite.runTest(TestSuite.java:173)
	at junit.framework.TestSuite.run(TestSuite.java:168)
	at junit.swingui.TestRunner$17.run(TestRunner.java:644)


Mime
View raw message