Client Code for Axis - Newbie Question  
Author Message
daycoder





PostPosted: 12/18/2003 2:11:00 AM Top

java-programmer, Client Code for Axis - Newbie Question Hi,

I'm a first time Axis 1.1 user and trying to figure out how to write
web services client code. I used WSDL2JAVA to create java source from
the wsdl. I ended up with the following files...

xxxx_Port.java
xxxx_Service.java
xxxx_ServiceLocator.java
xxxxBindingStub.java
xxxxRequest.java
xxxxResponse.java

Does anyone have some sample code they can share with me that shows
the basics of how to set up the request and response parameters and
then actually make the call to the web service. Not sure which
classes or methods to use.

Thanks
 
X_AWemner_X





PostPosted: 12/18/2003 4:20:00 PM Top

java-programmer >> Client Code for Axis - Newbie Question http://koti.mbnet.fi/akini/java/axis/

> I'm a first time Axis 1.1 user and trying to figure out how to write
<...clip...>
> Does anyone have some sample code they can share with me that shows
> the basics of how to set up the request and response parameters and
> then actually make the call to the web service. Not sure which
> classes or methods to use.
 
mromarkhan





PostPosted: 4/22/2004 12:12:00 PM Top

java-programmer >> Client Code for Axis - Newbie Question Peace be unto you.

1. Generates files to net/webservicex.www/
java -Djava.ext.dirs=C:\downloads\axis-1_2alpha\lib org.apache.axis.wsdl.WSDL2Java http://www.webservicex.com/geoipservice.asmx?WSDL

2. Call Service
import net.webservicex.www.*;
public class IsCanadian
{
public static void main(String [] args) throws Exception
{
// xxxx_Service service = new xxxx_ServiceLocator
// Make a service <service name="GeoIPService">
GeoIPService service = new GeoIPServiceLocator();

// xxxx_Port port = service.getxxxx_Port();
// Now use the service to get a stub which implements the SDI.
// <port name="GeoIPServiceSoap" binding="s0:GeoIPServiceSoap">
GeoIPServiceSoap port = service.getGeoIPServiceSoap();

// port.xxxx();
// Make the actual call
// Look in GeoIPServiceSoap.java for methods
GeoIP geoip = port.getGeoIP("24.156.146.33");
String countryname = geoip.getCountryName();
if(countryname.equals("Canada"))
{
System.out.println("He's Canadian");
}
else
{
System.out.println("He or she is from "+countryname);
}
}
}

3. Compile Juice
javac -extdirs "C:\downloads\axis-1_2alpha\lib" IsCanadian.java
java -Djava.ext.dirs=C:\downloads\axis-1_2alpha\lib IsCanadian

Have a good day.
 
 
Jason Bell





PostPosted: 4/22/2004 2:45:00 PM Top

java-programmer >> Client Code for Axis - Newbie Question Has it ALL compiled and is it all deployed?
It would be easier if you could actually explain what is going wrong with
your client code/service.

Jase

<email***@***.com> wrote in message
news:WBHhc.5888$email***@***.com...
> Peace be unto you.
>
> 1. Generates files to net/webservicex.www/
> java -Djava.ext.dirs=C:\downloads\axis-1_2alpha\lib
org.apache.axis.wsdl.WSDL2Java
http://www.webservicex.com/geoipservice.asmx?WSDL
>
> 2. Call Service
> import net.webservicex.www.*;
> public class IsCanadian
> {
> public static void main(String [] args) throws Exception
> {
> // xxxx_Service service = new xxxx_ServiceLocator
> // Make a service <service name="GeoIPService">
> GeoIPService service = new GeoIPServiceLocator();
>
> // xxxx_Port port = service.getxxxx_Port();
> // Now use the service to get a stub which implements the SDI.
> // <port name="GeoIPServiceSoap" binding="s0:GeoIPServiceSoap">
> GeoIPServiceSoap port = service.getGeoIPServiceSoap();
>
> // port.xxxx();
> // Make the actual call
> // Look in GeoIPServiceSoap.java for methods
> GeoIP geoip = port.getGeoIP("24.156.146.33");
> String countryname = geoip.getCountryName();
> if(countryname.equals("Canada"))
> {
> System.out.println("He's Canadian");
> }
> else
> {
> System.out.println("He or she is from "+countryname);
> }
> }
> }
>
> 3. Compile Juice
> javac -extdirs "C:\downloads\axis-1_2alpha\lib" IsCanadian.java
> java -Djava.ext.dirs=C:\downloads\axis-1_2alpha\lib IsCanadian
>
> Have a good day.