esercizi webservices wsdl

This commit is contained in:
2015-06-29 00:45:45 +02:00
parent 620edb5049
commit 53c280b729
60 changed files with 1741 additions and 2 deletions

Binary file not shown.

View File

@@ -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;
/**
* <p>Java class for book complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="book">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="author" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="isbn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="price" type="{http://www.w3.org/2001/XMLSchema}float" minOccurs="0"/>
* &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@@ -0,0 +1,36 @@
<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is Metro/2.3.1-b419 (branches/2.3.1.x-7937; 2014-08-04T08:11:03+0000) JAXWS-RI/2.2.10-b140803.1500 JAXWS-API/2.2.11 JAXB-RI/2.2.10-b140802.1033 JAXB-API/2.2.12-b140109.1041 svn-revision#unknown. --><!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is Metro/2.3.1-b419 (branches/2.3.1.x-7937; 2014-08-04T08:11:03+0000) JAXWS-RI/2.2.10-b140803.1500 JAXWS-API/2.2.11 JAXB-RI/2.2.10-b140802.1033 JAXB-API/2.2.12-b140109.1041 svn-revision#unknown. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://exercise2_ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://exercise2_ws/" name="BookWebServiceService">
<types>
<xsd:schema>
<xsd:import namespace="http://exercise2_ws/" schemaLocation="http://localhost:8080/web/services/BookWebService?xsd=1"/>
</xsd:schema>
</types>
<message name="checkbook">
<part name="parameters" element="tns:checkbook"/>
</message>
<message name="checkbookResponse">
<part name="parameters" element="tns:checkbookResponse"/>
</message>
<portType name="wsinterface">
<operation name="checkbook">
<input wsam:Action="http://exercise2_ws/wsinterface/checkbookRequest" message="tns:checkbook"/>
<output wsam:Action="http://exercise2_ws/wsinterface/checkbookResponse" message="tns:checkbookResponse"/>
</operation>
</portType>
<binding name="BookWebServicePortBinding" type="tns:wsinterface">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="checkbook">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="BookWebServiceService">
<port name="BookWebServicePort" binding="tns:BookWebServicePortBinding">
<soap:address location="http://localhost:8080/web/services/BookWebService"/>
</port>
</service>
</definitions>

View File

@@ -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 <code>features</code> 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;
}
}

Binary file not shown.

View File

@@ -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;
/**
* <p>Java class for checkbook complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="checkbook">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="arg0" type="{http://exercise2_ws/}book" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

Binary file not shown.

View File

@@ -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;
/**
* <p>Java class for checkbookResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="checkbookResponse">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="return" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@@ -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));
}
}

Binary file not shown.

View File

@@ -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.
* <p>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<Checkbook> createCheckbook(Checkbook value) {
return new JAXBElement<Checkbook>(_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<CheckbookResponse> createCheckbookResponse(CheckbookResponse value) {
return new JAXBElement<CheckbookResponse>(_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<Book> createBook(Book value) {
return new JAXBElement<Book>(_Book_QNAME, Book.class, null, value);
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -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);
}

Binary file not shown.

View File

@@ -0,0 +1,2 @@
@javax.xml.bind.annotation.XmlSchema(namespace = "http://exercise2_ws/")
package exercise2_client_ws.clientws;