I'm using SOAP with Tomcat and have tested a java example code which
subtracts two input parameters. Now I want to use a third input
parameter which should decide which function should be called. (The
subtract function or the addition function).
The problem is that when I use the 'equal to' operator (==) I get this
error message from the compiler:
CalcClient.java:23: operator == cannot be applied to
java.lang.Integer,int
if( p3 == 1 )
^
CalcClient.java:25: operator == cannot be applied to
java.lang.Integer,int
else if( p3 == 2 );
^
2 errors
My code looks like this:
import java.lang.*;
import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
public class CalcClient {
public static void main(String[] args) throws Exception {
URL url = new URL
("http://150.132.6.129:8080/soap/servlet/rpcrouter");
Integer p1 = new Integer(args[0]);
Integer p2 = new Integer(args[1]);
Integer p3 = new Integer(args[3]);
// Build the call.
Call call = new Call();
call.setTargetObjectURI("urn:onjavaserver");
if (p3 == 1)
call.setMethodName("subtract");
if else (p3 == 2)
call.setMethodName("add");
...................
.....................
Did I forget something? If so, please tell me.
Could this problem have something to do with my classpaths or import
files?