Hello all.

I developed a web service application using Apache Tomcat 5.5.26, Axis
1.4 and Eclipse IDE. I am running the application in two machines (PC1
and PC2). When I call the web service operation (which is in PC2) from PC1, it 
works fine. After that I did another web service called alert which is in PC1. 
This alert service performs some stuff and at the end calls the web service 
operation in PC2, which were working. Then I called alert from PC2, but at this 
moment the server application throws an exception in PC2 when it is trying to 
get the ServiceFactory:

java.lang.ClassCastException: org.apache.axis.client.ServiceFactory
at javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:63)

When I call only operation from PC1, I start the execution
from Eclipse IDE, despite the application is deployed in Apache Tomcat
on both machines. But when I call alert from PC2, and consequently it calls 
operation from PC2, the later is executed from the code deployed.

Here is the code that calls operation:


import org.apache.axis.client.ServiceFactory;

//Some stuff

private String callOperation(String namespace, String portName, String 
serviceName,
                         String opName, String wsdl, String conf) {
                 QName qServiceName = new QName(namespace, serviceName);
 
                 QName qPortName = new QName(namespace, portName);
 
                 QName operationName = new QName(namespace, opName);
 
                 URL wsdlLocation;
try {
                         wsdlLocation = new URL(wsdl);
                         System.setProperty( "javax.xml.rpc.ServiceFactory",
"org.apache.axis.client.ServiceFactory");

                         ServiceFactory factory = (ServiceFactory) 
ServiceFactory.newInstance();
                         javax.xml.rpc.Service serviceRPC = 
factory.createService(wsdlLocation, qServiceName);
 
                         Call call = serviceRPC.createCall(qPortName, 
operationName);
                         result = (String) call.invoke(new Object[] {conf, 
fileName});
 
} catch (Exception e) {
                         e.printStackTrace();
}
return result;
} 

The line which throws the exception is ServiceFactory factory = 
(ServiceFactory) ServiceFactory.newInstance();

Does anyone have any idea.

Thanks
Fernando.



      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua 
cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to