The Artima Developer Community
Sponsored Link

Web Services Forum
Trouble with Axis and a simple web service.

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tom Sneyers

Posts: 1
Nickname: tsneyers
Registered: Feb, 2006

Trouble with Axis and a simple web service. Posted: Feb 21, 2006 3:58 AM
Reply to this message Reply
Advertisement
Hi all

I am experiencing some troubles with a small Java class that I want to put online as a web service.



public class KlantService {

private Klant [] klanten = new Klant[4];

public String getKlantById(int id) {

String uitvoer = "--";

klanten[0] = new Klant(1, "Tom");
klanten[1] = new Klant(2, "Bert");
klanten[2] = new Klant(3, "Flip");
klanten[3] = new Klant(4, "Flap");

for(int i=0; i<klanten.length; i++) {
Klant k = (Klant) klanten[i];
if(k.getId() == id) {
uitvoer = k.getNaam();
}
}

return uitvoer;
}


class Klant {

private int id;
private String naam;

public Klant(int id, String naam) {
this.id = id;
this.naam = naam;
}

public void setId(int id) {
this.id = id;
}
public void setNaam(String naam) {
this.naam = naam;
}

public int getId() {
return id;
}
public String getNaam() {
return naam;
}

}

}


My wsdd is the following:

<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="KlantService" provider="java:RPC">
<parameter name="className" value="KlantService"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>


There are no errors, but when I want to call the service, I get no returnvalue. I do get one if I just run the class as a Java program.

Thanks in advance, Tom Sneyers

Topic: How to install Tomcat and how to run serlvets in tomcat Previous Topic   Next Topic Topic: RSS and content syndication survey

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use