call.addParameter("emp_no", XMLType.XSD_INT,ParameterMode.PARAM_MODE_IN);
call.addParameter("op2", XMLType.XSD_INT, ParameterMode.PARAM_MODE_IN);
These two statements has some errors.The constants variable in class
ParameterMode are IN,OUT,and INOUT.You can go through ParameterMode's API.
Best Regards,
Robert Zhang
Email:[EMAIL PROTECTED]
Tel:86-010-62014411-2437
Content-Type: multipart/alternative;
boundary="0-1222714899-1120562803=:54008"
--0-1222714899-1120562803=:54008
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 8bit
hi
I deployed a java class as web service in apache axis and tried calling it
using a client code. But i encountered some problem which i have listed after
the code.
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import javax.xml.rpc.ParameterMode;
public class client {
public static void main(String [] args) throws Exception {
Options options = new Options(args);
String endpoint = "http://localhost:" + options.getPort() +
"/axis/employee.jws";
// Do argument checking
args = options.getRemainingArgs();
if (args == null || args.length != 3) {
System.err.println("Usage: CalcClient <add|subtract arg1 arg2");
return;
}
String method = args[0];
//if (!(method.equals("add") || method.equals("subtract"))) {
// System.err.println("Usage: CalcClient <add|subtract arg1 arg2");
// return;
//}
// Make the call
Integer i1 = new Integer(args[1]);
Integer i2 = new Integer(args[2]);
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName( method );
call.addParameter("emp_no", XMLType.XSD_INT,ParameterMode.PARAM_MODE_IN);
call.addParameter("op2", XMLType.XSD_INT, ParameterMode.PARAM_MODE_IN);
Integer ret = (Integer) call.invoke( new Object [] { i1, i2 });
//System.out.println("Got result : " + ret);
}
}
when i compile the code i get the error that the "PARAM_MODE_IN symbol can be
resolved"
since i am new to Web services and software oriented architecture, i have no
clue to this error. Can someone help me put in this.
bye
deepak
---------------------------------
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
--0-1222714899-1120562803=:54008
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: 8bit
<DIV>
<DIV>
<DIV>hi</DIV>
<DIV> </DIV>
<DIV>I deployed a java class as web service in apache axis and tried calling it
using a client code. But i encountered some problem which i have listed
after the code.</DIV>
<DIV> </DIV>
<DIV> import org.apache.axis.client.Call;<BR>import
org.apache.axis.client.Service;<BR>import
org.apache.axis.encoding.XMLType;<BR>import org.apache.axis.utils.Options;</DIV>
<DIV>import javax.xml.rpc.ParameterMode;</DIV>
<DIV>public class client {<BR> public static void main(String []
args) throws Exception {<BR> Options
options = new Options(args);</DIV>
<DIV> String endpoint = "<A
href="http://localhost/" target=_blank><FONT
color=#003399>http://localhost</FONT></A>:" + options.getPort()
+<BR>
"/axis/employee.jws";</DIV>
<DIV>// Do argument checking<BR> args =
options.getRemainingArgs();</DIV>
<DIV> if (args == null || args.length != 3)
{<BR>
System.err.println("Usage: CalcClient <add|subtract arg1
arg2");<BR>
return;<BR> }</DIV>
<DIV> String method =
args[0];<BR> //if (!(method.equals("add")
|| method.equals("subtract"))) {<BR>
// System.err.println("Usage: CalcClient <add|subtract arg1
arg2");<BR> //
return;<BR> //}</DIV>
<DIV>// Make the call<BR> Integer i1 = new
Integer(args[1]);<BR> Integer i2 = new
Integer(args[2]);</DIV>
<DIV> Service service = new
Service();<BR> Call
call = (Call) service.createCall();</DIV>
<DIV> call.setTargetEndpointAddress(new
java.net.URL(endpoint));<BR>
call.setOperationName( method );<BR>
call.addParameter("emp_no",
XMLType.XSD_INT,ParameterMode.PARAM_MODE_IN);<BR>
call.addParameter("op2", XMLType.XSD_INT, ParameterMode.PARAM_MODE_IN);</DIV>
<DIV> Integer ret = (Integer) call.invoke(
new Object [] { i1, i2 });</DIV>
<DIV> //System.out.println("Got result : "
+ ret);</DIV>
<DIV> }</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>when i compile the code i get the error that the "PARAM_MODE_IN symbol can
be resolved"</DIV>
<DIV> </DIV>
<DIV>since i am new to Web services and software oriented architecture, i have
no clue to this error. Can someone help me put in this.</DIV>
<DIV> </DIV>
<DIV>bye</DIV>
<DIV>deepak</DIV></DIV></DIV><p>
<hr size=1>Yahoo! Sports<br>
<a
href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt3539/*http://football.fantasysports.yahoo.com?ovchn=YAH&ovcpn=Integration&ovcrn=Mail+footer&ovrfd=YAH&ovtac
">Rekindle the Rivalries. Sign up for Fantasy Football</a>
--0-1222714899-1120562803=:54008--