Hi, I have a java web app running in Tomcat 5, I want to start calling webservices written in ASP .NET from the Java application.
What do I need (Do I need to install AXIS or SOAP ) ? and How do I do it ( and if you have a simple example) ?.
I have never done any webservices before...
Thanks in advance
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
1
posted
0
If the webservice you need to call is SOAP based and has a WSDL (Web Services Descriptive Langauge) document, you should be able to create a Java client with the AXIS2 toolkit. In theory, the language used to write the service should make no difference.
Wikipedia has a convenient summary of the role of WSDL.
Thanks Bill.. This is what I did and failed ( It won't even get to the first line in the try block) , can you please suggest anything? Thanks so much..
1. I downloaded Axis into my tomcat/webapps/axis 2. set my classpath as C:\axis\axis-1_4\lib\axis.jar;C:\axis\axis-1_4\lib\axis-ant.jar;C:\axis\axis-1_4\lib\commons-discovery-0.2.jar;C:\axis\axis-1_4\lib\commons-logging-1.0.4.jar;C:\axis\axis-1_4\lib\jaxrpc.jar;C:\axis\axis-1_4\lib\saaj.jar;C:\axis\axis-1_4\lib\wsdl4j-1.5.1.jar;
3. Went through check list for proper installation and confirmed that I have all required classes found..
Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName("TestMath"); Integer i1 = new Integer(5); Integer i2 = new Integer(9);
Integer ret = (Integer) call.invoke( new Object[] { i1, i2 } ); retString = ret.toString(); } catch (Exception e) { message.info("Exception in trying to getTestmath is :" + e); } return retString;
} //end of local method } // end of class
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
1
posted
0
failed ( It won't even get to the first line in the try block) , can you please suggest anything?
No - Because you dont say what actually happened!
If you never got to the start of the try, how do you know getTestMath() was even called.
Elias Ta
Greenhorn
Joined: Sep 29, 2008
Posts: 15
posted
0
Okay please help me with how to build a client for a webservice.. This is where I am 1. I downloaded Axis2 and went through with samples being able to deploy the services bla bla.. I didn't do anything but to follow the steps 2. I can't seem to understand building the client. They have five ways of doing it but I don't know what they are talking about..
I'd start by pointing Axis' wsdl2java tool at the WSDL of the web service you've deployed. That will create a number of Java classes that can be used to build a client. The Axis Quick Start Guide talks about how to use the tool.