OK. I have changed my response to contain a complex data type and upgraded
everything to Axis 1.1 RC1. My call now looks like
--------------------------
try
{
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:remote-adap", "AdapterInfo" );
call.registerTypeMapping(AdapterInfo.class,
qn,
new
org.apache.axis.encoding.ser.BeanSerializerFactory(AdapterInfo.class, qn),
new
org.apache.axis.encoding.ser.BeanDeserializerFactory(AdapterInfo.class,
qn));
call.setTargetEndpointAddress(ServerUrl);
call.setOperationName(new QName("urn:remote-adap",
"GetAdapterInfo") );
call.addParameter("Adapter",
org.apache.axis.Constants.XSD_INT,
javax.xml.rpc.ParameterMode.IN);
call.setReturnType(qn);
Object ret = call.invoke( new Object[] { new Integer(AdapterID) } );
System.out.println("invoke ret type=" + ret.getClass());
System.out.println("invoke ret=" + ret.toString());
}
catch (javax.xml.rpc.ServiceException se)
{
System.err.println("Caught ServiceException:" + se.getMessage());
return output;
}
catch (java.rmi.RemoteException re)
{
System.err.println("Caught RemoteException:" + re.getMessage());
return output;
}
-----------------------------------
and the data flow is
==== Request ====
POST / HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1RC1
Host: 192.168.1.100
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 462
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:GetAdapterInfo
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:remote-adap">
<Adapter xsi:type="xsd:int">1</Adapter>
</ns1:GetAdapterInfo>
</soapenv:Body>
</soapenv:Envelope>
==== Response ====
HTTP/1.0 200 OK
Server: gSOAP/2.2
Content-Type: text/xml; charset=utf-8
Content-Length: 1581
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="urn:remote-adap">
<SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ns1:GetAdapInfoResponse>
<AdapterInfo xsi:type="ns1:AdapterInfo">
<IoctlError xsi:type="xsd:int">0</IoctlError>
<QueryError xsi:type="xsd:int">0</QueryError>
<AdapterID xsi:type="xsd:int">1</AdapterID>
<MemBase xsi:type="xsd:int">-335544320</MemBase>
<IoBase xsi:type="xsd:int">-144719872</IoBase>
</AdapterInfo>
</ns1:GetAdapInfoResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
==============
But when I run this I get a SAX exception saying
- Exception:
org.xml.sax.SAXException: Invalid element in AdapterInfo - IoctlError
at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.
java:260)
at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deserializa
tionContextImpl.java:921)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
699)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:224)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:331)
at org.apache.axis.client.Call.invoke(Call.java:2200)
at org.apache.axis.client.Call.invoke(Call.java:2099)
at org.apache.axis.client.Call.invoke(Call.java:1622)
but IoctlError IS in the AdapterInfo class.
Any suggestions?
-----Original Message-----
From: Scott Nichol [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 6:11 PM
To: [EMAIL PROTECTED]
Subject: RE: Response Data Mapping Problems
The <ns:GetAdapInfoResponse> element is *not* part of the XML you can
map. You can only map elements within that one, i.e. that element
delimits the response "parameters". It is *not* part of the
"parameters" themselves.