diff --git a/exam/CD.java b/exam/CD.java new file mode 100644 index 0000000..4ff9d86 --- /dev/null +++ b/exam/CD.java @@ -0,0 +1,73 @@ +package exam; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.validation.constraints.DecimalMin; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * Created by Giovanni on 16/06/2015. + */ + +@Entity +@NamedQueries({ + @NamedQuery(name = "findid", query = "SELECT c FROM CD c WHERE c.id =?1"), + @NamedQuery(name = "findauthor", query = "SELECT c FROM CD c WHERE c.author =?1"), + @NamedQuery(name = "findall", query = "SELECT c FROM CD c"), +}) + +public class CD implements Serializable { + + @NotNull @Id + private String id; + @NotNull + private String title; + @NotNull + private String author; + @NotNull @DecimalMin("0.0") + private Float price; + + public CD (){} + + public CD (@NotNull String id_in,@NotNull String title_in,@NotNull String author_in,@NotNull @DecimalMin("0.0") Float price_in){ + + id = id_in; + title = title_in; + author = author_in; + price = price_in; + + } + + + public @NotNull String getId() { + return id; + } + + + public @NotNull String getTitle() { + return title; + } + + public void setTitle(@NotNull String title) { + this.title = title; + } + + public @NotNull @DecimalMin("0.0") Float getPrice() { + return price; + } + + public void setPrice(@NotNull @DecimalMin("0.0") Float price) { + this.price = price; + } + + public @NotNull String getAuthor() { + return author; + } + + public void setAuthor(@NotNull String author) { + this.author = author; + } +} diff --git a/exam/ClientPrintAllCDs.java b/exam/ClientPrintAllCDs.java new file mode 100644 index 0000000..b21bd5a --- /dev/null +++ b/exam/ClientPrintAllCDs.java @@ -0,0 +1,27 @@ +package exam; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Iterator; +import java.util.List; + +public class ClientPrintAllCDs { + + + public static void main (String[] args) throws NamingException{ + // added method main and signature exception + + Context ctx =new InitialContext(); + + RemoteEJB r = (RemoteEJB) ctx.lookup("java:global/web/EJB!exam.RemoteEJB"); + List l = r.findall(); + Iterator i = l.iterator(); + while (i.hasNext()){ + CD temp = i.next(); + System.out.print(temp.getId() + " " + temp.getTitle() + " " + temp.getAuthor() + " " +temp.getPrice() + "\n"); + } + } + + +} diff --git a/exam/ClientUpdatePrice.java b/exam/ClientUpdatePrice.java new file mode 100644 index 0000000..fe3920c --- /dev/null +++ b/exam/ClientUpdatePrice.java @@ -0,0 +1,34 @@ +package exam; + +import javax.jms.ConnectionFactory; +import javax.jms.Destination; +import javax.jms.JMSContext; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +/** + * Created by Giovanni on 31/05/2015. + */ +public class ClientUpdatePrice { + + public static void main(String[] args) throws NamingException { + //removed try catch e added signatute exception to main method + + Context ctx = new InitialContext(); + + ConnectionFactory cf = (ConnectionFactory) ctx.lookup("jms/javaee7/ConnectionFactory"); + Destination d = (Destination) ctx.lookup("jms/javaee7/Topic"); + try (JMSContext jmsContext = cf.createContext()) { + GeneralMessage gm = new GeneralMessage(args[0],Float.valueOf(args[1])); + jmsContext.createProducer().send(d, gm); + } + } + + + + + + + +} diff --git a/exam/DatabaseInitializer.java b/exam/DatabaseInitializer.java new file mode 100644 index 0000000..ee001f6 --- /dev/null +++ b/exam/DatabaseInitializer.java @@ -0,0 +1,40 @@ +package exam; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.ejb.Singleton; +import javax.ejb.Startup; +import javax.inject.Inject; + +/** + * Created by Giovanni on 16/06/2015. + */ + +@Singleton +@Startup + +public class DatabaseInitializer { + + @Inject + EJB e; + + private CD first; + private CD second; + + @PostConstruct + protected void initialize(){ + first = new CD("001","Title1","Author1",35.0f); + e.createCD(first); + second = new CD("002","Title2","Author2",40.0f); + e.createCD(second); + } + + @PreDestroy + protected void deleteall(){ + + e.removeCD(first); + e.removeCD(second); + + } + +} diff --git a/exam/EJB.java b/exam/EJB.java new file mode 100644 index 0000000..b68c56c --- /dev/null +++ b/exam/EJB.java @@ -0,0 +1,58 @@ +package exam; + +import javax.ejb.LocalBean; +import javax.ejb.Stateless; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; +import java.util.List; + +/** + * Created by Giovanni on 16/06/2015. + */ + +@Stateless +@LocalBean + +public class EJB implements RemoteEJB{ + + @PersistenceContext(unitName = "exam") + EntityManager em ; + + + public void createCD (CD c){ + em.persist(c); + } + + public void updateCD (CD c) { + em.merge(c); + em.persist(c); + } + + public void removeCD (CD c){ + em.merge(c); + em.remove(c); + } + + + public List findall() { + Query q = em.createNamedQuery("findall"); + return (List) q. getResultList(); + + } + + + public List findauthor(String author_in) { + Query q = em.createNamedQuery("findauthor"); + q.setParameter(1,author_in); + return (List) q. getResultList(); + } + + + public List findid(String id_in) { + Query q = em.createNamedQuery("findid"); + q.setParameter(1,id_in); + return (List) q. getResultList(); + } +} diff --git a/exam/GeneralMessage.java b/exam/GeneralMessage.java new file mode 100644 index 0000000..ca7a5fb --- /dev/null +++ b/exam/GeneralMessage.java @@ -0,0 +1,25 @@ +package exam; + +import java.io.Serializable; + +/** + * Created by Giovanni on 16/06/2015. + */ +public class GeneralMessage implements Serializable{ + + private String id; + private Float price; + + public GeneralMessage (String in_id, Float in_price){ + id = in_id; + price = in_price; + } + + public String getId() { + return id; + } + + public Float getPrice() { + return price; + } +} diff --git a/exam/MDB.java b/exam/MDB.java new file mode 100644 index 0000000..a63d16c --- /dev/null +++ b/exam/MDB.java @@ -0,0 +1,43 @@ +package exam; + + + +import javax.ejb.MessageDriven; +import javax.inject.Inject; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageListener; +import java.util.Iterator; +import java.util.List; + +/** + * Created by Giovanni on 16/06/2015. + */ + +@MessageDriven(mappedName = "jms/javaee7/Topic") +public class MDB implements MessageListener { + + @Inject + EJB e; + + + public void onMessage(Message m) { + + try { + GeneralMessage gm = m.getBody(GeneralMessage.class); + List l = e.findid(gm.getId()); + Iterator i = l.iterator(); + if (i.hasNext()){ + CD temp = i.next(); + temp.setPrice(gm.getPrice()); + e.updateCD(temp); + } + + } catch (JMSException e) { // added try catch for JMSException + e.printStackTrace(); + } + + + } + +} diff --git a/exam/RemoteEJB.java b/exam/RemoteEJB.java new file mode 100644 index 0000000..feb93f7 --- /dev/null +++ b/exam/RemoteEJB.java @@ -0,0 +1,16 @@ +package exam; + +import javax.ejb.Remote; +import java.util.List; + +/** + * Created by Giovanni on 16/06/2015. + */ +@Remote +public interface RemoteEJB { + + List findall(); + List findauthor(String author_in); + List findid(String id_in); + +} diff --git a/exercise2/InitializeDB.java b/exercise2/InitializeDB.java index 78120c7..0c49176 100644 --- a/exercise2/InitializeDB.java +++ b/exercise2/InitializeDB.java @@ -12,8 +12,8 @@ import javax.inject.Inject; * Created by Giovanni on 24/05/2015. */ -@Singleton -@Startup +//@Singleton reenable if you need this exercise +//@Startup public class InitializeDB { private Book b1,b2; diff --git a/exercise2_client_ws/ClientPrintAll.java b/exercise2_client_ws/ClientPrintAll.java new file mode 100644 index 0000000..257ede7 --- /dev/null +++ b/exercise2_client_ws/ClientPrintAll.java @@ -0,0 +1,44 @@ +package exercise2_client_ws; + +import exercise2_ws.Book; +import exercise2_ws.RemoteInterface; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Iterator; +import java.util.List; + +public class ClientPrintAll { + + + public static void main (String[] args) { + + + Context ctx = null; + try { + ctx =new InitialContext(); + } catch (NamingException e) { + e.printStackTrace(); + } + + RemoteInterface r = null; + try { + r =(RemoteInterface) ctx.lookup("java:global/web/EJBBook!exercise2_ws.RemoteInterface"); + List l = r.findall(); + Iterator it = l.iterator(); + while (it.hasNext()){ + Book b = it.next(); + System.out.print(b.getIsbn() + " " + b.getTitle() + " " + b.getAuthor() + " " +b.getPrice() + " "); + } + + } catch (NamingException e) { + e.printStackTrace(); + } + + + + } + + +} diff --git a/exercise2_client_ws/ClientUpdatePrice.java b/exercise2_client_ws/ClientUpdatePrice.java new file mode 100644 index 0000000..665bad8 --- /dev/null +++ b/exercise2_client_ws/ClientUpdatePrice.java @@ -0,0 +1,37 @@ +package exercise2_client_ws; + +import exercise2_ws.BookMessage; + +import javax.jms.ConnectionFactory; +import javax.jms.Destination; +import javax.jms.JMSContext; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +/** + * Created by Giovanni on 31/05/2015. + */ +public class ClientUpdatePrice { + + public static void main(String[] args) throws NamingException { + + + BookMessage m = new BookMessage("0001",Float.valueOf(10000)); + + Context jndiContext = new InitialContext(); + + ConnectionFactory connectionFactory = (ConnectionFactory) jndiContext.lookup("jms/javaee7/ConnectionFactory"); + Destination topic = (Destination) jndiContext.lookup("jms/javaee7/Topic"); + try (JMSContext jmsContext = connectionFactory.createContext()) { + jmsContext.createProducer().send(topic, m); + } + } + + + + + + + +} diff --git a/exercise2_client_ws/clientws/Book.class b/exercise2_client_ws/clientws/Book.class new file mode 100644 index 0000000..21d1c30 Binary files /dev/null and b/exercise2_client_ws/clientws/Book.class differ diff --git a/exercise2_client_ws/clientws/Book.java b/exercise2_client_ws/clientws/Book.java new file mode 100644 index 0000000..d858e3f --- /dev/null +++ b/exercise2_client_ws/clientws/Book.java @@ -0,0 +1,141 @@ + +package exercise2_client_ws.clientws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for book complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="book">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="author" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="isbn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="price" type="{http://www.w3.org/2001/XMLSchema}float" minOccurs="0"/>
+ *         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "book", propOrder = { + "author", + "isbn", + "price", + "title" +}) +public class Book { + + protected String author; + protected String isbn; + protected Float price; + protected String title; + + /** + * Gets the value of the author property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAuthor() { + return author; + } + + /** + * Sets the value of the author property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAuthor(String value) { + this.author = value; + } + + /** + * Gets the value of the isbn property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getIsbn() { + return isbn; + } + + /** + * Sets the value of the isbn property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsbn(String value) { + this.isbn = value; + } + + /** + * Gets the value of the price property. + * + * @return + * possible object is + * {@link Float } + * + */ + public Float getPrice() { + return price; + } + + /** + * Sets the value of the price property. + * + * @param value + * allowed object is + * {@link Float } + * + */ + public void setPrice(Float value) { + this.price = value; + } + + /** + * Gets the value of the title property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTitle() { + return title; + } + + /** + * Sets the value of the title property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTitle(String value) { + this.title = value; + } + +} diff --git a/exercise2_client_ws/clientws/BookWebService.wsdl b/exercise2_client_ws/clientws/BookWebService.wsdl new file mode 100644 index 0000000..e599767 --- /dev/null +++ b/exercise2_client_ws/clientws/BookWebService.wsdl @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/exercise2_client_ws/clientws/BookWebServiceService.class b/exercise2_client_ws/clientws/BookWebServiceService.class new file mode 100644 index 0000000..1110a8f Binary files /dev/null and b/exercise2_client_ws/clientws/BookWebServiceService.class differ diff --git a/exercise2_client_ws/clientws/BookWebServiceService.java b/exercise2_client_ws/clientws/BookWebServiceService.java new file mode 100644 index 0000000..f7bcb42 --- /dev/null +++ b/exercise2_client_ws/clientws/BookWebServiceService.java @@ -0,0 +1,94 @@ + +package exercise2_client_ws.clientws; + +import java.net.MalformedURLException; +import java.net.URL; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.10-b140803.1500 + * Generated source version: 2.2 + * + */ +@WebServiceClient(name = "BookWebServiceService", targetNamespace = "http://exercise2_ws/", wsdlLocation = "http://localhost:8080/web/services/BookWebService?wsdl") +public class BookWebServiceService + extends Service +{ + + private final static URL BOOKWEBSERVICESERVICE_WSDL_LOCATION; + private final static WebServiceException BOOKWEBSERVICESERVICE_EXCEPTION; + private final static QName BOOKWEBSERVICESERVICE_QNAME = new QName("http://exercise2_ws/", "BookWebServiceService"); + + static { + URL url = null; + WebServiceException e = null; + try { + url = new URL("http://localhost:8080/web/services/BookWebService?wsdl"); + } catch (MalformedURLException ex) { + e = new WebServiceException(ex); + } + BOOKWEBSERVICESERVICE_WSDL_LOCATION = url; + BOOKWEBSERVICESERVICE_EXCEPTION = e; + } + + public BookWebServiceService() { + super(__getWsdlLocation(), BOOKWEBSERVICESERVICE_QNAME); + } + + public BookWebServiceService(WebServiceFeature... features) { + super(__getWsdlLocation(), BOOKWEBSERVICESERVICE_QNAME, features); + } + + public BookWebServiceService(URL wsdlLocation) { + super(wsdlLocation, BOOKWEBSERVICESERVICE_QNAME); + } + + public BookWebServiceService(URL wsdlLocation, WebServiceFeature... features) { + super(wsdlLocation, BOOKWEBSERVICESERVICE_QNAME, features); + } + + public BookWebServiceService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public BookWebServiceService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { + super(wsdlLocation, serviceName, features); + } + + /** + * + * @return + * returns Wsinterface + */ + @WebEndpoint(name = "BookWebServicePort") + public Wsinterface getBookWebServicePort() { + return super.getPort(new QName("http://exercise2_ws/", "BookWebServicePort"), Wsinterface.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * @return + * returns Wsinterface + */ + @WebEndpoint(name = "BookWebServicePort") + public Wsinterface getBookWebServicePort(WebServiceFeature... features) { + return super.getPort(new QName("http://exercise2_ws/", "BookWebServicePort"), Wsinterface.class, features); + } + + private static URL __getWsdlLocation() { + if (BOOKWEBSERVICESERVICE_EXCEPTION!= null) { + throw BOOKWEBSERVICESERVICE_EXCEPTION; + } + return BOOKWEBSERVICESERVICE_WSDL_LOCATION; + } + +} diff --git a/exercise2_client_ws/clientws/Checkbook.class b/exercise2_client_ws/clientws/Checkbook.class new file mode 100644 index 0000000..f6ae3ea Binary files /dev/null and b/exercise2_client_ws/clientws/Checkbook.class differ diff --git a/exercise2_client_ws/clientws/Checkbook.java b/exercise2_client_ws/clientws/Checkbook.java new file mode 100644 index 0000000..8e7efd0 --- /dev/null +++ b/exercise2_client_ws/clientws/Checkbook.java @@ -0,0 +1,60 @@ + +package exercise2_client_ws.clientws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for checkbook complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="checkbook">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="arg0" type="{http://exercise2_ws/}book" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "checkbook", propOrder = { + "arg0" +}) +public class Checkbook { + + protected Book arg0; + + /** + * Gets the value of the arg0 property. + * + * @return + * possible object is + * {@link Book } + * + */ + public Book getArg0() { + return arg0; + } + + /** + * Sets the value of the arg0 property. + * + * @param value + * allowed object is + * {@link Book } + * + */ + public void setArg0(Book value) { + this.arg0 = value; + } + +} diff --git a/exercise2_client_ws/clientws/CheckbookResponse.class b/exercise2_client_ws/clientws/CheckbookResponse.class new file mode 100644 index 0000000..a4555cb Binary files /dev/null and b/exercise2_client_ws/clientws/CheckbookResponse.class differ diff --git a/exercise2_client_ws/clientws/CheckbookResponse.java b/exercise2_client_ws/clientws/CheckbookResponse.java new file mode 100644 index 0000000..8baae3f --- /dev/null +++ b/exercise2_client_ws/clientws/CheckbookResponse.java @@ -0,0 +1,54 @@ + +package exercise2_client_ws.clientws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for checkbookResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="checkbookResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "checkbookResponse", propOrder = { + "_return" +}) +public class CheckbookResponse { + + @XmlElement(name = "return") + protected boolean _return; + + /** + * Gets the value of the return property. + * + */ + public boolean isReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + */ + public void setReturn(boolean value) { + this._return = value; + } + +} diff --git a/exercise2_client_ws/clientws/ClientSendBook.java b/exercise2_client_ws/clientws/ClientSendBook.java new file mode 100644 index 0000000..2657efd --- /dev/null +++ b/exercise2_client_ws/clientws/ClientSendBook.java @@ -0,0 +1,27 @@ +package exercise2_client_ws.clientws; + + +/** + * Created by Giovanni on 13/06/2015. + */ +public class ClientSendBook { + + public static void main (String[] args) { + + Wsinterface bws = new BookWebServiceService().getBookWebServicePort(); + + Book b = new Book(); + b.setTitle("xgiovio president"); + b.setPrice(100f); + b.setAuthor("xgiovio"); + b.setIsbn("0001s"); + + System.out.println(bws.checkbook( b)); + + + + } + + + +} diff --git a/exercise2_client_ws/clientws/ObjectFactory.class b/exercise2_client_ws/clientws/ObjectFactory.class new file mode 100644 index 0000000..0cdaa73 Binary files /dev/null and b/exercise2_client_ws/clientws/ObjectFactory.class differ diff --git a/exercise2_client_ws/clientws/ObjectFactory.java b/exercise2_client_ws/clientws/ObjectFactory.java new file mode 100644 index 0000000..eeefd72 --- /dev/null +++ b/exercise2_client_ws/clientws/ObjectFactory.java @@ -0,0 +1,89 @@ + +package exercise2_client_ws.clientws; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the exercise2_client_ws.clientws package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _Checkbook_QNAME = new QName("http://exercise2_ws/", "checkbook"); + private final static QName _CheckbookResponse_QNAME = new QName("http://exercise2_ws/", "checkbookResponse"); + private final static QName _Book_QNAME = new QName("http://exercise2_ws/", "book"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: exercise2_client_ws.clientws + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Book } + * + */ + public Book createBook() { + return new Book(); + } + + /** + * Create an instance of {@link Checkbook } + * + */ + public Checkbook createCheckbook() { + return new Checkbook(); + } + + /** + * Create an instance of {@link CheckbookResponse } + * + */ + public CheckbookResponse createCheckbookResponse() { + return new CheckbookResponse(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Checkbook }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://exercise2_ws/", name = "checkbook") + public JAXBElement createCheckbook(Checkbook value) { + return new JAXBElement(_Checkbook_QNAME, Checkbook.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CheckbookResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://exercise2_ws/", name = "checkbookResponse") + public JAXBElement createCheckbookResponse(CheckbookResponse value) { + return new JAXBElement(_CheckbookResponse_QNAME, CheckbookResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Book }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://exercise2_ws/", name = "book") + public JAXBElement createBook(Book value) { + return new JAXBElement(_Book_QNAME, Book.class, null, value); + } + +} diff --git a/exercise2_client_ws/clientws/Sendbook.class b/exercise2_client_ws/clientws/Sendbook.class new file mode 100644 index 0000000..aac89f0 Binary files /dev/null and b/exercise2_client_ws/clientws/Sendbook.class differ diff --git a/exercise2_client_ws/clientws/SendbookResponse.class b/exercise2_client_ws/clientws/SendbookResponse.class new file mode 100644 index 0000000..4a19057 Binary files /dev/null and b/exercise2_client_ws/clientws/SendbookResponse.class differ diff --git a/exercise2_client_ws/clientws/Wsinterface.class b/exercise2_client_ws/clientws/Wsinterface.class new file mode 100644 index 0000000..ee24fc3 Binary files /dev/null and b/exercise2_client_ws/clientws/Wsinterface.class differ diff --git a/exercise2_client_ws/clientws/Wsinterface.java b/exercise2_client_ws/clientws/Wsinterface.java new file mode 100644 index 0000000..2613e9d --- /dev/null +++ b/exercise2_client_ws/clientws/Wsinterface.java @@ -0,0 +1,42 @@ + +package exercise2_client_ws.clientws; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.Action; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.10-b140803.1500 + * Generated source version: 2.2 + * + */ +@WebService(name = "wsinterface", targetNamespace = "http://exercise2_ws/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Wsinterface { + + + /** + * + * @param arg0 + * @return + * returns boolean + */ + @WebMethod + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "checkbook", targetNamespace = "http://exercise2_ws/", className = "exercise2_client_ws.clientws.Checkbook") + @ResponseWrapper(localName = "checkbookResponse", targetNamespace = "http://exercise2_ws/", className = "exercise2_client_ws.clientws.CheckbookResponse") + @Action(input = "http://exercise2_ws/wsinterface/checkbookRequest", output = "http://exercise2_ws/wsinterface/checkbookResponse") + public boolean checkbook( + @WebParam(name = "arg0", targetNamespace = "") + Book arg0); + +} diff --git a/exercise2_client_ws/clientws/package-info.class b/exercise2_client_ws/clientws/package-info.class new file mode 100644 index 0000000..2578cba Binary files /dev/null and b/exercise2_client_ws/clientws/package-info.class differ diff --git a/exercise2_client_ws/clientws/package-info.java b/exercise2_client_ws/clientws/package-info.java new file mode 100644 index 0000000..280814f --- /dev/null +++ b/exercise2_client_ws/clientws/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://exercise2_ws/") +package exercise2_client_ws.clientws; diff --git a/exercise2_ws/Book.java b/exercise2_ws/Book.java new file mode 100644 index 0000000..883a7a8 --- /dev/null +++ b/exercise2_ws/Book.java @@ -0,0 +1,74 @@ +package exercise2_ws; + +import javax.persistence.*; +import javax.validation.constraints.DecimalMin; +import javax.validation.constraints.NotNull; +import javax.xml.bind.annotation.XmlRootElement; +import java.io.Serializable; + +/** + * Created by Giovanni on 31/05/2015. + */ + +@Entity(name="Bookws") +@XmlRootElement +@NamedQueries({ + @NamedQuery(name = "findbyisbnws", query = "SELECT b FROM Bookws b WHERE b.isbn =?1"), + @NamedQuery(name = "findallws", query = "SELECT b FROM Bookws b") +}) +public class Book implements Serializable{ + + @GeneratedValue @Id + private Long id ; + @NotNull + private String title; + @NotNull + private String author; + @NotNull + private Float price; + @NotNull + private String isbn; + + + public Book(){} + + public Book(@NotNull String in_isbn,@NotNull String in_title,@NotNull String in_author, @NotNull @DecimalMin("0.0") Float in_price){ + title = in_title; + author = in_author; + price = in_price; + isbn = in_isbn; + } + + public @NotNull String getIsbn() { + return isbn; + } + + public void setIsbn(@NotNull String isbn) { + this.isbn = isbn; + } + + public @NotNull String getTitle() { + return title; + } + + public void setTitle(@NotNull String title) { + this.title = title; + } + + public @NotNull String getAuthor() { + return author; + } + + public void setAuthor( @NotNull String author) { + this.author = author; + } + + public @NotNull @DecimalMin("0.0") Float getPrice() { + return price; + } + + public void setPrice(@NotNull @DecimalMin("0.0") Float price) { + this.price = price; + } + +} diff --git a/exercise2_ws/BookMessage.java b/exercise2_ws/BookMessage.java new file mode 100644 index 0000000..4e3773f --- /dev/null +++ b/exercise2_ws/BookMessage.java @@ -0,0 +1,26 @@ +package exercise2_ws; + +import java.io.Serializable; + +/** + * Created by Giovanni on 31/05/2015. + */ +public class BookMessage implements Serializable{ + + public BookMessage (String in_isbn, Float in_price){ + isbn = in_isbn; + price = in_price; + } + + + private String isbn; + private Float price; + + public String getIsbn() { + return isbn; + } + + public Float getPrice() { + return price; + } +} diff --git a/exercise2_ws/BookWebService.java b/exercise2_ws/BookWebService.java new file mode 100644 index 0000000..62039e0 --- /dev/null +++ b/exercise2_ws/BookWebService.java @@ -0,0 +1,18 @@ +package exercise2_ws; + + +import javax.jws.WebService; + +/** + * Created by Giovanni on 13/06/2015. + */ + +@WebService(endpointInterface ="exercise2_ws.wsinterface") +public class BookWebService implements wsinterface { + + public boolean checkbook(Book b) { + if (b.getIsbn() == null) + return false; + return true; + } +} diff --git a/exercise2_ws/EJBBook.java b/exercise2_ws/EJBBook.java new file mode 100644 index 0000000..7cafa4b --- /dev/null +++ b/exercise2_ws/EJBBook.java @@ -0,0 +1,49 @@ +package exercise2_ws; + + + +import javax.ejb.LocalBean; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * Created by Giovanni on 24/05/2015. + */ +@Stateless +@LocalBean +@ws +public class EJBBook implements RemoteInterface { + + @PersistenceContext(unitName = "exercise2ws") + EntityManager em ; + + public void create_book (@NotNull Book s) { + em.persist(s); + } + public void update_book (@NotNull Book s) { + em.merge(s); + em.persist(s); + } + public void delete_book (@NotNull Book s) { + em.merge(s); + em.remove(s); + } + + public @NotNull List findbyisbn (@NotNull String in_isbn) { + Query Q = em.createNamedQuery("findbyisbnws"); + Q.setParameter(1, in_isbn); + return (List)Q.getResultList(); + } + + + public List findall () { + Query Q = em.createNamedQuery("findallws"); + return (List)Q.getResultList(); + } + + +} diff --git a/exercise2_ws/InitializeDB.java b/exercise2_ws/InitializeDB.java new file mode 100644 index 0000000..8ebc439 --- /dev/null +++ b/exercise2_ws/InitializeDB.java @@ -0,0 +1,43 @@ +package exercise2_ws; + + + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.ejb.Singleton; +import javax.ejb.Startup; +import javax.inject.Inject; + +/** + * Created by Giovanni on 24/05/2015. + */ + +@Singleton +@Startup +public class InitializeDB { + + private Book b1,b2; + + @Inject @ws + private EJBBook e; + + @PostConstruct + void pupulate (){ + b1 = new Book("0001","Titolo1","Author1",10f); + b2 = new Book("0010","Titolo2","Author2",30f); + e.create_book(b1); + e.create_book(b2); + } + + @PreDestroy + void delete () { + e.delete_book(b1); + e.delete_book(b2); + } + + + + + + +} diff --git a/exercise2_ws/MDBBook.java b/exercise2_ws/MDBBook.java new file mode 100644 index 0000000..592f3de --- /dev/null +++ b/exercise2_ws/MDBBook.java @@ -0,0 +1,40 @@ +package exercise2_ws; + +import javax.ejb.MessageDriven; +import javax.inject.Inject; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageListener; +import java.util.Iterator; +import java.util.List; +import java.util.logging.Logger; + +/** + * Created by Giovanni on 31/05/2015. + */ +@MessageDriven(mappedName = "jms/javaee7/Topic") +public class MDBBook implements MessageListener { + + @Inject + Logger l; + + @Inject @ws + EJBBook e; + + public void onMessage(Message message) { + try { + exercise2_ws.BookMessage m = message.getBody(exercise2_ws.BookMessage.class); + l.info("Messaggio: " + m.getIsbn() + " " + m.getPrice()); + + List lb = e.findbyisbn(m.getIsbn()); + Iteratorib = lb.iterator(); + if (ib.hasNext()){ + Book b = ib.next(); + b.setPrice(m.getPrice()); + e.update_book(b); + } + } catch (JMSException e) { + e.printStackTrace(); + } + } +} diff --git a/exercise2_ws/RemoteInterface.java b/exercise2_ws/RemoteInterface.java new file mode 100644 index 0000000..0908397 --- /dev/null +++ b/exercise2_ws/RemoteInterface.java @@ -0,0 +1,16 @@ +package exercise2_ws; + +import javax.ejb.Remote; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * Created by Giovanni on 24/05/2015. + */ +@Remote +public interface RemoteInterface { + + @NotNull List findbyisbn(@NotNull String in_isbn); + List findall() ; + +} diff --git a/exercise2_ws/ws.java b/exercise2_ws/ws.java new file mode 100644 index 0000000..df0ab27 --- /dev/null +++ b/exercise2_ws/ws.java @@ -0,0 +1,18 @@ +package exercise2_ws; + +import javax.inject.Qualifier; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Created by Giovanni on 26/04/2015. + */ + +@Qualifier +@Retention(RUNTIME) +@Target({FIELD, TYPE, METHOD}) +public @interface ws { +} diff --git a/exercise2_ws/wsinterface.java b/exercise2_ws/wsinterface.java new file mode 100644 index 0000000..0b9e430 --- /dev/null +++ b/exercise2_ws/wsinterface.java @@ -0,0 +1,11 @@ +package exercise2_ws; + +import javax.jws.WebService; + +/** + * Created by Giovanni on 13/06/2015. + */ +@WebService +public interface wsinterface { + boolean checkbook(Book b); +} diff --git a/test5_ws/HelloWorld.java b/test5_ws/HelloWorld.java new file mode 100644 index 0000000..eebf334 --- /dev/null +++ b/test5_ws/HelloWorld.java @@ -0,0 +1,17 @@ +package test5_ws; +import javax.ejb.Stateless; +import javax.jws.WebService; + + +/** + * Created by Giovanni on 12/06/2015. + */ +@WebService(endpointInterface ="test5_ws.HelloWorldInterface") +@Stateless +public class HelloWorld implements HelloWorldInterface{ + public ObjectToPass modifymessage(ObjectToPass o) { + System.out.println("original message " + o.message); + o.message = "modified by server"; + return o; + } +} diff --git a/test5_ws/HelloWorldInterface.java b/test5_ws/HelloWorldInterface.java new file mode 100644 index 0000000..967f6ee --- /dev/null +++ b/test5_ws/HelloWorldInterface.java @@ -0,0 +1,11 @@ +package test5_ws; + +import javax.jws.WebService; + +/** + * Created by Giovanni on 12/06/2015. + */ +@WebService +public interface HelloWorldInterface { + ObjectToPass modifymessage(ObjectToPass o); +} diff --git a/test5_ws/ObjectToPass.java b/test5_ws/ObjectToPass.java new file mode 100644 index 0000000..41a29fc --- /dev/null +++ b/test5_ws/ObjectToPass.java @@ -0,0 +1,12 @@ +package test5_ws; + +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Created by Giovanni on 12/06/2015. + */ +@XmlRootElement +public class ObjectToPass { + public String message = "def"; + +} diff --git a/test5_ws_client/Client.java b/test5_ws_client/Client.java new file mode 100644 index 0000000..d8d34a6 --- /dev/null +++ b/test5_ws_client/Client.java @@ -0,0 +1,17 @@ +package test5_ws_client; + +import test5_ws.*; + +/** + * Created by Giovanni on 12/06/2015. + */ +public class Client { + public static void main(String[] argv) { + HelloWorldInterface service = new HelloWorldService().getHelloWorldPort(); + //invoke business method + ObjectToPass o = new ObjectToPass(); + o.message = "jo from the client"; + System.out.println(service.modifymessage(o).message); + } +} + diff --git a/test5_ws_client/HelloWorld.class b/test5_ws_client/HelloWorld.class new file mode 100644 index 0000000..0371d7a Binary files /dev/null and b/test5_ws_client/HelloWorld.class differ diff --git a/test5_ws_client/HelloWorld.wsdl b/test5_ws_client/HelloWorld.wsdl new file mode 100644 index 0000000..16176db --- /dev/null +++ b/test5_ws_client/HelloWorld.wsdl @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test5_ws_client/HelloWorldInterface.class b/test5_ws_client/HelloWorldInterface.class new file mode 100644 index 0000000..2817174 Binary files /dev/null and b/test5_ws_client/HelloWorldInterface.class differ diff --git a/test5_ws_client/HelloWorldInterface.java b/test5_ws_client/HelloWorldInterface.java new file mode 100644 index 0000000..49ba18c --- /dev/null +++ b/test5_ws_client/HelloWorldInterface.java @@ -0,0 +1,42 @@ + +package test5_ws_client; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.Action; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.10-b140803.1500 + * Generated source version: 2.2 + * + */ +@WebService(name = "HelloWorldInterface", targetNamespace = "http://test5_ws/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface HelloWorldInterface { + + + /** + * + * @param arg0 + * @return + * returns test5_ws_client.ObjectToPass + */ + @WebMethod + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "modifymessage", targetNamespace = "http://test5_ws/", className = "test5_ws_client.Modifymessage") + @ResponseWrapper(localName = "modifymessageResponse", targetNamespace = "http://test5_ws/", className = "test5_ws_client.ModifymessageResponse") + @Action(input = "http://test5_ws/HelloWorldInterface/modifymessageRequest", output = "http://test5_ws/HelloWorldInterface/modifymessageResponse") + public ObjectToPass modifymessage( + @WebParam(name = "arg0", targetNamespace = "") + ObjectToPass arg0); + +} diff --git a/test5_ws_client/HelloWorldService.class b/test5_ws_client/HelloWorldService.class new file mode 100644 index 0000000..7f3f8f5 Binary files /dev/null and b/test5_ws_client/HelloWorldService.class differ diff --git a/test5_ws_client/HelloWorldService.java b/test5_ws_client/HelloWorldService.java new file mode 100644 index 0000000..865a1c9 --- /dev/null +++ b/test5_ws_client/HelloWorldService.java @@ -0,0 +1,94 @@ + +package test5_ws_client; + +import java.net.MalformedURLException; +import java.net.URL; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.10-b140803.1500 + * Generated source version: 2.2 + * + */ +@WebServiceClient(name = "HelloWorldService", targetNamespace = "http://test5_ws/", wsdlLocation = "http://localhost:8080/web/services/HelloWorld?wsdl") +public class HelloWorldService + extends Service +{ + + private final static URL HELLOWORLDSERVICE_WSDL_LOCATION; + private final static WebServiceException HELLOWORLDSERVICE_EXCEPTION; + private final static QName HELLOWORLDSERVICE_QNAME = new QName("http://test5_ws/", "HelloWorldService"); + + static { + URL url = null; + WebServiceException e = null; + try { + url = new URL("http://localhost:8080/web/services/HelloWorld?wsdl"); + } catch (MalformedURLException ex) { + e = new WebServiceException(ex); + } + HELLOWORLDSERVICE_WSDL_LOCATION = url; + HELLOWORLDSERVICE_EXCEPTION = e; + } + + public HelloWorldService() { + super(__getWsdlLocation(), HELLOWORLDSERVICE_QNAME); + } + + public HelloWorldService(WebServiceFeature... features) { + super(__getWsdlLocation(), HELLOWORLDSERVICE_QNAME, features); + } + + public HelloWorldService(URL wsdlLocation) { + super(wsdlLocation, HELLOWORLDSERVICE_QNAME); + } + + public HelloWorldService(URL wsdlLocation, WebServiceFeature... features) { + super(wsdlLocation, HELLOWORLDSERVICE_QNAME, features); + } + + public HelloWorldService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public HelloWorldService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { + super(wsdlLocation, serviceName, features); + } + + /** + * + * @return + * returns HelloWorldInterface + */ + @WebEndpoint(name = "HelloWorldPort") + public HelloWorldInterface getHelloWorldPort() { + return super.getPort(new QName("http://test5_ws/", "HelloWorldPort"), HelloWorldInterface.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * @return + * returns HelloWorldInterface + */ + @WebEndpoint(name = "HelloWorldPort") + public HelloWorldInterface getHelloWorldPort(WebServiceFeature... features) { + return super.getPort(new QName("http://test5_ws/", "HelloWorldPort"), HelloWorldInterface.class, features); + } + + private static URL __getWsdlLocation() { + if (HELLOWORLDSERVICE_EXCEPTION!= null) { + throw HELLOWORLDSERVICE_EXCEPTION; + } + return HELLOWORLDSERVICE_WSDL_LOCATION; + } + +} diff --git a/test5_ws_client/Modifymessage.class b/test5_ws_client/Modifymessage.class new file mode 100644 index 0000000..e0a1630 Binary files /dev/null and b/test5_ws_client/Modifymessage.class differ diff --git a/test5_ws_client/Modifymessage.java b/test5_ws_client/Modifymessage.java new file mode 100644 index 0000000..61d33ed --- /dev/null +++ b/test5_ws_client/Modifymessage.java @@ -0,0 +1,60 @@ + +package test5_ws_client; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for modifymessage complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="modifymessage">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="arg0" type="{http://test5_ws/}objectToPass" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "modifymessage", propOrder = { + "arg0" +}) +public class Modifymessage { + + protected ObjectToPass arg0; + + /** + * Gets the value of the arg0 property. + * + * @return + * possible object is + * {@link ObjectToPass } + * + */ + public ObjectToPass getArg0() { + return arg0; + } + + /** + * Sets the value of the arg0 property. + * + * @param value + * allowed object is + * {@link ObjectToPass } + * + */ + public void setArg0(ObjectToPass value) { + this.arg0 = value; + } + +} diff --git a/test5_ws_client/ModifymessageResponse.class b/test5_ws_client/ModifymessageResponse.class new file mode 100644 index 0000000..6d823f7 Binary files /dev/null and b/test5_ws_client/ModifymessageResponse.class differ diff --git a/test5_ws_client/ModifymessageResponse.java b/test5_ws_client/ModifymessageResponse.java new file mode 100644 index 0000000..2fc22d5 --- /dev/null +++ b/test5_ws_client/ModifymessageResponse.java @@ -0,0 +1,62 @@ + +package test5_ws_client; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for modifymessageResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="modifymessageResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://test5_ws/}objectToPass" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "modifymessageResponse", propOrder = { + "_return" +}) +public class ModifymessageResponse { + + @XmlElement(name = "return") + protected ObjectToPass _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link ObjectToPass } + * + */ + public ObjectToPass getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link ObjectToPass } + * + */ + public void setReturn(ObjectToPass value) { + this._return = value; + } + +} diff --git a/test5_ws_client/ObjectFactory.class b/test5_ws_client/ObjectFactory.class new file mode 100644 index 0000000..3a57503 Binary files /dev/null and b/test5_ws_client/ObjectFactory.class differ diff --git a/test5_ws_client/ObjectFactory.java b/test5_ws_client/ObjectFactory.java new file mode 100644 index 0000000..a493e98 --- /dev/null +++ b/test5_ws_client/ObjectFactory.java @@ -0,0 +1,89 @@ + +package test5_ws_client; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the test5_ws_client package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _Modifymessage_QNAME = new QName("http://test5_ws/", "modifymessage"); + private final static QName _ObjectToPass_QNAME = new QName("http://test5_ws/", "objectToPass"); + private final static QName _ModifymessageResponse_QNAME = new QName("http://test5_ws/", "modifymessageResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: test5_ws_client + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link ModifymessageResponse } + * + */ + public ModifymessageResponse createModifymessageResponse() { + return new ModifymessageResponse(); + } + + /** + * Create an instance of {@link ObjectToPass } + * + */ + public ObjectToPass createObjectToPass() { + return new ObjectToPass(); + } + + /** + * Create an instance of {@link Modifymessage } + * + */ + public Modifymessage createModifymessage() { + return new Modifymessage(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Modifymessage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://test5_ws/", name = "modifymessage") + public JAXBElement createModifymessage(Modifymessage value) { + return new JAXBElement(_Modifymessage_QNAME, Modifymessage.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ObjectToPass }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://test5_ws/", name = "objectToPass") + public JAXBElement createObjectToPass(ObjectToPass value) { + return new JAXBElement(_ObjectToPass_QNAME, ObjectToPass.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ModifymessageResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://test5_ws/", name = "modifymessageResponse") + public JAXBElement createModifymessageResponse(ModifymessageResponse value) { + return new JAXBElement(_ModifymessageResponse_QNAME, ModifymessageResponse.class, null, value); + } + +} diff --git a/test5_ws_client/ObjectToPass.class b/test5_ws_client/ObjectToPass.class new file mode 100644 index 0000000..46313a8 Binary files /dev/null and b/test5_ws_client/ObjectToPass.class differ diff --git a/test5_ws_client/ObjectToPass.java b/test5_ws_client/ObjectToPass.java new file mode 100644 index 0000000..f8a31e6 --- /dev/null +++ b/test5_ws_client/ObjectToPass.java @@ -0,0 +1,60 @@ + +package test5_ws_client; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for objectToPass complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="objectToPass">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "objectToPass", propOrder = { + "message" +}) +public class ObjectToPass { + + protected String message; + + /** + * Gets the value of the message property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMessage() { + return message; + } + + /** + * Sets the value of the message property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMessage(String value) { + this.message = value; + } + +} diff --git a/test5_ws_client/SayHelloWorldFrom.class b/test5_ws_client/SayHelloWorldFrom.class new file mode 100644 index 0000000..f655162 Binary files /dev/null and b/test5_ws_client/SayHelloWorldFrom.class differ diff --git a/test5_ws_client/SayHelloWorldFromResponse.class b/test5_ws_client/SayHelloWorldFromResponse.class new file mode 100644 index 0000000..eb34eef Binary files /dev/null and b/test5_ws_client/SayHelloWorldFromResponse.class differ diff --git a/test5_ws_client/package-info.class b/test5_ws_client/package-info.class new file mode 100644 index 0000000..cc217aa Binary files /dev/null and b/test5_ws_client/package-info.class differ diff --git a/test5_ws_client/package-info.java b/test5_ws_client/package-info.java new file mode 100644 index 0000000..3774fe6 --- /dev/null +++ b/test5_ws_client/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://test5_ws/") +package test5_ws_client;