You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Henry Lu <zh...@med.umich.edu> on 2004/06/11 14:09:51 UTC
axis-2(bata) Doc-literal
Is it a bug? It fialed to runa simple example with doc/literal style.
//my interface:
//////////////////////////////////////////
public interface Echo
{
public String echoString(String arg);
public String echoString_double(String arg1, String arg2);
}
//my interface:
//////////////////////////////////////////
//use following tag to genetate wsdl file
<target name="j2w_compile">
<axis-java2wsdl
bindingname="${SERVICE_CLASS}"
output="${WSDL_FILE}"
location="${HOST_URL}"
typemappingversion="1.2"
style="DOCUMENT"
use="LITERAL"
classname="${INT_CLASS}"
namespace="${NAMESPACE_TAR}"
soapaction="OPERATION"
>
<classpath refid="classpath_int.library" />
</axis-java2wsdl>
</target>
/////////////////////////////////////////
// use thd following tag to generate all java file for both server and
client
<target name="w22j">
<axis-wsdl2java
output="bind/."
deployscope="Session"
skeletondeploy="true"
url="bind/${WSDL_FILE}"
verbose="true"
serverside="true"
typemappingversion="1.2"
>
<mapping
namespace="${NAMESPACE}"
package="${PACKAGE}"
/>
<classpath refid="classpath_bin.library" />
</axis-wsdl2java>
</target>
///////////////////////////////////////////
// my server:
public class EchoImpl implements ws.Echo.Echo{
public java.lang.String echoString(java.lang.String in0) throws
java.rmi.RemoteException {
return in0;
}
public java.lang.String echoString_double(java.lang.String in0,
java.lang.String in1) throws java.rmi.RemoteException {
return in0+in1;
}
}
//////////////////////////////////////////
// my client:
public void do_call() throws Exception
{
Echo srv_port = m_src.getEcho();
String int_x1 = "10";
String int_x2 = "3";
String ret1 = srv_port.echoString(int_x1);
System.out.println("ret1="+ret1);
String ret2 = srv_port.echoString_double(int_x1, int_x2);
System.out.println("ret2="+ret2);
}
public void go() throws Exception
{
m_src = new ClnEchoLocator(m_server_url );
do_call();
}
///////////////////////////////////////////////
//the resut:
[java] ret1=10
[java] ret2=10
It should be:
[java] ret1=10
[java] ret2=103
Why? How to fix?