You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/09/18 10:07:26 UTC
DO NOT REPLY [Bug 12758] New: -
Deserialization of complex classes throws SAXException
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12758>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12758
Deserialization of complex classes throws SAXException
Summary: Deserialization of complex classes throws SAXException
Product: Axis
Version: current (nightly)
Platform: PC
OS/Version: Linux
Status: NEW
Severity: Normal
Priority: Other
Component: Serialization/Deserialization
AssignedTo: axis-dev@xml.apache.org
ReportedBy: nbrennan@touchcorp.com
I'm using what I believe to be the latest version of AXIS on Linux (I
downloaded "xml-axis-rc1-bin.zip" yesterday - 16 Sept 02) and trying to talk to
a Borland SOAP server with 5 different services.
I used WSDL2Java to generate all the classes I need from the following service:
http://tims.moveyourselftrailer.com.au:8000/scripts/SackTruck.dll/wsdl/ISackTruc
k
I used this snippet of code to try and access the simplest of the ports, just
as worked previously for another service on the same server:
ISackTruckservice locator = new ISackTruckserviceLocator();
ISackTruck client = locator.getISackTruckPort();
Object fees = client.getSackTruckFees();
And got:
org.xml.sax.SAXException: operation description is missing parameter
description!
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:220)
at org.apache.axis.encoding.DeserializationContextImpl.startElement
(DeserializationContextImpl.java:883)
at org.apache.axis.message.SAX2EventRecorder.replay
(SAX2EventRecorder.java:158)
at org.apache.axis.message.MessageElement.publishToHandler
(MessageElement.java:681)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:244)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:268)
at org.apache.axis.client.Call.invoke(Call.java:1862)
at org.apache.axis.client.Call.invoke(Call.java:1768)
at org.apache.axis.client.Call.invoke(Call.java:1306)
at com.touchcorp.soap.isacktruck.ISackTruckbindingStub.getSackTruckFees
(ISackTruckbindingStub.java:228)
at com.touchcorp.remote.party.ISackTruckService.getSackTruckFees
(ISackTruckService.java:96)
at com.touchcorp.remote.party.ISackTruckService.main
(ISackTruckService.java:133)
[ERROR] Call - -Exception: <org.xml.sax.SAXException: operation description is
missing parameter description!>
Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: org.xml.sax.SAXException: operation description is missing
parameter description!
faultActor: null
faultDetail:
stackTrace: org.xml.sax.SAXException: operation description is missing
parameter description!
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:220)
at org.apache.axis.encoding.DeserializationContextImpl.startElement
(DeserializationContextImpl.java:883)
at org.apache.axis.message.SAX2EventRecorder.replay
(SAX2EventRecorder.java:158)
at org.apache.axis.message.MessageElement.publishToHandler
(MessageElement.java:681)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:244)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:268)
at org.apache.axis.client.Call.invoke(Call.java:1862)
at org.apache.axis.client.Call.invoke(Call.java:1768)
at org.apache.axis.client.Call.invoke(Call.java:1306)
at com.touchcorp.soap.isacktruck.ISackTruckbindingStub.getSackTruckFees
(ISackTruckbindingStub.java:228)
at com.touchcorp.remote.party.ISackTruckService.getSackTruckFees
(ISackTruckService.java:96)
at com.touchcorp.remote.party.ISackTruckService.main
(ISackTruckService.java:133)
org.xml.sax.SAXException: operation description is missing parameter
description!
org.xml.sax.SAXException: operation description is missing parameter
description!
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:220)
at org.apache.axis.encoding.DeserializationContextImpl.startElement
(DeserializationContextImpl.java:883)
at org.apache.axis.message.SAX2EventRecorder.replay
(SAX2EventRecorder.java:158)
at org.apache.axis.message.MessageElement.publishToHandler
(MessageElement.java:681)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:244)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:268)
at org.apache.axis.client.Call.invoke(Call.java:1862)
at org.apache.axis.client.Call.invoke(Call.java:1768)
at org.apache.axis.client.Call.invoke(Call.java:1306)
at com.touchcorp.soap.isacktruck.ISackTruckbindingStub.getSackTruckFees
(ISackTruckbindingStub.java:228)
at com.touchcorp.remote.party.ISackTruckService.getSackTruckFees
(ISackTruckService.java:96)
at com.touchcorp.remote.party.ISackTruckService.main
(ISackTruckService.java:133)
But, if I go back and use Apache SOAP directly, everything seems to work just
fine. I am *not* using an operation style of "rpc" when I call via SOAP
directly. My code looks more like this:
URL url = new URL(locator.getISackTruckPortAddress());
String uri = "urn:uSackTruckFee";
String method = "getSackTruckFees";
Class type = com.touchcorp.soap.isacktruck.TSackTruckFeeInfo.class;
Vector args = new Vector();
// get short version of type class name
String typeName = type.getName();
int index = typeName.lastIndexOf(".");
if (index > 0)
typeName = typeName.substring(index+1);
// set up bean mappings
SOAPMappingRegistry registry = new SOAPMappingRegistry();
BeanSerializer serializer = new BeanSerializer();
registry.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(uri, typeName),
type, serializer, serializer);
// build the call
Call call = new Call();
call.setSOAPMappingRegistry(registry);
call.setTargetObjectURI(uri);
call.setMethodName(method);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setParams(args);
// make the call
Response response = call.invoke(url, "");
Help!
I have attached some of the relevant WSDL2Java-generated code below. This is
the most common error I am seeing with AXIS, and I get it with almost every
method of this service I try.
--------------------------------------------------------------------------------
----------------------------------------------------------------------------
============================
from ISackTruckbindingStub.java:
============================
public com.touchcorp.soap.isacktruck.TSackTruckFeeInfo getSackTruckFees()
throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setReturnType(new javax.xml.namespace.QName
("urn:uSackTruckFee", "TSackTruckFeeInfo"),
com.touchcorp.soap.isacktruck.TSackTruckFeeInfo.class);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("urn:uSackTruckIntf-
ISackTruck#getSackTruckFees");
_call.setOperationStyle("rpc");
_call.setOperationName(new javax.xml.namespace.QName
("urn:uSackTruckIntf-ISackTruck", "getSackTruckFees"));
java.lang.Object _resp = _call.invoke(new java.lang.Object[] {});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
try {
return (com.touchcorp.soap.isacktruck.TSackTruckFeeInfo) _resp;
} catch (java.lang.Exception _exception) {
return (com.touchcorp.soap.isacktruck.TSackTruckFeeInfo)
org.apache.axis.utils.JavaUtils.convert(_resp,
com.touchcorp.soap.isacktruck.TSackTruckFeeInfo.class);
}
}
}
============================
from TSackTruckFeeInfo.java:
============================
/**
* TSackTruckFeeInfo.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package com.touchcorp.soap.isacktruck;
public class TSackTruckFeeInfo implements java.io.Serializable {
private double deposit;
private double hireFee;
public TSackTruckFeeInfo() {
}
public double getDeposit() {
return deposit;
}
public void setDeposit(double deposit) {
this.deposit = deposit;
}
public double getHireFee() {
return hireFee;
}
public void setHireFee(double hireFee) {
this.hireFee = hireFee;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof TSackTruckFeeInfo)) return false;
TSackTruckFeeInfo other = (TSackTruckFeeInfo) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
deposit == other.getDeposit() &&
hireFee == other.getHireFee();
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
_hashCode += new Double(getDeposit()).hashCode();
_hashCode += new Double(getHireFee()).hashCode();
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(TSackTruckFeeInfo.class);
static {
org.apache.axis.description.FieldDesc field = new
org.apache.axis.description.ElementDesc();
field.setFieldName("deposit");
field.setXmlName(new javax.xml.namespace.QName("", "Deposit"));
typeDesc.addFieldDesc(field);
field = new org.apache.axis.description.ElementDesc();
field.setFieldName("hireFee");
field.setXmlName(new javax.xml.namespace.QName("", "HireFee"));
typeDesc.addFieldDesc(field);
};
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}