getEncodingStyles();
64 |
65 | /**
66 | * Set the namespace URI for this SOAP header fault.
67 | *
68 | * @param namespaceURI the desired namespace URI
69 | */
70 | void setNamespaceURI(String namespaceURI);
71 |
72 | /**
73 | * Get the namespace URI for this SOAP header fault.
74 | */
75 | String getNamespaceURI();
76 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/extensions/soap/SOAPOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2001, 2005
3 | */
4 |
5 | package javax.wsdl.extensions.soap;
6 |
7 | import javax.wsdl.extensions.*;
8 |
9 | /**
10 | * This class stores information associated with a SOAP operation that
11 | * acts as the concrete implementation of an abstract operation specified
12 | * in WSDL.
13 | *
14 | * @author Nirmal Mukhi (nmukhi@us.ibm.com)
15 | * @author Matthew J. Duftler (duftler@us.ibm.com)
16 | */
17 | public interface SOAPOperation extends ExtensibilityElement,
18 | java.io.Serializable
19 | {
20 | /**
21 | * Set the SOAP action attribute.
22 | *
23 | * @param soapActionURI the desired value of the SOAP
24 | * action header for this operation.
25 | */
26 | void setSoapActionURI(String soapActionURI);
27 |
28 | /**
29 | * Get the value of the SOAP action attribute.
30 | *
31 | * @return the SOAP action attribute's value
32 | */
33 | String getSoapActionURI();
34 |
35 | /**
36 | * Set the style for this SOAP operation.
37 | *
38 | * @param style the desired style
39 | */
40 | void setStyle(String style);
41 |
42 | /**
43 | * Get the style for this SOAP operation.
44 | */
45 | String getStyle();
46 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/extensions/soap12/SOAP12Address.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2006
3 | */
4 |
5 | package javax.wsdl.extensions.soap12;
6 |
7 | import javax.wsdl.extensions.*;
8 |
9 | /**
10 | * Copied from javax.wsdl.extensions.soap.SOAPAddress.
11 | */
12 | public interface SOAP12Address extends ExtensibilityElement, java.io.Serializable
13 | {
14 | /**
15 | * Set the location URI for this SOAP address.
16 | *
17 | * @param locationURI the desired location URI
18 | */
19 | void setLocationURI(String locationURI);
20 |
21 | /**
22 | * Get the location URI for this SOAP address.
23 | */
24 | String getLocationURI();
25 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/extensions/soap12/SOAP12Binding.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 20016
3 | */
4 |
5 | package javax.wsdl.extensions.soap12;
6 |
7 | import javax.wsdl.extensions.*;
8 |
9 | /**
10 | * Copied from javax.wsdl.extensions.soap.SOAPBinding.
11 | */
12 | public interface SOAP12Binding extends ExtensibilityElement, java.io.Serializable
13 | {
14 | /**
15 | * Set the style for this SOAP binding.
16 | *
17 | * @param style the desired style
18 | */
19 | void setStyle(String style);
20 |
21 | /**
22 | * Get the style for this SOAP binding.
23 | */
24 | String getStyle();
25 |
26 | /**
27 | * Set the SOAP transport URI to be used for communicating
28 | * with this binding.
29 | *
30 | * @param transportURI the URI describing the transport
31 | * to be used
32 | */
33 | void setTransportURI(String transportURI);
34 |
35 | /**
36 | * Get the transport URI to be used with this binding.
37 | *
38 | * @return the transport URI to be used
39 | */
40 | String getTransportURI();
41 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/extensions/soap12/SOAP12Body.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2006
3 | */
4 |
5 | package javax.wsdl.extensions.soap12;
6 |
7 | import java.util.*;
8 | import javax.wsdl.extensions.*;
9 |
10 | /**
11 | * Based on javax.wsdl.extensions.SOAPBody.
12 | */
13 | public interface SOAP12Body extends ExtensibilityElement, java.io.Serializable
14 | {
15 | /**
16 | * Set the parts for this SOAP body.
17 | *
18 | * @param parts the desired parts
19 | */
20 | void setParts(List parts);
21 |
22 | /**
23 | * Get the parts for this SOAP body.
24 | */
25 | List getParts();
26 |
27 | /**
28 | * Set the use for this SOAP body.
29 | *
30 | * @param use the desired use
31 | */
32 | void setUse(String use);
33 |
34 | /**
35 | * Get the use for this SOAP body.
36 | */
37 | String getUse();
38 |
39 | /**
40 | * Set the encodingStyle for this SOAP body.
41 | *
42 | * @param encodingStyle the desired encodingStyle
43 | */
44 | void setEncodingStyle(String encodingStyle);
45 |
46 | /**
47 | * Get the encodingStyle for this SOAP body.
48 | */
49 | String getEncodingStyle();
50 |
51 | /**
52 | * Set the namespace URI for this SOAP body.
53 | *
54 | * @param namespaceURI the desired namespace URI
55 | */
56 | void setNamespaceURI(String namespaceURI);
57 |
58 | /**
59 | * Get the namespace URI for this SOAP body.
60 | */
61 | String getNamespaceURI();
62 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/extensions/soap12/SOAP12Fault.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2006
3 | */
4 |
5 | package javax.wsdl.extensions.soap12;
6 |
7 | import javax.wsdl.extensions.*;
8 |
9 | /**
10 | * Based on javax.wsdl.extensions.SOAPFault.
11 | */
12 | public interface SOAP12Fault extends ExtensibilityElement, java.io.Serializable
13 | {
14 | /**
15 | * Set the name for this SOAP fault.
16 | *
17 | * @param name the desired name
18 | */
19 | void setName(String name);
20 |
21 | /**
22 | * Get the name for this SOAP fault.
23 | */
24 | String getName();
25 |
26 | /**
27 | * Set the use for this SOAP fault.
28 | *
29 | * @param use the desired use
30 | */
31 | void setUse(String use);
32 |
33 | /**
34 | * Get the use for this SOAP fault.
35 | */
36 | String getUse();
37 |
38 | /**
39 | * Set the encodingStyle for this SOAP fault.
40 | *
41 | * @param encodingStyle the desired encodingStyle
42 | */
43 | void setEncodingStyle(String encodingStyle);
44 |
45 | /**
46 | * Get the encodingStyle for this SOAP fault.
47 | */
48 | String getEncodingStyle();
49 |
50 | /**
51 | * Set the namespace URI for this SOAP fault.
52 | *
53 | * @param namespaceURI the desired namespace URI
54 | */
55 | void setNamespaceURI(String namespaceURI);
56 |
57 | /**
58 | * Get the namespace URI for this SOAP fault.
59 | */
60 | String getNamespaceURI();
61 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/extensions/soap12/SOAP12Header.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2006
3 | */
4 |
5 | package javax.wsdl.extensions.soap12;
6 |
7 | import java.util.*;
8 | import javax.wsdl.extensions.*;
9 | import javax.xml.namespace.*;
10 |
11 | /**
12 | * Based on javax.wsdl.extensions.SOAPHeader.
13 | */
14 | public interface SOAP12Header extends ExtensibilityElement, java.io.Serializable
15 | {
16 | /**
17 | * Set the message for this SOAP header.
18 | *
19 | * @param message the desired message
20 | */
21 | void setMessage(QName message);
22 |
23 | /**
24 | * Get the message for this SOAP header.
25 | */
26 | QName getMessage();
27 |
28 | /**
29 | * Set the part for this SOAP header.
30 | *
31 | * @param part the desired part
32 | */
33 | void setPart(String part);
34 |
35 | /**
36 | * Get the part for this SOAP header.
37 | */
38 | String getPart();
39 |
40 | /**
41 | * Set the use for this SOAP header.
42 | *
43 | * @param use the desired use
44 | */
45 | void setUse(String use);
46 |
47 | /**
48 | * Get the use for this SOAP header.
49 | */
50 | String getUse();
51 |
52 | /**
53 | * Set the encodingStyle for this SOAP header.
54 | *
55 | * @param encodingStyle the desired encodingStyle
56 | */
57 | void setEncodingStyle(String encodingStyle);
58 |
59 | /**
60 | * Get the encodingStyle for this SOAP header.
61 | */
62 | String getEncodingStyle();
63 |
64 | /**
65 | * Set the namespace URI for this SOAP header.
66 | *
67 | * @param namespaceURI the desired namespace URI
68 | */
69 | void setNamespaceURI(String namespaceURI);
70 |
71 | /**
72 | * Get the namespace URI for this SOAP header.
73 | */
74 | String getNamespaceURI();
75 |
76 | /**
77 | * Add a SOAP header fault.
78 | *
79 | * @param soap12HeaderFault the SOAP Header fault to be added.
80 | */
81 | void addSOAP12HeaderFault(SOAP12HeaderFault soap12HeaderFault);
82 |
83 | /**
84 | * Get a list of all SOAP header faults contained in this SOAP header.
85 | *
86 | * @return a list of all SOAP header faults contained in this SOAP header.
87 | */
88 | List getSOAP12HeaderFaults();
89 |
90 | /**
91 | * Remove a SOAP header fault.
92 | *
93 | * @param soap12HeaderFault the SOAP header fault to be removed.
94 | * @return the SOAP header fault which was removed.
95 | */
96 | SOAP12HeaderFault removeSOAP12HeaderFault(SOAP12HeaderFault soap12HeaderFault);
97 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/extensions/soap12/SOAP12HeaderFault.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2006
3 | */
4 |
5 | package javax.wsdl.extensions.soap12;
6 |
7 | import javax.wsdl.extensions.*;
8 | import javax.xml.namespace.*;
9 |
10 | /**
11 | * Based on javax.wsdl.extensions.SOAPHeaderFault.
12 | */
13 | public interface SOAP12HeaderFault extends ExtensibilityElement,
14 | java.io.Serializable
15 | {
16 | /**
17 | * Set the message for this SOAP header fault.
18 | *
19 | * @param message the desired message
20 | */
21 | void setMessage(QName message);
22 |
23 | /**
24 | * Get the message for this SOAP header fault.
25 | */
26 | QName getMessage();
27 |
28 | /**
29 | * Set the part for this SOAP header fault.
30 | *
31 | * @param part the desired part
32 | */
33 | void setPart(String part);
34 |
35 | /**
36 | * Get the part for this SOAP header fault.
37 | */
38 | String getPart();
39 |
40 | /**
41 | * Set the use for this SOAP header fault.
42 | *
43 | * @param use the desired use
44 | */
45 | void setUse(String use);
46 |
47 | /**
48 | * Get the use for this SOAP header fault.
49 | */
50 | String getUse();
51 |
52 | /**
53 | * Set the encodingStyle for this SOAP header fault.
54 | *
55 | * @param encodingStyle the desired encodingStyle
56 | */
57 | void setEncodingStyle(String encodingStyle);
58 |
59 | /**
60 | * Get the encodingStyle for this SOAP header fault.
61 | */
62 | String getEncodingStyle();
63 |
64 | /**
65 | * Set the namespace URI for this SOAP header fault.
66 | *
67 | * @param namespaceURI the desired namespace URI
68 | */
69 | void setNamespaceURI(String namespaceURI);
70 |
71 | /**
72 | * Get the namespace URI for this SOAP header fault.
73 | */
74 | String getNamespaceURI();
75 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/extensions/soap12/SOAP12Operation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2006
3 | */
4 |
5 | package javax.wsdl.extensions.soap12;
6 |
7 | import javax.wsdl.extensions.*;
8 |
9 | /**
10 | * Based on javax.wsdl.extensions.SOAPOperation.
11 | */
12 | public interface SOAP12Operation extends ExtensibilityElement,
13 | java.io.Serializable
14 | {
15 | /**
16 | * Set the SOAP action attribute.
17 | *
18 | * @param soapActionURI the desired value of the SOAP
19 | * action header for this operation.
20 | */
21 | void setSoapActionURI(String soapActionURI);
22 |
23 | /**
24 | * Get the value of the SOAP action attribute.
25 | *
26 | * @return the SOAP action attribute's value
27 | */
28 | String getSoapActionURI();
29 |
30 | /**
31 | * Specify whether the SOAP Action is required for this operation.
32 | *
33 | * @param soapActionRequired true if the SOAP Action is required, otherwise false.
34 | */
35 | void setSoapActionRequired(Boolean soapActionRequired);
36 |
37 | /**
38 | * Indicates whether the SOAP Action is required for this operation.
39 | *
40 | * @return true if the SOAP action is required, otherwise false.
41 | */
42 | Boolean getSoapActionRequired();
43 |
44 | /**
45 | * Set the style for this SOAP operation.
46 | *
47 | * @param style the desired style
48 | */
49 | void setStyle(String style);
50 |
51 | /**
52 | * Get the style for this SOAP operation.
53 | */
54 | String getStyle();
55 | }
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/xml/WSDLLocator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2002, 2006
3 | */
4 |
5 | package javax.wsdl.xml;
6 |
7 | import org.xml.sax.*;
8 |
9 | /**
10 | * This interface can act as an additional layer of indirection between
11 | * a WSDLReader and the actual location of WSDL documents. One
12 | * use could be to retrieve WSDL documents from JAR files, while still
13 | * retaining the ability to resolve imported documents using relative
14 | * URIs.
15 | *
16 | * @author Owen Burroughs (owenb@uk.ibm.com)
17 | *
18 | * @see WSDLReader#readWSDL(WSDLLocator)
19 | */
20 | public interface WSDLLocator
21 | {
22 | /**
23 | * Returns an InputSource "pointed at" the base document.
24 | *
25 | * @return the InputSource object or null if the base document could
26 | * not be found
27 | */
28 | InputSource getBaseInputSource();
29 |
30 | /**
31 | * Returns an InputSource "pointed at" an imported wsdl document.
32 | *
33 | * @param parentLocation a URI specifying the location of the
34 | * document doing the importing. This can be null if the import location
35 | * is not relative to the parent location.
36 | * @param importLocation a URI specifying the location of the
37 | * document to import. This might be relative to the parent document's
38 | * location.
39 | * @return the InputSource object or null if the import cannot be found.
40 | */
41 | InputSource getImportInputSource(String parentLocation,
42 | String importLocation);
43 |
44 | /**
45 | * Returns a URI representing the location of the base document.
46 | */
47 | String getBaseURI();
48 |
49 | /**
50 | * Returns a URI representing the location of the last import document
51 | * to be resolved. This is used in resolving nested imports where an
52 | * import location is relative to the parent document.
53 | */
54 | String getLatestImportURI();
55 |
56 | /**
57 | * Releases all associated system resources such as the InputStreams
58 | * associated with the Base and Import InputSources.
59 | */
60 | void close();
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/src/main/java/javax/wsdl/xml/WSDLWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * (c) Copyright IBM Corp 2001, 2005
3 | */
4 |
5 | package javax.wsdl.xml;
6 |
7 | import java.io.*;
8 | import org.w3c.dom.*;
9 | import javax.wsdl.*;
10 |
11 | /**
12 | * This interface describes a collection of methods
13 | * that allow a WSDL model to be written to a writer
14 | * in an XML format that follows the WSDL schema.
15 | *
16 | * @author Matthew J. Duftler
17 | */
18 | public interface WSDLWriter
19 | {
20 | /**
21 | * Sets the specified feature to the specified value.
22 | *
23 | * There are no minimum features that must be supported.
24 | *
25 | * All feature names must be fully-qualified, Java package style. All
26 | * names starting with javax.wsdl. are reserved for features defined
27 | * by the JWSDL specification. It is recommended that implementation-
28 | * specific features be fully-qualified to match the package name
29 | * of that implementation. For example: com.abc.featureName
30 | *
31 | * @param name the name of the feature to be set.
32 | * @param value the value to set the feature to.
33 | * @throws IllegalArgumentException if the feature name is not recognized.
34 | * @see #getFeature(String)
35 | */
36 | void setFeature(String name, boolean value)
37 | throws IllegalArgumentException;
38 |
39 | /**
40 | * Gets the value of the specified feature.
41 | *
42 | * @param name the name of the feature to get the value of.
43 | * @return the value of the feature.
44 | * @throws IllegalArgumentException if the feature name is not recognized.
45 | * @see #setFeature(String, boolean)
46 | */
47 | boolean getFeature(String name) throws IllegalArgumentException;
48 |
49 | /**
50 | * Return a document generated from the specified WSDL model.
51 | */
52 | Document getDocument(Definition wsdlDef) throws WSDLException;
53 |
54 | /**
55 | * Write the specified WSDL definition to the specified Writer.
56 | *
57 | * @param wsdlDef the WSDL definition to be written.
58 | * @param sink the Writer to write the xml to.
59 | */
60 | void writeWSDL(Definition wsdlDef, Writer sink)
61 | throws WSDLException;
62 |
63 | /**
64 | * Write the specified WSDL definition to the specified OutputStream.
65 | *
66 | * @param wsdlDef the WSDL definition to be written.
67 | * @param sink the OutputStream to write the xml to.
68 | */
69 | void writeWSDL(Definition wsdlDef, OutputStream sink)
70 | throws WSDLException;
71 | }
--------------------------------------------------------------------------------
/src/test/java/FaultTest.java:
--------------------------------------------------------------------------------
1 | import org.junit.jupiter.api.Test;
2 | import javax.wsdl.*;
3 | import javax.wsdl.factory.WSDLFactory;
4 |
5 | import static org.junit.jupiter.api.Assertions.*;
6 |
7 | public class FaultTest {
8 |
9 | @Test
10 | public void testFaultElement() throws Exception {
11 | WSDLFactory factory = WSDLFactory.newInstance();
12 | Definition definition = factory.newDefinition();
13 |
14 | // Create a new operation with a fault
15 | Operation operation = definition.createOperation();
16 | operation.setName("testOperation");
17 |
18 | Fault fault = definition.createFault();
19 | fault.setName("TestFault");
20 | fault.setDocumentationElement(definition.getDocumentationElement());
21 |
22 | operation.addFault(fault);
23 |
24 | // Check the fault name and linkage
25 | assertEquals("TestFault", operation.getFault("TestFault").getName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/SOAPBindingTest.java:
--------------------------------------------------------------------------------
1 | import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
2 | import org.junit.jupiter.api.Test;
3 | import javax.wsdl.*;
4 | import javax.wsdl.extensions.*;
5 | import javax.wsdl.extensions.soap.SOAPBinding;
6 | import javax.wsdl.factory.WSDLFactory;
7 | import javax.xml.namespace.QName;
8 |
9 | import static org.junit.jupiter.api.Assertions.*;
10 |
11 | public class SOAPBindingTest {
12 |
13 | @Test
14 | public void testSOAPBindingAttributes() throws Exception {
15 | WSDLFactory factory = WSDLFactory.newInstance();
16 | Definition definition = factory.newDefinition();
17 |
18 | // Create and add a SOAP binding to the definition
19 | SOAPBinding soapBinding = new SOAPBindingImpl();
20 | soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
21 | soapBinding.setStyle("document");
22 |
23 | Binding binding = definition.createBinding();
24 | binding.setQName(new QName("http://www.example.com/sample", "SampleBinding"));
25 | binding.addExtensibilityElement(soapBinding);
26 |
27 | // Validate SOAP binding properties
28 | assertEquals("http://schemas.xmlsoap.org/soap/http", soapBinding.getTransportURI());
29 | assertEquals("document", soapBinding.getStyle());
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/resources/sample.wsdl:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------