Ich versuche mir aktuell das Erstellen von WebService beizubringen, leider scheitert es schon daran, dass ich es nicht mal schaffe die grundlegenden Tutorials: http://www.se.uni-hannover.de/pages/de:tutorials_webservice_guestbook_jax_ws abzuschließen, da entweder zu viel übersprungen wird oder es nicht so funktioniert wie im Tutorial angegeben. Aktuell stecke ich bei der Implementierung der Methoden im WebService fest.
Ich habe die Implementierungklasse:
HIer erhalte ich bei "public de.unihannover.se.soa10.guestbook.schema.GuestBook getEntries" Die Fehlermedung: "The return type is incompatible with GuestBook.getEntries(String)", ob wohl dieser in der GuestBook Klasse so definiert ist:
Bei "public class GuestBookImpl implements GuestBook" bekomme ich die Fehlermeldung: "The type GuestBookImpl must implement the inherited abstract method GuestBook.insertEntrys(GuestBookEntry)" Die Methode ist allerdings implementiert.
Und drittens bekomme ich bei "public void insertEntry(GuestBookEntry entry)" eine Fehlermedlung mit "The method insertEntry(GuestBookEntry) of type GuestBookImpl must override or implement a supertype method". Und da weiß ich nicht, ob es wirklich reicht, dass Override zu entfernen.
Kennt sich zufällig jemand mit diesem Tutorial aus und weiß, wo der Fehler stecken könnte?
Ich habe die Implementierungklasse:
Java:
package de.unihannover.se.soa10.guestbook.service;
import javax.jws.WebService;
import de.unihannover.se.soa10.guestbook.schema.GuestBookEntry;
@WebService(name = "GuestBook",
serviceName = "GuestBook",
portName = "GuestBookSOAP",
targetNamespace = "http://soa10.se.unihannover.de/GuestBook/Service",
endpointInterface = "de.unihannover.se.soa10.guestbook.service.GuestBook")
public class GuestBookImpl implements GuestBook {
private de.unihannover.se.soa10.guestbook.schema.GuestBook guestBook;
public GuestBookImpl() {
super();
this.guestBook = new de.unihannover.se.soa10.guestbook.schema.GuestBook();
}
@Override
public de.unihannover.se.soa10.guestbook.schema.GuestBook getEntries(
String parameters) {
System.out.println("DEBUG Info: GuestBook webservice: "
+ "getEntries (parameter = \""
+ parameters + "\") called...");
return this.guestBook;
}
public void insertEntry(GuestBookEntry entry) {
System.out.println("DEBUG Info: GuestBook webservice: "
+ "insertEntry (ID = "
+ entry.getID()
+ ", name = \""
+ entry.getName()
+ "\", eMail = \""
+ entry.getEMail()
+ "\", message size = "
+ entry.getMessage().length() + ") called...");
this.guestBook.addEntry(entry);
}
}
HIer erhalte ich bei "public de.unihannover.se.soa10.guestbook.schema.GuestBook getEntries" Die Fehlermedung: "The return type is incompatible with GuestBook.getEntries(String)", ob wohl dieser in der GuestBook Klasse so definiert ist:
Java:
package de.unihannover.se.soa10.guestbook.schema;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java-Klasse für GuestBook complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* <complexType name="GuestBook">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="entry" type="{http://soa10.se.unihannover.de/GuestBook/Schema}GuestBookEntry" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GuestBook", propOrder = {
"entry"
})
public class GuestBook {
protected List<GuestBookEntry> entry;
public GuestBook() {
super();
entry = new ArrayList<GuestBookEntry>();
}
/**
* Gets the value of the entry property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the entry property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getEntry().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link GuestBookEntry }
*
*
*/
public List<GuestBookEntry> getEntry() {
return this.entry;
}
public void addEntry(GuestBookEntry entry) {
this.entry.add(entry);
}
}
Bei "public class GuestBookImpl implements GuestBook" bekomme ich die Fehlermeldung: "The type GuestBookImpl must implement the inherited abstract method GuestBook.insertEntrys(GuestBookEntry)" Die Methode ist allerdings implementiert.
Und drittens bekomme ich bei "public void insertEntry(GuestBookEntry entry)" eine Fehlermedlung mit "The method insertEntry(GuestBookEntry) of type GuestBookImpl must override or implement a supertype method". Und da weiß ich nicht, ob es wirklich reicht, dass Override zu entfernen.
Kennt sich zufällig jemand mit diesem Tutorial aus und weiß, wo der Fehler stecken könnte?