We had a similar kind of problem, when parsing the responses which have
declared namespaces in inner elements of the soap body element.

eg.
<ns3:getDetailedMonitoringStag

esResponse xmlns:ns3="http://op_messages.medici_link/xsd";>
            <ns3:return xmlns:ns0="
http://external.communication_data_model.medici_link/xsd"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
xsi:type="ns0:extConfiguration">
        ..................................
               <ns0:abstractParameters
xsi:type="ns0:extAbstractParameterDesc">
        ..................................
               </ns0:abstractParameters>


here  xmlns:ns0="http://external.communication_data_model.medici_link/xsd";
is declared in an inner element.
this is an AXIOM bug and have fixed with the latest AXIOM release.

Please have a look with the RC2 and the latest AXIOM version. or next RC
which will release soon.




On 4/21/07, Jorge Fernandez <[EMAIL PROTECTED]> wrote:

Hi all,


I'm having problems with the namespaces of a response message like this:

 <ns3:getDetailedMonitoringStagesResponse xmlns:ns3="
http://op_messages.medici_link/xsd";>
            <ns3:return xmlns:ns0="
http://external.communication_data_model.medici_link/xsd"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
xsi:type="ns0:extConfiguration">
        ..................................
               <ns0:abstractParameters
xsi:type="ns0:extAbstractParameterDesc">
        ..................................
               </ns0:abstractParameters>
        ..................................
               <ns0:primitiveParameters
xsi:type="ns0:extPrimitiveParameterDesc">
        .................................
               </ns0:primitiveParameters>
        ..................................
            </ns3:return>
         </ns3:getDetailedMonitoringStagesResponse>
      </soapenv:Body>
   </soapenv:Envelope>


I have this exception when parsing the first element
(ns0:abstractParameters):

java.lang.RuntimeException: java.lang.RuntimeException: Unsupported type
null extPrimitiveParameterDesc
    at client.Medici_LinkStub.fromOM(Medici_LinkStub.java:5210)
    at client.Medici_LinkStub.getDetailedMonitoringStages
(Medici_LinkStub.java:1945)
    at client.ClientUtilities.getDetailedMonitoringStagesTest(
ClientUtilities.java:244)
    at client.Client.main(Client.java:53)
Caused by: java.lang.RuntimeException: Unsupported type null
extPrimitiveParameterDesc
    at medici_link.op_messages.xsd.ExtensionMapper.getTypeObject(
ExtensionMapper.java:181)
    at
medici_link.communication_data_model.external.xsd.ExtParameterDesc$Factory.parse(
ExtParameterDesc.java:1171)
    at
medici_link.communication_data_model.external.xsd.ExtAbstractParameterDesc$Factory.parse(
ExtAbstractParameterDesc.java:1311)
    at
medici_link.communication_data_model.external.xsd.ExtConfiguration$Factory.parse(
ExtConfiguration.java:923)
    at
medici_link.communication_data_model.external.xsd.ExtStage$Factory.parse(
ExtStage.java:650)
    at
medici_link.op_messages.xsd.GetDetailedMonitoringStagesResponse$Factory.parse(
GetDetailedMonitoringStagesResponse.java:424)
    at client.Medici_LinkStub.fromOM(Medici_LinkStub.java:4833)
    ... 3 more

I have a hierachy of classes:

ExtAbstractParameterDesc and ExtPrimitiveParameterDesc that extend
ExtParameterDesc.

I've been diving in my code that was created with WSDL2Java and ADB (Axis
1.1.1) and I could see that for that element, it enters
the parse Method of ExtAbstractParameterDesc, then it reaches this:

 if ("true".equals(reader.getAttributeValue("
http://www.w3.org/2001/XMLSchema-instance","nil";))){
    list9.add(null);
    reader.next();
} else {
    list9.add
(medici_link.communication_data_model.external.xsd.ExtParameterDesc.Factory.parse(reader));
}

And goes to the else statement. So it enters the parse method of
ExtParameterDesc (it's father class).

When it's inside that method, variable type gets the value
"ExtPrimitiveParameterDesc" (I don't know if it should be
ExtAbstractParameterDesc but I made that change and it threw an exception
in other place) and finally it tries to get the namespace uri of prefix ns0
and it gets null.
this is the snippet:

java.lang.String type = fullTypeName.substring(fullTypeName.indexOf
(":")+1);
if (!"extParameterDesc".equals(type)){
    //find namespace for the prefix
    java.lang.String nsUri = reader.getNamespaceContext
().getNamespaceURI("ns0");
    nsUri="http://external.communication_data_model.medici_link/xsd";;
    return
(ExtParameterDesc)medici_link.op_messages.xsd.ExtensionMapper.getTypeObject(nsUri,type,reader);
}


As you can see in the message, it is "
http://external.communication_data_model.medici_link/xsd";. So the
exception is thrown because it can't get de typeObject.

I added the line nsUri="
http://external.communication_data_model.medici_link/xsd";; just before
getTypeObject is called and it works.

With XMLBeans, it works perfectly.

Regards,

Jorge Fernández

------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com<http://us.rd.yahoo.com/mail/es/tagline/messenger/*http://es.voice.yahoo.com/>




--
Amila Suriarachchi,
WSO2 Inc.

Reply via email to