axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathias P.W Nilsson" <math...@snyltarna.se>
Subject Re: invoke webservices and doubt on structure
Date Tue, 28 Aug 2007 11:56:38 GMT

Can this be done with embedded Axis2? I can't get it to work, and I can't get
a client to work either.

Here are some code

The Service

----------------------------------------------
package samples.demo;

/**
 * @author  mailto:dan@envoisolutions.com Dan Diephouse 
 */
public class BookService{
    private Book onlyBook;

    public BookService() {
        onlyBook = new Book();
        onlyBook.setAuthor("Dan Diephouse");
        onlyBook.setTitle("Using Axis2");
        onlyBook.setIsbn("0123456789");
    }

    public Book[] getBooks() {
        return new Book[]{onlyBook};
    }

    public Book findBook(String isbn) {
        if (isbn.equals(onlyBook.getIsbn()))
            return onlyBook;

        return null;
    }
}
----------------------------------------------

The book class
----------------------------------------------
package samples.demo;

/**
 * @author  mailto:dan@envoisolutions.com Dan Diephouse 
 */
public class Book {
    private String title;
    private String isbn;
    private String author;

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }
}
----------------------------------------------

The structure looks like this
webapp/WEB-INF/services/BookService/META-INF/services.xml


Here is the service xml

----------------------------------------------
<serviceGroup>
	<service name="BookService"
             targetNamespace="http://ws.apache.org/axis2/samples/book/">
		<description>
			Book sample service
		</description>
        <schema
schemaNamespace="http://ws.apache.org/axis2/samples/book/xsd/"/>
        <parameter name="ServiceClass"
locked="false">samples.demo.BookService</parameter>
		<operation name="getBooks">
			<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
		</operation>
        <operation name="findBook">
            <messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
        </operation>
	</service>
</serviceGroup>

----------------------------------------------

I've added the Axis Servlet to my web.xml 

Any ideas?

-- 
View this message in context: http://www.nabble.com/invoke-webservices-and-doubt-on-structure-tf4340541.html#a12366601
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message