[prev in list] [next in list] [prev in thread] [next in thread]
List: axis-user
Subject: java axis web service error
From: Ushan Adikaram <ushan.unltd.online () gmail ! com>
Date: 2009-04-29 11:13:18
Message-ID: a68f59060904290401y68401923g2a6467741f1ba1f1 () mail ! gmail ! com
[Download RAW message or body]
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.*
[Attachment #3 (text/html)]
hi,<br><br>i hav developed a customer web service. when i try build it gives some \
errors. this is my CustomerRPCClient<br><br><b>CustomerRPCClient \
:</b><br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: \
0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"> package \
pojo.apache.axis;<br><br>import javax.xml.namespace.QName;<br><br>import \
org.apache.axis.AxisFault;<br>import \
org.apache.axis.addressing.EndpointReference;<br>import \
org.apache.axis.client.Options;<br>import \
org.apache.axis.rpc.client.RPCServiceClient;<br> <br>import \
pojo.apache.axis.Customer;<br><br><br>public class CustomerRPCClient {<br><br> \
public static void main(String[] args1) throws AxisFault {<br><br> \
RPCServiceClient serviceClient = new RPCServiceClient();<br> <br> Options \
options = serviceClient.getOptions();<br><br> EndpointReference targetEPR = \
new EndpointReference("<a \
href="http://localhost:8080/axis/services/CustomerService">http://localhost:8080/axis/services/CustomerService</a>");<br>
<br> options.setTo(targetEPR);<br><br> // Setting the customer<br> \
QName opSetCustomer = new QName("<a \
href="http://service.pojo.sample">http://service.pojo.sample</a>", \
"setCustomer");<br> <br> Customer cus = new Customer();<br><br> \
cus.setCid("AAA");<br> cus.setName("Ushan");<br> \
cus.setPhone((int)2363765);<br> cus.setAddress((int)111, "Kotta \
Road", "Borella");<br> cus.setAge((int)25);<br> \
cus.setBalance((double)25000.00);<br><br> Object[] opSetCustomerArgs = new \
Object[] { cus };<br><br> serviceClient.invokeRobust(opSetCustomer, \
opSetCustomerArgs);<br><br> <br> // Getting the customer<br> QName \
opGetCustomer = new QName("<a \
href="http://service.pojo.sample">http://service.pojo.sample</a>", \
"getCustomer");<br><br> Object[] opGetCustomerArgs = new Object[] { \
};<br> Class[] returnTypes = new Class[] { Customer.class };<br> <br> \
<br> Object[] response = serviceClient.invokeBlocking(opGetCustomer,<br> \
opGetCustomerArgs, returnTypes);<br> <br> Customer result = (Customer) \
response[0];<br> <br> if (result == null) {<br> \
System.out.println("Customer didn't initialize!");<br> \
return;<br> }<br> <br> // Displaying the result<br> \
System.out.println("Customer ID : " + result.getCid());<br> \
System.out.println("Customer Name : " + result.getName());<br> \
System.out.println("Phone Number : " + result.getPhone());<br> \
System.out.println("Address : " + \
result.getAddress());<br> System.out.println("Customer's Age \
: " + result.getAge());<br> System.out.println("Account Balance \
: " + result.getBalance());<br> <br> }<br>}<br></blockquote><br><b><br>error \
:</b><br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: \
0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">C:\Documents and \
Settings\Ushan Adikaram\Desktop\CS\src>javac -d ..\classes pojo<br> \
\apache\axis\CustomerRPCClient.java<br>pojo\apache\axis\CustomerRPCClient.java:6: \
package org.apache.axis does not exis<br>t<br>import org.apache.axis.AxisFault;<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:7: package org.apache.axis.addressing \
do<br> es not exist<br>import org.apache.axis.addressing.EndpointReference;<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:8: package org.apache.axis.client does \
n<br>ot exist<br>import org.apache.axis.client.Options;<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:9: package org.apache.axis.rpc.client \
do<br>es not exist<br>import org.apache.axis.rpc.client.RPCServiceClient;<br> \
^<br> pojo\apache\axis\CustomerRPCClient.java:16: cannot find symbol<br>symbol : \
class AxisFault<br>location: class pojo.apache.axis.CustomerRPCClient<br> public \
static void main(String[] args1) throws AxisFault {<br> \
^<br> pojo\apache\axis\CustomerRPCClient.java:18: cannot find symbol<br>symbol : \
class RPCServiceClient<br>location: class pojo.apache.axis.CustomerRPCClient<br> \
RPCServiceClient serviceClient = new RPCServiceClient();<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:18: cannot find symbol<br>symbol : \
class RPCServiceClient<br>location: class pojo.apache.axis.CustomerRPCClient<br> \
RPCServiceClient serviceClient = new RPCServiceClient();<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:20: cannot find symbol<br>symbol : \
class Options<br>location: class pojo.apache.axis.CustomerRPCClient<br> \
Options options = serviceClient.getOptions();<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:22: cannot find symbol<br>symbol : \
class EndpointReference<br>location: class pojo.apache.axis.CustomerRPCClient<br> \
EndpointReference targetEPR = new EndpointReference("<a \
href="http://localhost:80">http://localhost:80</a><br> \
80/axis/services/CustomerService");<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:22: cannot find symbol<br>symbol : \
class EndpointReference<br>location: class pojo.apache.axis.CustomerRPCClient<br> \
EndpointReference targetEPR = new EndpointReference("<a \
href="http://localhost:80">http://localhost:80</a><br> \
80/axis/services/CustomerService");<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:29: cannot find symbol<br>symbol : \
constructor Customer()<br>location: class pojo.apache.axis.Customer<br> Customer cus \
= new Customer();<br> \
^<br>pojo\apache\axis\CustomerRPCClient.java:34: \
setAddress(pojo.apache.axis.Address)<br> in pojo.apache.axis.Customer cannot be \
applied to (int,java.lang.String,<a href="http://java.la">java.la</a><br> \
ng.String)<br> cus.setAddress((int)111, "Kotta Road", \
"Borella");<br> ^<br>12 errors<br><br>C:\Documents and \
Settings\Ushan Adikaram\Desktop\CS\src><br></blockquote><br><b><br>how to overcome \
these errors? thanx in advance.</b><br>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic