Hello,

I am Stefan a Grad student at UNC. I am working on research using Globus
and other grid services platforms. I am kinda stuck with getting the data
from MessageElement array. I have seen this mail:

http://www.mail-archive.com/axis-dev@xml.apache.org/msg09363.html

I have the same problems as the researcher. I see that she has attached a
MessageElementHelper class and that is deleted. I have attached a slice of
code below. Maybe you can give me some ideas how to parse the MessageElement:

MessageElement[] elements = res.get_any();

for( int i = 0; i < elements.length; i++ )
{
    System.out.println("Query result:");

    // an iterator over all attribute names
    java.util.Iterator printIter = elements[i].getAllAttributes();
    int k = 0;
    while( printIter.hasNext( ) )
    {
        Name n = ( Name )printIter.next( );
        k++;
    }
    Attributes att = elements[i].getAttributes( );
    System.out.println( "len = " + att.getLength( ) );
    System.out.println( "k = " + k );
}

Both of the len and k are 1. I have to expand the attribute.

The service data file is:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="BasicSensorData"

targetNamespace="http://www.renci.org/namespaces/2004/Autopilot/BasicSensorService_sd/BasicSensorSDE";

xmlns:tns="http://www.renci.org/namespaces/2004/Autopilot/BasicSensorService_sd/BasicSensorSDE";
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>

<wsdl:types>
<schema
targetNamespace="http://www.renci.org/namespaces/2004/Autopilot/BasicSensorService_sd/BasicSensorSDE";
        attributeFormDefault="qualified"
        elementFormDefault="qualified"
        xmlns="http://www.w3.org/2001/XMLSchema";>

        <complexType name="BasicSensorDataType">
                <sequence>
                        <element name="data" type="int"/>
                        <element name="programName" type="string"/>
                        <element name="managerHost" type="string"/>
                        <element name="value" type="string"/>
                        <element name="dataType" type="string"/>
                        <element name="sensorName" type="string"/>
                </sequence>
        </complexType>

</schema>
</wsdl:types>

</wsdl:definitions>

As you may expect I need the values for all elements (data, programName,
managerHost, value, dataType, sensorName).

Any ideas will be of great help. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to