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 Ushan Adikaram <us...@gmail.com> on 2009/04/29 13:01:18 UTC

java axis web service error

hi,

i hav developed a customer web service. when i try build it gives some
errors. this is my CustomerRPCClient

*CustomerRPCClient :*

package pojo.apache.axis;
>
> import javax.xml.namespace.QName;
>
> import org.apache.axis.AxisFault;
> import org.apache.axis.addressing.EndpointReference;
> import org.apache.axis.client.Options;
> import org.apache.axis.rpc.client.RPCServiceClient;
>
> import pojo.apache.axis.Customer;
>
>
> public class CustomerRPCClient {
>
>     public static void main(String[] args1) throws AxisFault {
>
>         RPCServiceClient serviceClient = new RPCServiceClient();
>
>         Options options = serviceClient.getOptions();
>
>         EndpointReference targetEPR = new EndpointReference("
> http://localhost:8080/axis/services/CustomerService");
>
>         options.setTo(targetEPR);
>
>         // Setting the customer
>         QName opSetCustomer = new QName("http://service.pojo.sample",
> "setCustomer");
>
>         Customer cus = new Customer();
>
>         cus.setCid("AAA");
>         cus.setName("Ushan");
>         cus.setPhone((int)2363765);
>         cus.setAddress((int)111, "Kotta Road", "Borella");
>         cus.setAge((int)25);
>         cus.setBalance((double)25000.00);
>
>         Object[] opSetCustomerArgs = new Object[] { cus };
>
>         serviceClient.invokeRobust(opSetCustomer, opSetCustomerArgs);
>
>
>         // Getting the customer
>         QName opGetCustomer = new QName("http://service.pojo.sample",
> "getCustomer");
>
>         Object[] opGetCustomerArgs = new Object[] { };
>         Class[] returnTypes = new Class[] { Customer.class };
>
>
>         Object[] response = serviceClient.invokeBlocking(opGetCustomer,
>                 opGetCustomerArgs, returnTypes);
>
>         Customer result = (Customer) response[0];
>
>         if (result == null) {
>             System.out.println("Customer didn't initialize!");
>             return;
>         }
>
>         // Displaying the result
>         System.out.println("Customer ID               : " +
> result.getCid());
>         System.out.println("Customer Name             : " +
> result.getName());
>         System.out.println("Phone Number              : " +
> result.getPhone());
>         System.out.println("Address                   : " +
> result.getAddress());
>         System.out.println("Customer's Age            : " +
> result.getAge());
>         System.out.println("Account Balance           : " +
> result.getBalance());
>
>     }
> }
>

*
error :*

C:\Documents and Settings\Ushan Adikaram\Desktop\CS\src>javac -d ..\classes
> pojo
> \apache\axis\CustomerRPCClient.java
> pojo\apache\axis\CustomerRPCClient.java:6: package org.apache.axis does not
> exis
> t
> import org.apache.axis.AxisFault;
>                        ^
> pojo\apache\axis\CustomerRPCClient.java:7: package
> org.apache.axis.addressing do
> es not exist
> import org.apache.axis.addressing.EndpointReference;
>                                   ^
> pojo\apache\axis\CustomerRPCClient.java:8: package org.apache.axis.client
> does n
> ot exist
> import org.apache.axis.client.Options;
>                               ^
> pojo\apache\axis\CustomerRPCClient.java:9: package
> org.apache.axis.rpc.client do
> es not exist
> import org.apache.axis.rpc.client.RPCServiceClient;
>                                   ^
> pojo\apache\axis\CustomerRPCClient.java:16: cannot find symbol
> symbol  : class AxisFault
> location: class pojo.apache.axis.CustomerRPCClient
>     public static void main(String[] args1) throws AxisFault {
>                                                    ^
> pojo\apache\axis\CustomerRPCClient.java:18: cannot find symbol
> symbol  : class RPCServiceClient
> location: class pojo.apache.axis.CustomerRPCClient
>         RPCServiceClient serviceClient = new RPCServiceClient();
>         ^
> pojo\apache\axis\CustomerRPCClient.java:18: cannot find symbol
> symbol  : class RPCServiceClient
> location: class pojo.apache.axis.CustomerRPCClient
>         RPCServiceClient serviceClient = new RPCServiceClient();
>                                              ^
> pojo\apache\axis\CustomerRPCClient.java:20: cannot find symbol
> symbol  : class Options
> location: class pojo.apache.axis.CustomerRPCClient
>         Options options = serviceClient.getOptions();
>         ^
> pojo\apache\axis\CustomerRPCClient.java:22: cannot find symbol
> symbol  : class EndpointReference
> location: class pojo.apache.axis.CustomerRPCClient
>         EndpointReference targetEPR = new EndpointReference("
> http://localhost:80
> 80/axis/services/CustomerService");
>         ^
> pojo\apache\axis\CustomerRPCClient.java:22: cannot find symbol
> symbol  : class EndpointReference
> location: class pojo.apache.axis.CustomerRPCClient
>         EndpointReference targetEPR = new EndpointReference("
> http://localhost:80
> 80/axis/services/CustomerService");
>                                           ^
> pojo\apache\axis\CustomerRPCClient.java:29: cannot find symbol
> symbol  : constructor Customer()
> location: class pojo.apache.axis.Customer
>         Customer cus = new Customer();
>                        ^
> pojo\apache\axis\CustomerRPCClient.java:34:
> setAddress(pojo.apache.axis.Address)
>  in pojo.apache.axis.Customer cannot be applied to (int,java.lang.String,
> java.la
> ng.String)
>         cus.setAddress((int)111, "Kotta Road", "Borella");
>            ^
> 12 errors
>
> C:\Documents and Settings\Ushan Adikaram\Desktop\CS\src>
>

*
how to overcome these errors? thanx in advance.*