Skip to content

Commit d1fcad2

Browse files
committed
Added JAX-WS client example
1 parent 3e4cfec commit d1fcad2

21 files changed

+1293
-0
lines changed

jaxws/jaxws-client/pom.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.javaee7.jaxws</groupId>
6+
<artifactId>jaxws-samples</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
<relativePath>../pom.xml</relativePath>
9+
</parent>
10+
<artifactId>jaxws-client</artifactId>
11+
<packaging>war</packaging>
12+
<build>
13+
<finalName>jaxws-client</finalName>
14+
<plugins>
15+
<plugin>
16+
<!-- wsimport for web service classes generation -->
17+
<groupId>org.codehaus.mojo</groupId>
18+
<artifactId>jaxws-maven-plugin</artifactId>
19+
<version>1.11</version>
20+
<executions>
21+
<execution>
22+
<phase>generate-sources</phase>
23+
<goals>
24+
<goal>wsimport</goal>
25+
</goals>
26+
<configuration>
27+
<packageName>org.javaee7.jaxws.client.gen</packageName>
28+
<wsdlFiles>
29+
<wsdlFile>../../../jaxws-endpoint/src/main/webapp/WEB-INF/wsdl/EBookStoreImplService.wsdl</wsdlFile>
30+
</wsdlFiles>
31+
<wsdlLocation>http://localhost:8080/jaxws-endpoint/EBookStoreImplService?wsdl</wsdlLocation>
32+
<verbose>true</verbose>
33+
<sourceDestDir>${basedir}/src/main/java</sourceDestDir>
34+
<target>2.1</target>
35+
</configuration>
36+
</execution>
37+
</executions>
38+
</plugin>
39+
</plugins>
40+
</build>
41+
</project>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
package org.javaee7.jaxws.client.gen;
3+
4+
import javax.xml.bind.annotation.XmlAccessType;
5+
import javax.xml.bind.annotation.XmlAccessorType;
6+
import javax.xml.bind.annotation.XmlType;
7+
8+
9+
/**
10+
* <p>Java class for addAppendix complex type.
11+
*
12+
* <p>The following schema fragment specifies the expected content contained within this class.
13+
*
14+
* <pre>
15+
* &lt;complexType name="addAppendix">
16+
* &lt;complexContent>
17+
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
18+
* &lt;sequence>
19+
* &lt;element name="arg0" type="{http://endpoint.jaxws.javaee7.org/}eBook" minOccurs="0"/>
20+
* &lt;element name="arg1" type="{http://www.w3.org/2001/XMLSchema}int"/>
21+
* &lt;/sequence>
22+
* &lt;/restriction>
23+
* &lt;/complexContent>
24+
* &lt;/complexType>
25+
* </pre>
26+
*
27+
*
28+
*/
29+
@XmlAccessorType(XmlAccessType.FIELD)
30+
@XmlType(name = "addAppendix", propOrder = {
31+
"arg0",
32+
"arg1"
33+
})
34+
public class AddAppendix {
35+
36+
protected EBook arg0;
37+
protected int arg1;
38+
39+
/**
40+
* Gets the value of the arg0 property.
41+
*
42+
* @return
43+
* possible object is
44+
* {@link EBook }
45+
*
46+
*/
47+
public EBook getArg0() {
48+
return arg0;
49+
}
50+
51+
/**
52+
* Sets the value of the arg0 property.
53+
*
54+
* @param value
55+
* allowed object is
56+
* {@link EBook }
57+
*
58+
*/
59+
public void setArg0(EBook value) {
60+
this.arg0 = value;
61+
}
62+
63+
/**
64+
* Gets the value of the arg1 property.
65+
*
66+
*/
67+
public int getArg1() {
68+
return arg1;
69+
}
70+
71+
/**
72+
* Sets the value of the arg1 property.
73+
*
74+
*/
75+
public void setArg1(int value) {
76+
this.arg1 = value;
77+
}
78+
79+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
package org.javaee7.jaxws.client.gen;
3+
4+
import javax.xml.bind.annotation.XmlAccessType;
5+
import javax.xml.bind.annotation.XmlAccessorType;
6+
import javax.xml.bind.annotation.XmlElement;
7+
import javax.xml.bind.annotation.XmlType;
8+
9+
10+
/**
11+
* <p>Java class for addAppendixResponse complex type.
12+
*
13+
* <p>The following schema fragment specifies the expected content contained within this class.
14+
*
15+
* <pre>
16+
* &lt;complexType name="addAppendixResponse">
17+
* &lt;complexContent>
18+
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
19+
* &lt;sequence>
20+
* &lt;element name="return" type="{http://endpoint.jaxws.javaee7.org/}eBook" minOccurs="0"/>
21+
* &lt;/sequence>
22+
* &lt;/restriction>
23+
* &lt;/complexContent>
24+
* &lt;/complexType>
25+
* </pre>
26+
*
27+
*
28+
*/
29+
@XmlAccessorType(XmlAccessType.FIELD)
30+
@XmlType(name = "addAppendixResponse", propOrder = {
31+
"_return"
32+
})
33+
public class AddAppendixResponse {
34+
35+
@XmlElement(name = "return")
36+
protected EBook _return;
37+
38+
/**
39+
* Gets the value of the return property.
40+
*
41+
* @return
42+
* possible object is
43+
* {@link EBook }
44+
*
45+
*/
46+
public EBook getReturn() {
47+
return _return;
48+
}
49+
50+
/**
51+
* Sets the value of the return property.
52+
*
53+
* @param value
54+
* allowed object is
55+
* {@link EBook }
56+
*
57+
*/
58+
public void setReturn(EBook value) {
59+
this._return = value;
60+
}
61+
62+
}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
2+
package org.javaee7.jaxws.client.gen;
3+
4+
import java.util.ArrayList;
5+
import java.util.List;
6+
import javax.xml.bind.annotation.XmlAccessType;
7+
import javax.xml.bind.annotation.XmlAccessorType;
8+
import javax.xml.bind.annotation.XmlElement;
9+
import javax.xml.bind.annotation.XmlType;
10+
11+
12+
/**
13+
* <p>Java class for eBook complex type.
14+
*
15+
* <p>The following schema fragment specifies the expected content contained within this class.
16+
*
17+
* <pre>
18+
* &lt;complexType name="eBook">
19+
* &lt;complexContent>
20+
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
21+
* &lt;sequence>
22+
* &lt;element name="notes" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
23+
* &lt;element name="numPages" type="{http://www.w3.org/2001/XMLSchema}int"/>
24+
* &lt;element name="price" type="{http://www.w3.org/2001/XMLSchema}double"/>
25+
* &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
26+
* &lt;/sequence>
27+
* &lt;/restriction>
28+
* &lt;/complexContent>
29+
* &lt;/complexType>
30+
* </pre>
31+
*
32+
*
33+
*/
34+
@XmlAccessorType(XmlAccessType.FIELD)
35+
@XmlType(name = "eBook", propOrder = {
36+
"notes",
37+
"numPages",
38+
"price",
39+
"title"
40+
})
41+
public class EBook {
42+
43+
@XmlElement(nillable = true)
44+
protected List<String> notes;
45+
protected int numPages;
46+
protected double price;
47+
protected String title;
48+
49+
/**
50+
* Gets the value of the notes property.
51+
*
52+
* <p>
53+
* This accessor method returns a reference to the live list,
54+
* not a snapshot. Therefore any modification you make to the
55+
* returned list will be present inside the JAXB object.
56+
* This is why there is not a <CODE>set</CODE> method for the notes property.
57+
*
58+
* <p>
59+
* For example, to add a new item, do as follows:
60+
* <pre>
61+
* getNotes().add(newItem);
62+
* </pre>
63+
*
64+
*
65+
* <p>
66+
* Objects of the following type(s) are allowed in the list
67+
* {@link String }
68+
*
69+
*
70+
*/
71+
public List<String> getNotes() {
72+
if (notes == null) {
73+
notes = new ArrayList<String>();
74+
}
75+
return this.notes;
76+
}
77+
78+
/**
79+
* Gets the value of the numPages property.
80+
*
81+
*/
82+
public int getNumPages() {
83+
return numPages;
84+
}
85+
86+
/**
87+
* Sets the value of the numPages property.
88+
*
89+
*/
90+
public void setNumPages(int value) {
91+
this.numPages = value;
92+
}
93+
94+
/**
95+
* Gets the value of the price property.
96+
*
97+
*/
98+
public double getPrice() {
99+
return price;
100+
}
101+
102+
/**
103+
* Sets the value of the price property.
104+
*
105+
*/
106+
public void setPrice(double value) {
107+
this.price = value;
108+
}
109+
110+
/**
111+
* Gets the value of the title property.
112+
*
113+
* @return
114+
* possible object is
115+
* {@link String }
116+
*
117+
*/
118+
public String getTitle() {
119+
return title;
120+
}
121+
122+
/**
123+
* Sets the value of the title property.
124+
*
125+
* @param value
126+
* allowed object is
127+
* {@link String }
128+
*
129+
*/
130+
public void setTitle(String value) {
131+
this.title = value;
132+
}
133+
134+
}

0 commit comments

Comments
 (0)