esercizi webservices wsdl
This commit is contained in:
17
test5_ws_client/Client.java
Normal file
17
test5_ws_client/Client.java
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
BIN
test5_ws_client/HelloWorld.class
Normal file
BIN
test5_ws_client/HelloWorld.class
Normal file
Binary file not shown.
36
test5_ws_client/HelloWorld.wsdl
Normal file
36
test5_ws_client/HelloWorld.wsdl
Normal 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://test5_ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://test5_ws/" name="HelloWorldService">
|
||||
<types>
|
||||
<xsd:schema>
|
||||
<xsd:import namespace="http://test5_ws/" schemaLocation="http://localhost:8080/web/services/HelloWorld?xsd=1"/>
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="modifymessage">
|
||||
<part name="parameters" element="tns:modifymessage"/>
|
||||
</message>
|
||||
<message name="modifymessageResponse">
|
||||
<part name="parameters" element="tns:modifymessageResponse"/>
|
||||
</message>
|
||||
<portType name="HelloWorldInterface">
|
||||
<operation name="modifymessage">
|
||||
<input wsam:Action="http://test5_ws/HelloWorldInterface/modifymessageRequest" message="tns:modifymessage"/>
|
||||
<output wsam:Action="http://test5_ws/HelloWorldInterface/modifymessageResponse" message="tns:modifymessageResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="HelloWorldPortBinding" type="tns:HelloWorldInterface">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
||||
<operation name="modifymessage">
|
||||
<soap:operation soapAction=""/>
|
||||
<input>
|
||||
<soap:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="HelloWorldService">
|
||||
<port name="HelloWorldPort" binding="tns:HelloWorldPortBinding">
|
||||
<soap:address location="http://localhost:8080/web/services/HelloWorld"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
BIN
test5_ws_client/HelloWorldInterface.class
Normal file
BIN
test5_ws_client/HelloWorldInterface.class
Normal file
Binary file not shown.
42
test5_ws_client/HelloWorldInterface.java
Normal file
42
test5_ws_client/HelloWorldInterface.java
Normal file
@@ -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);
|
||||
|
||||
}
|
||||
BIN
test5_ws_client/HelloWorldService.class
Normal file
BIN
test5_ws_client/HelloWorldService.class
Normal file
Binary file not shown.
94
test5_ws_client/HelloWorldService.java
Normal file
94
test5_ws_client/HelloWorldService.java
Normal file
@@ -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 <code>features</code> 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;
|
||||
}
|
||||
|
||||
}
|
||||
BIN
test5_ws_client/Modifymessage.class
Normal file
BIN
test5_ws_client/Modifymessage.class
Normal file
Binary file not shown.
60
test5_ws_client/Modifymessage.java
Normal file
60
test5_ws_client/Modifymessage.java
Normal file
@@ -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;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for modifymessage complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <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>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
BIN
test5_ws_client/ModifymessageResponse.class
Normal file
BIN
test5_ws_client/ModifymessageResponse.class
Normal file
Binary file not shown.
62
test5_ws_client/ModifymessageResponse.java
Normal file
62
test5_ws_client/ModifymessageResponse.java
Normal file
@@ -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;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for modifymessageResponse complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <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>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
BIN
test5_ws_client/ObjectFactory.class
Normal file
BIN
test5_ws_client/ObjectFactory.class
Normal file
Binary file not shown.
89
test5_ws_client/ObjectFactory.java
Normal file
89
test5_ws_client/ObjectFactory.java
Normal file
@@ -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.
|
||||
* <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 _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<Modifymessage> createModifymessage(Modifymessage value) {
|
||||
return new JAXBElement<Modifymessage>(_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<ObjectToPass> createObjectToPass(ObjectToPass value) {
|
||||
return new JAXBElement<ObjectToPass>(_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<ModifymessageResponse> createModifymessageResponse(ModifymessageResponse value) {
|
||||
return new JAXBElement<ModifymessageResponse>(_ModifymessageResponse_QNAME, ModifymessageResponse.class, null, value);
|
||||
}
|
||||
|
||||
}
|
||||
BIN
test5_ws_client/ObjectToPass.class
Normal file
BIN
test5_ws_client/ObjectToPass.class
Normal file
Binary file not shown.
60
test5_ws_client/ObjectToPass.java
Normal file
60
test5_ws_client/ObjectToPass.java
Normal file
@@ -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;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for objectToPass complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <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>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
BIN
test5_ws_client/SayHelloWorldFrom.class
Normal file
BIN
test5_ws_client/SayHelloWorldFrom.class
Normal file
Binary file not shown.
BIN
test5_ws_client/SayHelloWorldFromResponse.class
Normal file
BIN
test5_ws_client/SayHelloWorldFromResponse.class
Normal file
Binary file not shown.
BIN
test5_ws_client/package-info.class
Normal file
BIN
test5_ws_client/package-info.class
Normal file
Binary file not shown.
2
test5_ws_client/package-info.java
Normal file
2
test5_ws_client/package-info.java
Normal file
@@ -0,0 +1,2 @@
|
||||
@javax.xml.bind.annotation.XmlSchema(namespace = "http://test5_ws/")
|
||||
package test5_ws_client;
|
||||
Reference in New Issue
Block a user