[prev in list] [next in list] [prev in thread] [next in thread]
List: soap-user
Subject: Nested Classes for Java Beans
From: "Doug Haigh" <dhaigh () gatorzone ! com>
Date: 2003-03-07 17:44:50
[Download RAW message or body]
I have a class that does all soap that looks like
=======================================
public class SoapMgr
{
public int GetInfo()
{
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:remote-adap", "NumAdaptersInfo" );
call.registerTypeMapping(InfoBean.class,
qn,
new
org.apache.axis.encoding.ser.BeanSerializerFactory(InfoBean.class, qn),
new
org.apache.axis.encoding.ser.BeanDeserializerFactory(InfoBean.class, qn));
call.setTargetEndpointAddress(serverUrl);
call.setOperationName(new QName("urn:remote-adap",
"GetNumAdapters") );
call.setReturnType(qn);
InfoBean ai = (InfoBean)call.invoke(new Object[]{} );
...
}
catch (javax.xml.rpc.ServiceException se)
{
System.err.println("Caught ServiceException:" + se.getMessage());
}
catch (java.rmi.RemoteException re)
{
System.err.println("Caught RemoteException:" + re.getMessage());
}
}
public class InfoBean() implements Serializable
{
public InfoBean()
{
}
...
}
}
==========================
but the call fails because it says the InfoBean does not have a public
constructor (which it does). Does Axis not support nested classes to be used
as deserializers?
Doug
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New" size=2>I have a
class that does all soap that looks like</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2>=======================================</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New" size=2>public class
SoapMgr</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2>{</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New" size=2>
public int GetInfo()</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New" size=2>
{</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2> Service service = new
Service();<BR> Call
call = (Call)
service.createCall();<BR> QName
qn = new QName( "urn:remote-adap",
"NumAdaptersInfo" );</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2>
call.registerTypeMapping(InfoBean.class,<BR> \
\
qn,<BR> \
\
new org.apache.axis.encoding.ser.BeanSerializerFactory(InfoBean.class,
qn),<BR> \
\
new org.apache.axis.encoding.ser.BeanDeserializerFactory(InfoBean.class,
qn));</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2>
call.setTargetEndpointAddress(serverUrl);<BR>
call.setOperationName(new QName("urn:remote-adap", "GetNumAdapters")
);</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2>
call.setReturnType(qn);</FONT></SPAN></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2> InfoBean ai = (InfoBean)call.invoke(new
Object[]{} );</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT
face="Courier New"> ...</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2> }<BR> catch
(javax.xml.rpc.ServiceException se)<BR>
{<BR> System.err.println("Caught
ServiceException:" + se.getMessage());<BR>
}<BR> catch (java.rmi.RemoteException
re)<BR> {<BR>
System.err.println("Caught RemoteException:" +
re.getMessage());<BR> }<BR></FONT></SPAN><SPAN
class=812513817-07032003><FONT face="Courier New" size=2>
}</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New" size=2>
public class InfoBean() implements Serializable</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New" size=2>
{</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2> public InfoBean()</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2> {</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2> }</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2> ...</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New" size=2>
}</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2>}</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2>==========================</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New" size=2>but the call
fails because it says the InfoBean does not have a public constructor
(which it does). Does Axis not support nested classes to be used as
deserializers?</FONT></SPAN></DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=812513817-07032003><FONT face="Courier New"
size=2>Doug</FONT></SPAN></DIV></BODY></HTML>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic