├── .github ├── dependabot.yml └── workflows │ ├── codeql.yml │ └── maven.yml ├── .gitignore ├── License.txt ├── README.md ├── pom.xml └── src ├── main └── java │ ├── com │ └── ibm │ │ └── wsdl │ │ ├── AbstractWSDLElement.java │ │ ├── BindingFaultImpl.java │ │ ├── BindingImpl.java │ │ ├── BindingInputImpl.java │ │ ├── BindingOperationImpl.java │ │ ├── BindingOutputImpl.java │ │ ├── Constants.java │ │ ├── DefinitionImpl.java │ │ ├── FaultImpl.java │ │ ├── ImportImpl.java │ │ ├── InputImpl.java │ │ ├── MessageImpl.java │ │ ├── OperationImpl.java │ │ ├── OutputImpl.java │ │ ├── PartImpl.java │ │ ├── PortImpl.java │ │ ├── PortTypeImpl.java │ │ ├── ServiceImpl.java │ │ ├── TypesImpl.java │ │ ├── extensions │ │ ├── PopulatedExtensionRegistry.java │ │ ├── http │ │ │ ├── HTTPAddressImpl.java │ │ │ ├── HTTPAddressSerializer.java │ │ │ ├── HTTPBindingImpl.java │ │ │ ├── HTTPBindingSerializer.java │ │ │ ├── HTTPConstants.java │ │ │ ├── HTTPOperationImpl.java │ │ │ ├── HTTPOperationSerializer.java │ │ │ ├── HTTPUrlEncodedImpl.java │ │ │ ├── HTTPUrlEncodedSerializer.java │ │ │ ├── HTTPUrlReplacementImpl.java │ │ │ └── HTTPUrlReplacementSerializer.java │ │ ├── mime │ │ │ ├── MIMEConstants.java │ │ │ ├── MIMEContentImpl.java │ │ │ ├── MIMEContentSerializer.java │ │ │ ├── MIMEMimeXmlImpl.java │ │ │ ├── MIMEMimeXmlSerializer.java │ │ │ ├── MIMEMultipartRelatedImpl.java │ │ │ ├── MIMEMultipartRelatedSerializer.java │ │ │ └── MIMEPartImpl.java │ │ ├── schema │ │ │ ├── SchemaConstants.java │ │ │ ├── SchemaDeserializer.java │ │ │ ├── SchemaImpl.java │ │ │ ├── SchemaImportImpl.java │ │ │ ├── SchemaReferenceImpl.java │ │ │ └── SchemaSerializer.java │ │ ├── soap │ │ │ ├── SOAPAddressImpl.java │ │ │ ├── SOAPAddressSerializer.java │ │ │ ├── SOAPBindingImpl.java │ │ │ ├── SOAPBindingSerializer.java │ │ │ ├── SOAPBodyImpl.java │ │ │ ├── SOAPBodySerializer.java │ │ │ ├── SOAPConstants.java │ │ │ ├── SOAPFaultImpl.java │ │ │ ├── SOAPFaultSerializer.java │ │ │ ├── SOAPHeaderFaultImpl.java │ │ │ ├── SOAPHeaderImpl.java │ │ │ ├── SOAPHeaderSerializer.java │ │ │ ├── SOAPOperationImpl.java │ │ │ └── SOAPOperationSerializer.java │ │ └── soap12 │ │ │ ├── SOAP12AddressImpl.java │ │ │ ├── SOAP12AddressSerializer.java │ │ │ ├── SOAP12BindingImpl.java │ │ │ ├── SOAP12BindingSerializer.java │ │ │ ├── SOAP12BodyImpl.java │ │ │ ├── SOAP12BodySerializer.java │ │ │ ├── SOAP12Constants.java │ │ │ ├── SOAP12FaultImpl.java │ │ │ ├── SOAP12FaultSerializer.java │ │ │ ├── SOAP12HeaderFaultImpl.java │ │ │ ├── SOAP12HeaderImpl.java │ │ │ ├── SOAP12HeaderSerializer.java │ │ │ ├── SOAP12OperationImpl.java │ │ │ └── SOAP12OperationSerializer.java │ │ ├── factory │ │ └── WSDLFactoryImpl.java │ │ ├── util │ │ ├── IOUtils.java │ │ ├── ObjectRegistry.java │ │ ├── StringUtils.java │ │ └── xml │ │ │ ├── DOM2Writer.java │ │ │ ├── DOMUtils.java │ │ │ ├── QNameUtils.java │ │ │ └── XPathUtils.java │ │ └── xml │ │ ├── WSDLReaderImpl.java │ │ └── WSDLWriterImpl.java │ └── javax │ └── wsdl │ ├── Binding.java │ ├── BindingFault.java │ ├── BindingInput.java │ ├── BindingOperation.java │ ├── BindingOutput.java │ ├── Definition.java │ ├── Fault.java │ ├── Import.java │ ├── Input.java │ ├── Message.java │ ├── Operation.java │ ├── OperationType.java │ ├── Output.java │ ├── Part.java │ ├── Port.java │ ├── PortType.java │ ├── Service.java │ ├── Types.java │ ├── WSDLElement.java │ ├── WSDLException.java │ ├── extensions │ ├── AttributeExtensible.java │ ├── ElementExtensible.java │ ├── ExtensibilityElement.java │ ├── ExtensionDeserializer.java │ ├── ExtensionRegistry.java │ ├── ExtensionSerializer.java │ ├── UnknownExtensibilityElement.java │ ├── UnknownExtensionDeserializer.java │ ├── UnknownExtensionSerializer.java │ ├── http │ │ ├── HTTPAddress.java │ │ ├── HTTPBinding.java │ │ ├── HTTPOperation.java │ │ ├── HTTPUrlEncoded.java │ │ └── HTTPUrlReplacement.java │ ├── mime │ │ ├── MIMEContent.java │ │ ├── MIMEMimeXml.java │ │ ├── MIMEMultipartRelated.java │ │ └── MIMEPart.java │ ├── schema │ │ ├── Schema.java │ │ ├── SchemaImport.java │ │ └── SchemaReference.java │ ├── soap │ │ ├── SOAPAddress.java │ │ ├── SOAPBinding.java │ │ ├── SOAPBody.java │ │ ├── SOAPFault.java │ │ ├── SOAPHeader.java │ │ ├── SOAPHeaderFault.java │ │ └── SOAPOperation.java │ └── soap12 │ │ ├── SOAP12Address.java │ │ ├── SOAP12Binding.java │ │ ├── SOAP12Body.java │ │ ├── SOAP12Fault.java │ │ ├── SOAP12Header.java │ │ ├── SOAP12HeaderFault.java │ │ └── SOAP12Operation.java │ ├── factory │ └── WSDLFactory.java │ └── xml │ ├── WSDLLocator.java │ ├── WSDLReader.java │ └── WSDLWriter.java └── test ├── java ├── FaultTest.java ├── SOAPBindingTest.java └── WSDLReaderWriterTest.java └── resources └── sample.wsdl /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "maven" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ "master" ] 17 | pull_request: 18 | branches: [ "master" ] 19 | schedule: 20 | - cron: '15 15 * * 0' 21 | 22 | jobs: 23 | analyze: 24 | name: Analyze 25 | # Runner size impacts CodeQL analysis time. To learn more, please see: 26 | # - https://gh.io/recommended-hardware-resources-for-running-codeql 27 | # - https://gh.io/supported-runners-and-hardware-resources 28 | # - https://gh.io/using-larger-runners 29 | # Consider using larger runners for possible analysis time improvements. 30 | runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} 31 | timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} 32 | permissions: 33 | # required for all workflows 34 | security-events: write 35 | 36 | # only required for workflows in private repositories 37 | actions: read 38 | contents: read 39 | 40 | strategy: 41 | fail-fast: false 42 | matrix: 43 | language: [ 'java-kotlin' ] 44 | # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] 45 | # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both 46 | # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both 47 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support 48 | 49 | steps: 50 | - name: Checkout repository 51 | uses: actions/checkout@v4 52 | 53 | - name: Setup java 54 | uses: actions/setup-java@v4 55 | with: 56 | distribution: temurin 57 | java-version: 17 58 | 59 | # Initializes the CodeQL tools for scanning. 60 | - name: Initialize CodeQL 61 | uses: github/codeql-action/init@v3 62 | with: 63 | languages: ${{ matrix.language }} 64 | # If you wish to specify custom queries, you can do so here or in a config file. 65 | # By default, queries listed here will override any specified in a config file. 66 | # Prefix the list here with "+" to use these queries and those in the config file. 67 | 68 | # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 69 | # queries: security-extended,security-and-quality 70 | 71 | 72 | # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). 73 | # If this step fails, then you should remove it and run the build manually (see below) 74 | - name: Autobuild 75 | uses: github/codeql-action/autobuild@v3 76 | 77 | # ℹ️ Command-line programs to run using the OS shell. 78 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun 79 | 80 | # If the Autobuild fails above, remove it and uncomment the following three lines. 81 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. 82 | 83 | # - run: | 84 | # echo "Run, Build Application using script" 85 | # ./location_of_script_within_repo/buildscript.sh 86 | 87 | - name: Perform CodeQL Analysis 88 | uses: github/codeql-action/analyze@v3 89 | with: 90 | category: "/language:${{matrix.language}}" 91 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Maven 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven 3 | 4 | 5 | name: libre-wsdl4j maven build 6 | on: 7 | push: 8 | branches: [ '*' ] 9 | pull_request: 10 | branches: [ master ] 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | build: 17 | runs-on: ubuntu-latest 18 | strategy: 19 | matrix: 20 | # The last 3 LTS releases 21 | # Java 17 is run in codacy-coverage-reporter 22 | java: [ 11, 17, 21 ] 23 | name: Java ${{matrix.java}} 24 | steps: 25 | - uses: actions/checkout@v4.1.1 26 | - name: Setup java 27 | uses: actions/setup-java@v4 28 | with: 29 | distribution: temurin 30 | java-version: ${{matrix.java}} 31 | - name: Build with Maven 32 | run: mvn -B -V clean verify --file pom.xml --no-transfer-progress -Dgpg.skip 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # libre-wsdl4j - A fork of WSDL4J 1.6.3. 2 | 3 | Libre-wsdl4j is a fork of WSDL4J 1.6.3. WSL4j is a Java stub generator for WSDL. Many software projects still depends on WSL4j, so the idea is that libre-wsdl4j should be an actively maintained version of this software on GitHub. 4 | 5 | ![CI](https://github.com/librewsdl4j/libre-wsdl4j/actions/workflows/maven.yml/badge.svg) 6 | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.librewsdl4j/libre-wsdl4j/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.librewsdl4j/libre-wsdl4j) 7 | [![CodeQL](https://github.com/librewsdl4j/libre-wsdl4j/actions/workflows/codeql.yml/badge.svg)](https://github.com/librewsdl4j/libre-wsdl4j/actions/workflows/codeql.yml) 8 | 9 | ## Use libre-wsdl4j as Maven dependency 10 | 11 | Add this to your pom.xml file to use the latest version of OpenPDF: (Now on Maven Central!) 12 | 13 | ```xml 14 | 15 | 16 | io.github.librewsdl4j 17 | libre-wsdl4j 18 | 1.11.0 19 | 20 | ``` 21 | 22 | Download: [libre-wsdl4j 1.10.0 here]([https://github.com/librewsdl4j/libre-wsdl4j/releases/tag/1.8.0](https://github.com/librewsdl4j/libre-wsdl4j/releases/tag/1.10.0))! 23 | 24 | Requires Java 11 or later. 25 | 26 | Pull requests welcome! The last release of the original WSDL4J was in Feb, 2013. 27 | 28 | WSDL4J is described as "The Web Services Description Language for Java Toolkit (WSDL4J) allows the creation, representation, and manipulation of WSDL documents. It is the reference implementation for JSR110 'JWSDL'", by the original authors. 29 | 30 | JSR110 - https://jcp.org/en/jsr/detail?id=110 31 | 32 | This source code was downloaded from the original WSDL4j sourceforge page: https://sourceforge.net/projects/wsdl4j/ 33 | 34 | License: Common Public License 1.0 35 | https://opensource.org/licenses/cpl1.0.php 36 | 37 | 38 | 39 | 40 | "WSDL, that's an anchronym i haven't heard in almost ten years." 41 | "Still big in the enterprise world" - comments on the Internet. 42 | 43 | 44 | ## Maintainer ## 45 | * [@andreasrosdal](https://github.com/andreasrosdal) - Andreas Røsdal 46 | 47 | ## Contributors ## 48 | * [@garydgregory](https://github.com/garydgregory) - Gary Gregory 49 | * [@olivierdepriester](https://github.com/olivierdepriester) - Olivier Depriester 50 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/BindingFaultImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | 9 | import javax.wsdl.*; 10 | 11 | /** 12 | * This class represents a fault binding. That is, it contains 13 | * the information that would be specified in an fault element 14 | * contained within an operation element contained within a 15 | * binding element. 16 | * 17 | * @author Matthew J. Duftler 18 | */ 19 | public class BindingFaultImpl extends AbstractWSDLElement implements BindingFault 20 | { 21 | protected String name = null; 22 | protected List nativeAttributeNames = 23 | Arrays.asList(Constants.BINDING_FAULT_ATTR_NAMES); 24 | 25 | public static final long serialVersionUID = 1; 26 | 27 | /** 28 | * Set the name of this fault binding. 29 | * 30 | * @param name the desired name 31 | */ 32 | @Override 33 | public void setName(String name) 34 | { 35 | this.name = name; 36 | } 37 | 38 | /** 39 | * Get the name of this fault binding. 40 | * 41 | * @return the fault binding name 42 | */ 43 | public String getName() 44 | { 45 | return name; 46 | } 47 | 48 | @Override 49 | public String toString() 50 | { 51 | StringBuffer strBuf = new StringBuffer(); 52 | 53 | strBuf.append("BindingFault: name="); 54 | strBuf.append(name); 55 | 56 | String superString = super.toString(); 57 | if(!superString.equals("")) 58 | { 59 | strBuf.append("\n"); 60 | strBuf.append(superString); 61 | } 62 | 63 | return strBuf.toString(); 64 | } 65 | 66 | /** 67 | * Get the list of local attribute names defined for this element in 68 | * the WSDL specification. 69 | * 70 | * @return a List of Strings, one for each local attribute name 71 | */ 72 | public List getNativeAttributeNames() 73 | { 74 | return nativeAttributeNames; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/BindingInputImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | 9 | import javax.wsdl.*; 10 | 11 | /** 12 | * This class represents an input binding. That is, it contains 13 | * the information that would be specified in an input element 14 | * contained within an operation element contained within a 15 | * binding element. 16 | * 17 | * @author Matthew J. Duftler 18 | */ 19 | public class BindingInputImpl extends AbstractWSDLElement implements BindingInput 20 | { 21 | protected String name = null; 22 | protected List nativeAttributeNames = 23 | Arrays.asList(Constants.BINDING_INPUT_ATTR_NAMES); 24 | 25 | public static final long serialVersionUID = 1; 26 | 27 | /** 28 | * Set the name of this input binding. 29 | * 30 | * @param name the desired name 31 | */ 32 | @Override 33 | public void setName(String name) 34 | { 35 | this.name = name; 36 | } 37 | 38 | /** 39 | * Get the name of this input binding. 40 | * 41 | * @return the input binding name 42 | */ 43 | public String getName() 44 | { 45 | return name; 46 | } 47 | 48 | @Override 49 | public String toString() 50 | { 51 | StringBuffer strBuf = new StringBuffer(); 52 | 53 | strBuf.append("BindingInput: name=" + name); 54 | 55 | String superString = super.toString(); 56 | if(!superString.equals("")) 57 | { 58 | strBuf.append("\n"); 59 | strBuf.append(superString); 60 | } 61 | 62 | return strBuf.toString(); 63 | } 64 | 65 | /** 66 | * Get the list of local attribute names defined for this element in 67 | * the WSDL specification. 68 | * 69 | * @return a List of Strings, one for each local attribute name 70 | */ 71 | public List getNativeAttributeNames() 72 | { 73 | return nativeAttributeNames; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/BindingOutputImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | 9 | import javax.wsdl.*; 10 | 11 | /** 12 | * This class represents an output binding. That is, it contains 13 | * the information that would be specified in an output element 14 | * contained within an operation element contained within a 15 | * binding element. 16 | * 17 | * @author Matthew J. Duftler 18 | */ 19 | public class BindingOutputImpl extends AbstractWSDLElement implements BindingOutput 20 | { 21 | protected String name = null; 22 | protected List nativeAttributeNames = 23 | Arrays.asList(Constants.BINDING_OUTPUT_ATTR_NAMES); 24 | 25 | public static final long serialVersionUID = 1; 26 | 27 | /** 28 | * Set the name of this output binding. 29 | * 30 | * @param name the desired name 31 | */ 32 | @Override 33 | public void setName(String name) 34 | { 35 | this.name = name; 36 | } 37 | 38 | /** 39 | * Get the name of this output binding. 40 | * 41 | * @return the output binding name 42 | */ 43 | public String getName() 44 | { 45 | return name; 46 | } 47 | 48 | @Override 49 | public String toString() 50 | { 51 | StringBuffer strBuf = new StringBuffer(); 52 | 53 | strBuf.append("BindingOutput: name=" + name); 54 | 55 | String superString = super.toString(); 56 | if(!superString.equals("")) 57 | { 58 | strBuf.append("\n"); 59 | strBuf.append(superString); 60 | } 61 | 62 | return strBuf.toString(); 63 | } 64 | 65 | /** 66 | * Get the list of local attribute names defined for this element in 67 | * the WSDL specification. 68 | * 69 | * @return a List of Strings, one for each local attribute name 70 | */ 71 | public List getNativeAttributeNames() 72 | { 73 | return nativeAttributeNames; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/FaultImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | import javax.wsdl.*; 9 | 10 | /** 11 | * This class represents a fault message, and contains the name 12 | * of the fault and the message itself. 13 | * 14 | * @author Matthew J. Duftler 15 | */ 16 | public class FaultImpl extends AbstractWSDLElement implements Fault 17 | { 18 | protected String name = null; 19 | protected Message message = null; 20 | protected List nativeAttributeNames = 21 | Arrays.asList(Constants.FAULT_ATTR_NAMES); 22 | 23 | public static final long serialVersionUID = 1; 24 | 25 | /** 26 | * Set the name of this fault message. 27 | * 28 | * @param name the desired name 29 | */ 30 | @Override 31 | public void setName(String name) 32 | { 33 | this.name = name; 34 | } 35 | 36 | /** 37 | * Get the name of this fault message. 38 | * 39 | * @return the fault message name 40 | */ 41 | public String getName() 42 | { 43 | return name; 44 | } 45 | 46 | @Override 47 | public void setMessage(Message message) 48 | { 49 | this.message = message; 50 | } 51 | 52 | public Message getMessage() 53 | { 54 | return message; 55 | } 56 | 57 | /** 58 | * Get the list of local attribute names defined for this element in 59 | * the WSDL specification. 60 | * 61 | * @return a List of Strings, one for each local attribute name 62 | */ 63 | public List getNativeAttributeNames() 64 | { 65 | return nativeAttributeNames; 66 | } 67 | 68 | @Override 69 | public String toString() 70 | { 71 | StringBuffer strBuf = new StringBuffer(); 72 | 73 | strBuf.append("Fault: name=" + name); 74 | 75 | if (message != null) 76 | { 77 | strBuf.append("\n" + message); 78 | } 79 | 80 | String superString = super.toString(); 81 | if(!superString.equals("")) 82 | { 83 | strBuf.append("\n"); 84 | strBuf.append(superString); 85 | } 86 | 87 | return strBuf.toString(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/ImportImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | import javax.wsdl.*; 9 | 10 | /** 11 | * This class represents an import, and may contain a reference 12 | * to the imported definition. 13 | * 14 | * @author Matthew J. Duftler (duftler@us.ibm.com) 15 | */ 16 | public class ImportImpl extends AbstractWSDLElement implements Import 17 | { 18 | protected String namespaceURI = null; 19 | protected String locationURI = null; 20 | /* 21 | This would need to be made into a generic reference to handle other 22 | types of referenced documents. 23 | */ 24 | protected Definition definition = null; 25 | protected List nativeAttributeNames = 26 | Arrays.asList(Constants.IMPORT_ATTR_NAMES); 27 | 28 | public static final long serialVersionUID = 1; 29 | 30 | @Override 31 | public void setNamespaceURI(String namespaceURI) 32 | { 33 | this.namespaceURI = namespaceURI; 34 | } 35 | 36 | public String getNamespaceURI() 37 | { 38 | return namespaceURI; 39 | } 40 | 41 | @Override 42 | public void setLocationURI(String locationURI) 43 | { 44 | this.locationURI = locationURI; 45 | } 46 | 47 | public String getLocationURI() 48 | { 49 | return locationURI; 50 | } 51 | 52 | /** 53 | * This property can be used to hang a referenced Definition, 54 | * and the top-level Definition (i.e. the one with the <import>) 55 | * will use this Definition when resolving referenced WSDL parts. 56 | * This would need to be made into a generic reference to handle 57 | * other types of referenced documents. 58 | */ 59 | @Override 60 | public void setDefinition(Definition definition) 61 | { 62 | this.definition = definition; 63 | } 64 | 65 | /** 66 | * This property can be used to hang a referenced Definition, 67 | * and the top-level Definition (i.e. the one with the <import>) 68 | * will use this Definition when resolving referenced WSDL parts. 69 | * This would need to be made into a generic reference to handle 70 | * other types of referenced documents. 71 | */ 72 | public Definition getDefinition() 73 | { 74 | return definition; 75 | } 76 | 77 | /** 78 | * Get the list of local attribute names defined for this element in 79 | * the WSDL specification. 80 | * 81 | * @return a List of Strings, one for each local attribute name 82 | */ 83 | public List getNativeAttributeNames() 84 | { 85 | return nativeAttributeNames; 86 | } 87 | 88 | @Override 89 | public String toString() 90 | { 91 | StringBuffer strBuf = new StringBuffer(); 92 | 93 | strBuf.append("Import:"); 94 | 95 | if (namespaceURI != null) 96 | { 97 | strBuf.append("\nnamespaceURI=" + namespaceURI); 98 | } 99 | 100 | if (locationURI != null) 101 | { 102 | strBuf.append("\nlocationURI=" + locationURI); 103 | } 104 | 105 | if (definition != null) 106 | { 107 | //only printing out the defintion URI and TNS to avoid infinite loop 108 | //if there are circular imports 109 | strBuf.append("\ndefinition=" + definition.getDocumentBaseURI()); 110 | strBuf.append("\ndefinition namespaceURI=" + definition.getTargetNamespace()); 111 | } 112 | 113 | String superString = super.toString(); 114 | if(!superString.equals("")) 115 | { 116 | strBuf.append("\n"); 117 | strBuf.append(superString); 118 | } 119 | 120 | return strBuf.toString(); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/InputImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | import javax.wsdl.*; 9 | 10 | /** 11 | * This class represents an input message, and contains the name 12 | * of the input and the message itself. 13 | * 14 | * @author Matthew J. Duftler 15 | */ 16 | public class InputImpl extends AbstractWSDLElement implements Input 17 | { 18 | protected String name = null; 19 | protected Message message = null; 20 | protected List nativeAttributeNames = 21 | Arrays.asList(Constants.INPUT_ATTR_NAMES); 22 | 23 | public static final long serialVersionUID = 1; 24 | 25 | /** 26 | * Set the name of this input message. 27 | * 28 | * @param name the desired name 29 | */ 30 | @Override 31 | public void setName(String name) 32 | { 33 | this.name = name; 34 | } 35 | 36 | /** 37 | * Get the name of this input message. 38 | * 39 | * @return the input message name 40 | */ 41 | public String getName() 42 | { 43 | return name; 44 | } 45 | 46 | @Override 47 | public void setMessage(Message message) 48 | { 49 | this.message = message; 50 | } 51 | 52 | public Message getMessage() 53 | { 54 | return message; 55 | } 56 | 57 | /** 58 | * Get the list of local attribute names defined for this element in 59 | * the WSDL specification. 60 | * 61 | * @return a List of Strings, one for each local attribute name 62 | */ 63 | public List getNativeAttributeNames() 64 | { 65 | return nativeAttributeNames; 66 | } 67 | 68 | @Override 69 | public String toString() 70 | { 71 | StringBuffer strBuf = new StringBuffer(); 72 | 73 | strBuf.append("Input: name=" + name); 74 | 75 | if (message != null) 76 | { 77 | strBuf.append("\n" + message); 78 | } 79 | 80 | String superString = super.toString(); 81 | if(!superString.equals("")) 82 | { 83 | strBuf.append("\n"); 84 | strBuf.append(superString); 85 | } 86 | 87 | return strBuf.toString(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/OutputImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | import javax.wsdl.*; 9 | 10 | /** 11 | * This class represents an output message, and contains the name 12 | * of the output and the message itself. 13 | * 14 | * @author Matthew J. Duftler 15 | */ 16 | public class OutputImpl extends AbstractWSDLElement implements Output 17 | { 18 | protected String name = null; 19 | protected Message message = null; 20 | protected List nativeAttributeNames = 21 | Arrays.asList(Constants.OUTPUT_ATTR_NAMES); 22 | 23 | public static final long serialVersionUID = 1; 24 | 25 | /** 26 | * Set the name of this output message. 27 | * 28 | * @param name the desired name 29 | */ 30 | @Override 31 | public void setName(String name) 32 | { 33 | this.name = name; 34 | } 35 | 36 | /** 37 | * Get the name of this output message. 38 | * 39 | * @return the output message name 40 | */ 41 | public String getName() 42 | { 43 | return name; 44 | } 45 | 46 | @Override 47 | public void setMessage(Message message) 48 | { 49 | this.message = message; 50 | } 51 | 52 | public Message getMessage() 53 | { 54 | return message; 55 | } 56 | 57 | /** 58 | * Get the list of local attribute names defined for this element in 59 | * the WSDL specification. 60 | * 61 | * @return a List of Strings, one for each local attribute name 62 | */ 63 | public List getNativeAttributeNames() 64 | { 65 | return nativeAttributeNames; 66 | } 67 | 68 | @Override 69 | public String toString() 70 | { 71 | StringBuffer strBuf = new StringBuffer(); 72 | 73 | strBuf.append("Output: name=" + name); 74 | 75 | if (message != null) 76 | { 77 | strBuf.append("\n" + message); 78 | } 79 | 80 | String superString = super.toString(); 81 | if(!superString.equals("")) 82 | { 83 | strBuf.append("\n"); 84 | strBuf.append(superString); 85 | } 86 | 87 | return strBuf.toString(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/PartImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | import javax.wsdl.*; 9 | import javax.xml.namespace.*; 10 | 11 | /** 12 | * This class represents a message part and contains the part's 13 | * name, elementName, typeName, and any extensibility attributes. 14 | * 15 | * @author Paul Fremantle 16 | * @author Nirmal Mukhi 17 | * @author Matthew J. Duftler 18 | */ 19 | public class PartImpl extends AbstractWSDLElement implements Part 20 | { 21 | protected String name = null; 22 | protected QName elementName = null; 23 | protected QName typeName = null; 24 | protected List nativeAttributeNames = 25 | Arrays.asList(Constants.PART_ATTR_NAMES); 26 | 27 | public static final long serialVersionUID = 1; 28 | 29 | /** 30 | * Set the name of this part. 31 | * 32 | * @param name the desired name 33 | */ 34 | @Override 35 | public void setName(String name) 36 | { 37 | this.name = name; 38 | } 39 | 40 | /** 41 | * Get the name of this part. 42 | * 43 | * @return the part name 44 | */ 45 | public String getName() 46 | { 47 | return name; 48 | } 49 | 50 | @Override 51 | public void setElementName(QName elementName) 52 | { 53 | this.elementName = elementName; 54 | } 55 | 56 | public QName getElementName() 57 | { 58 | return elementName; 59 | } 60 | 61 | @Override 62 | public void setTypeName(QName typeName) 63 | { 64 | this.typeName = typeName; 65 | } 66 | 67 | public QName getTypeName() 68 | { 69 | return typeName; 70 | } 71 | 72 | /** 73 | * Get the list of local attribute names defined for this element in 74 | * the WSDL specification. 75 | * 76 | * @return a List of Strings, one for each local attribute name 77 | */ 78 | public List getNativeAttributeNames() 79 | { 80 | return nativeAttributeNames; 81 | } 82 | 83 | @Override 84 | public String toString() 85 | { 86 | StringBuffer strBuf = new StringBuffer(); 87 | 88 | strBuf.append("Part: name=" + name); 89 | 90 | if (elementName != null) 91 | { 92 | strBuf.append("\nelementName=" + elementName); 93 | } 94 | 95 | if (typeName != null) 96 | { 97 | strBuf.append("\ntypeName=" + typeName); 98 | } 99 | 100 | String superString = super.toString(); 101 | if(!superString.equals("")) 102 | { 103 | strBuf.append("\n"); 104 | strBuf.append(superString); 105 | } 106 | 107 | return strBuf.toString(); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/PortImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | 9 | import javax.wsdl.*; 10 | 11 | /** 12 | * This class represents a port, an endpoint for the 13 | * functionality described by a particular port type. 14 | * 15 | * @author Paul Fremantle 16 | * @author Nirmal Mukhi 17 | * @author Matthew J. Duftler 18 | */ 19 | public class PortImpl extends AbstractWSDLElement implements Port 20 | { 21 | protected String name = null; 22 | protected Binding binding = null; 23 | protected List nativeAttributeNames = 24 | Arrays.asList(Constants.PORT_ATTR_NAMES); 25 | 26 | public static final long serialVersionUID = 1; 27 | 28 | /** 29 | * Set the name of this port. 30 | * 31 | * @param name the desired name 32 | */ 33 | @Override 34 | public void setName(String name) 35 | { 36 | this.name = name; 37 | } 38 | 39 | /** 40 | * Get the name of this port. 41 | * 42 | * @return the port name 43 | */ 44 | public String getName() 45 | { 46 | return name; 47 | } 48 | 49 | /** 50 | * Set the binding this port should refer to. 51 | * 52 | * @param binding the desired binding 53 | */ 54 | @Override 55 | public void setBinding(Binding binding) 56 | { 57 | this.binding = binding; 58 | } 59 | 60 | /** 61 | * Get the binding this port refers to. 62 | * 63 | * @return the binding associated with this port 64 | */ 65 | public Binding getBinding() 66 | { 67 | return binding; 68 | } 69 | 70 | @Override 71 | public String toString() 72 | { 73 | StringBuffer strBuf = new StringBuffer(); 74 | 75 | strBuf.append("Port: name=" + name); 76 | 77 | if (binding != null) 78 | { 79 | strBuf.append("\n" + binding); 80 | } 81 | 82 | String superString = super.toString(); 83 | if(!superString.equals("")) 84 | { 85 | strBuf.append("\n"); 86 | strBuf.append(superString); 87 | } 88 | 89 | return strBuf.toString(); 90 | } 91 | 92 | /** 93 | * Get the list of local attribute names defined for this element in 94 | * the WSDL specification. 95 | * 96 | * @return a List of Strings, one for each local attribute name 97 | */ 98 | public List getNativeAttributeNames() 99 | { 100 | return nativeAttributeNames; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/ServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | import javax.wsdl.*; 9 | import javax.xml.namespace.*; 10 | 11 | /** 12 | * This class represents a service, which groups related ports to provide some functionality. 13 | * 14 | * @author Paul Fremantle 15 | * @author Nirmal Mukhi 16 | * @author Matthew J. Duftler 17 | */ 18 | public class ServiceImpl extends AbstractWSDLElement implements Service { 19 | private QName name = null; 20 | private final Map ports = new HashMap<>(); 21 | private final List nativeAttributeNames = Arrays.asList(Constants.SERVICE_ATTR_NAMES); 22 | 23 | public static final long serialVersionUID = 1; 24 | 25 | /** 26 | * Set the name of this service. 27 | * 28 | * @param name 29 | * the desired name 30 | */ 31 | @Override 32 | public void setQName(QName name) { 33 | this.name = name; 34 | } 35 | 36 | /** 37 | * Get the name of this service. 38 | * 39 | * @return the service name 40 | */ 41 | public QName getQName() { 42 | return name; 43 | } 44 | 45 | /** 46 | * Add a port to this service. 47 | * 48 | * @param port 49 | * the port to be added 50 | */ 51 | public void addPort(Port port) { 52 | ports.put(port.getName(), port); 53 | } 54 | 55 | /** 56 | * Get the specified port. 57 | * 58 | * @param name 59 | * the name of the desired port. 60 | * @return the corresponding port, or null if there wasn't any matching port 61 | */ 62 | public Port getPort(String name) { 63 | return ports.get(name); 64 | } 65 | 66 | /** 67 | * Remove the specified port. 68 | * 69 | * @param name 70 | * the name of the port to be removed. 71 | * @return the port which was removed 72 | */ 73 | @Override 74 | public Port removePort(String name) { 75 | return ports.remove(name); 76 | } 77 | 78 | /** 79 | * Get all the ports defined here. 80 | */ 81 | public Map getPorts() { 82 | return ports; 83 | } 84 | 85 | @Override 86 | public String toString() { 87 | StringBuilder strBuf = new StringBuilder(); 88 | 89 | strBuf.append("Service: name=" + name); 90 | 91 | if (ports != null) { 92 | Iterator portIterator = ports.values().iterator(); 93 | 94 | while (portIterator.hasNext()) { 95 | strBuf.append("\n" + portIterator.next()); 96 | } 97 | } 98 | 99 | String superString = super.toString(); 100 | if (!superString.equals("")) { 101 | strBuf.append("\n"); 102 | strBuf.append(superString); 103 | } 104 | 105 | return strBuf.toString(); 106 | } 107 | 108 | /** 109 | * Get the list of local attribute names defined for this element in the WSDL specification. 110 | * 111 | * @return a List of Strings, one for each local attribute name 112 | */ 113 | public List getNativeAttributeNames() { 114 | return nativeAttributeNames; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/TypesImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl; 6 | 7 | import java.util.*; 8 | 9 | import javax.wsdl.*; 10 | 11 | /** 12 | * This class represents the <types> section of a WSDL document. 13 | * 14 | * @author Matthew J. Duftler (duftler@us.ibm.com) 15 | */ 16 | public class TypesImpl extends AbstractWSDLElement implements Types 17 | { 18 | protected List nativeAttributeNames = 19 | Arrays.asList(Constants.TYPES_ATTR_NAMES); 20 | 21 | public static final long serialVersionUID = 1; 22 | 23 | @Override 24 | public String toString() 25 | { 26 | StringBuffer strBuf = new StringBuffer(); 27 | 28 | strBuf.append("Types:"); 29 | 30 | String superString = super.toString(); 31 | if(!superString.equals("")) 32 | { 33 | strBuf.append("\n"); 34 | strBuf.append(superString); 35 | } 36 | 37 | return strBuf.toString(); 38 | } 39 | 40 | /** 41 | * Get the list of local attribute names defined for this element in 42 | * the WSDL specification. 43 | * 44 | * @return a List of Strings, one for each local attribute name 45 | */ 46 | public List getNativeAttributeNames() 47 | { 48 | return nativeAttributeNames; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPAddressImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.http.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class HTTPAddressImpl implements HTTPAddress 14 | { 15 | protected QName elementType = HTTPConstants.Q_ELEM_HTTP_ADDRESS; 16 | // Uses the wrapper type so we can tell if it was set or not. 17 | protected Boolean required = null; 18 | protected String locationURI = null; 19 | 20 | public static final long serialVersionUID = 1; 21 | 22 | /** 23 | * Set the type of this extensibility element. 24 | * 25 | * @param elementType the type 26 | */ 27 | @Override 28 | public void setElementType(QName elementType) 29 | { 30 | this.elementType = elementType; 31 | } 32 | 33 | /** 34 | * Get the type of this extensibility element. 35 | * 36 | * @return the extensibility element's type 37 | */ 38 | public QName getElementType() 39 | { 40 | return elementType; 41 | } 42 | 43 | /** 44 | * Set whether or not the semantics of this extension 45 | * are required. Relates to the wsdl:required attribute. 46 | */ 47 | @Override 48 | public void setRequired(Boolean required) 49 | { 50 | this.required = required; 51 | } 52 | 53 | /** 54 | * Get whether or not the semantics of this extension 55 | * are required. Relates to the wsdl:required attribute. 56 | */ 57 | public Boolean getRequired() 58 | { 59 | return required; 60 | } 61 | 62 | /** 63 | * Set the location URI for this HTTP address. 64 | * 65 | * @param locationURI the desired location URI 66 | */ 67 | @Override 68 | public void setLocationURI(String locationURI) 69 | { 70 | this.locationURI = locationURI; 71 | } 72 | 73 | /** 74 | * Get the location URI for this HTTP address. 75 | */ 76 | public String getLocationURI() 77 | { 78 | return locationURI; 79 | } 80 | 81 | @Override 82 | public String toString() 83 | { 84 | StringBuilder strBuf = new StringBuilder(); 85 | 86 | strBuf.append("HTTPAddress (" + elementType + "):"); 87 | strBuf.append("\nrequired=" + required); 88 | 89 | if (locationURI != null) 90 | { 91 | strBuf.append("\nlocationURI=" + locationURI); 92 | } 93 | 94 | return strBuf.toString(); 95 | } 96 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPAddressSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.http.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class HTTPAddressSerializer implements ExtensionSerializer, ExtensionDeserializer, Serializable { 20 | public static final long serialVersionUID = 1; 21 | 22 | public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { 23 | HTTPAddress httpAddress = (HTTPAddress) extension; 24 | 25 | if (httpAddress != null) { 26 | String tagName = DOMUtils.getQualifiedValue(HTTPConstants.NS_URI_HTTP, "address", def); 27 | 28 | pw.print(" <" + tagName); 29 | 30 | DOMUtils.printAttribute(Constants.ATTR_LOCATION, httpAddress.getLocationURI(), pw); 31 | 32 | Boolean required = httpAddress.getRequired(); 33 | 34 | if (required != null) { 35 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); 36 | } 37 | 38 | pw.println("/>"); 39 | } 40 | } 41 | 42 | public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { 43 | HTTPAddress httpAddress = (HTTPAddress) extReg.createExtension(parentType, elementType); 44 | String locationURI = DOMUtils.getAttribute(el, Constants.ATTR_LOCATION); 45 | String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); 46 | 47 | if (locationURI != null) { 48 | httpAddress.setLocationURI(locationURI); 49 | } 50 | 51 | if (requiredStr != null) { 52 | httpAddress.setRequired(Boolean.valueOf(requiredStr)); 53 | } 54 | 55 | return httpAddress; 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPBindingImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.http.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class HTTPBindingImpl implements HTTPBinding { 14 | protected QName elementType = HTTPConstants.Q_ELEM_HTTP_BINDING; 15 | // Uses the wrapper type so we can tell if it was set or not. 16 | protected Boolean required = null; 17 | protected String verb = null; 18 | 19 | public static final long serialVersionUID = 1; 20 | 21 | /** 22 | * Set the type of this extensibility element. 23 | * 24 | * @param elementType 25 | * the type 26 | */ 27 | @Override 28 | public void setElementType(QName elementType) { 29 | this.elementType = elementType; 30 | } 31 | 32 | /** 33 | * Get the type of this extensibility element. 34 | * 35 | * @return the extensibility element's type 36 | */ 37 | public QName getElementType() { 38 | return elementType; 39 | } 40 | 41 | /** 42 | * Set whether or not the semantics of this extension are required. Relates to the wsdl:required attribute. 43 | */ 44 | @Override 45 | public void setRequired(Boolean required) { 46 | this.required = required; 47 | } 48 | 49 | /** 50 | * Get whether or not the semantics of this extension are required. Relates to the wsdl:required attribute. 51 | */ 52 | public Boolean getRequired() { 53 | return required; 54 | } 55 | 56 | /** 57 | * Set the verb for this HTTP binding. 58 | * 59 | * @param verb 60 | * the desired verb 61 | */ 62 | @Override 63 | public void setVerb(String verb) { 64 | this.verb = verb; 65 | } 66 | 67 | /** 68 | * Get the verb for this HTTP binding. 69 | */ 70 | public String getVerb() { 71 | return verb; 72 | } 73 | 74 | @Override 75 | public String toString() { 76 | StringBuilder strBuf = new StringBuilder(); 77 | 78 | strBuf.append("HTTPBinding (" + elementType + "):"); 79 | strBuf.append("\nrequired=" + required); 80 | 81 | if (verb != null) { 82 | strBuf.append("\nverb=" + verb); 83 | } 84 | 85 | return strBuf.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPBindingSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.http.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class HTTPBindingSerializer implements ExtensionSerializer, ExtensionDeserializer, Serializable { 20 | public static final long serialVersionUID = 1; 21 | 22 | public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { 23 | HTTPBinding httpBinding = (HTTPBinding) extension; 24 | 25 | if (httpBinding != null) { 26 | String tagName = DOMUtils.getQualifiedValue(HTTPConstants.NS_URI_HTTP, "binding", def); 27 | 28 | pw.print(" <" + tagName); 29 | 30 | DOMUtils.printAttribute(HTTPConstants.ATTR_VERB, httpBinding.getVerb(), pw); 31 | 32 | Boolean required = httpBinding.getRequired(); 33 | 34 | if (required != null) { 35 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); 36 | } 37 | 38 | pw.println("/>"); 39 | } 40 | } 41 | 42 | public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { 43 | HTTPBinding httpBinding = (HTTPBinding) extReg.createExtension(parentType, elementType); 44 | String verb = DOMUtils.getAttribute(el, HTTPConstants.ATTR_VERB); 45 | String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); 46 | 47 | if (verb != null) { 48 | httpBinding.setVerb(verb); 49 | } 50 | 51 | if (requiredStr != null) { 52 | httpBinding.setRequired(Boolean.valueOf(requiredStr)); 53 | } 54 | 55 | return httpBinding; 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import javax.xml.namespace.*; 8 | import com.ibm.wsdl.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class HTTPConstants { 14 | // Namespace URIs. 15 | public static final String NS_URI_HTTP = "http://schemas.xmlsoap.org/wsdl/http/"; 16 | 17 | // Element names. 18 | public static final String ELEM_ADDRESS = "address"; 19 | public static final String ELEM_URL_ENCODED = "urlEncoded"; 20 | public static final String ELEM_URL_REPLACEMENT = "urlReplacement"; 21 | 22 | // Qualified element names. 23 | public static final QName Q_ELEM_HTTP_BINDING = new QName(NS_URI_HTTP, Constants.ELEM_BINDING); 24 | public static final QName Q_ELEM_HTTP_OPERATION = new QName(NS_URI_HTTP, Constants.ELEM_OPERATION); 25 | public static final QName Q_ELEM_HTTP_ADDRESS = new QName(NS_URI_HTTP, ELEM_ADDRESS); 26 | public static final QName Q_ELEM_HTTP_URL_ENCODED = new QName(NS_URI_HTTP, ELEM_URL_ENCODED); 27 | public static final QName Q_ELEM_HTTP_URL_REPLACEMENT = new QName(NS_URI_HTTP, ELEM_URL_REPLACEMENT); 28 | 29 | // Attribute names. 30 | public static final String ATTR_VERB = "verb"; 31 | 32 | private HTTPConstants() { 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPOperationImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.http.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class HTTPOperationImpl implements HTTPOperation { 14 | protected QName elementType = HTTPConstants.Q_ELEM_HTTP_OPERATION; 15 | // Uses the wrapper type so we can tell if it was set or not. 16 | protected Boolean required = null; 17 | protected String locationURI = null; 18 | 19 | public static final long serialVersionUID = 1; 20 | 21 | /** 22 | * Set the type of this extensibility element. 23 | * 24 | * @param elementType 25 | * the type 26 | */ 27 | @Override 28 | public void setElementType(QName elementType) { 29 | this.elementType = elementType; 30 | } 31 | 32 | /** 33 | * Get the type of this extensibility element. 34 | * 35 | * @return the extensibility element's type 36 | */ 37 | public QName getElementType() { 38 | return elementType; 39 | } 40 | 41 | /** 42 | * Set whether or not the semantics of this extension are required. Relates to the wsdl:required attribute. 43 | */ 44 | @Override 45 | public void setRequired(Boolean required) { 46 | this.required = required; 47 | } 48 | 49 | /** 50 | * Get whether or not the semantics of this extension are required. Relates to the wsdl:required attribute. 51 | */ 52 | public Boolean getRequired() { 53 | return required; 54 | } 55 | 56 | /** 57 | * Set the location URI for this HTTP operation. 58 | * 59 | * @param locationURI 60 | * the desired location URI 61 | */ 62 | @Override 63 | public void setLocationURI(String locationURI) { 64 | this.locationURI = locationURI; 65 | } 66 | 67 | /** 68 | * Get the location URI for this HTTP operation. 69 | */ 70 | public String getLocationURI() { 71 | return locationURI; 72 | } 73 | 74 | @Override 75 | public String toString() { 76 | StringBuilder strBuf = new StringBuilder(); 77 | 78 | strBuf.append("HTTPOperation (" + elementType + "):"); 79 | strBuf.append("\nrequired=" + required); 80 | 81 | if (locationURI != null) { 82 | strBuf.append("\nlocationURI=" + locationURI); 83 | } 84 | 85 | return strBuf.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPOperationSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.http.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class HTTPOperationSerializer implements ExtensionSerializer, ExtensionDeserializer, Serializable { 20 | public static final long serialVersionUID = 1; 21 | 22 | public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { 23 | HTTPOperation httpOperation = (HTTPOperation) extension; 24 | 25 | if (httpOperation != null) { 26 | String tagName = DOMUtils.getQualifiedValue(HTTPConstants.NS_URI_HTTP, "operation", def); 27 | 28 | pw.print(" <" + tagName); 29 | 30 | DOMUtils.printAttribute(Constants.ATTR_LOCATION, httpOperation.getLocationURI(), pw); 31 | 32 | Boolean required = httpOperation.getRequired(); 33 | 34 | if (required != null) { 35 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); 36 | } 37 | 38 | pw.println("/>"); 39 | } 40 | } 41 | 42 | public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { 43 | HTTPOperation httpOperation = (HTTPOperation) extReg.createExtension(parentType, elementType); 44 | String locationURI = DOMUtils.getAttribute(el, Constants.ATTR_LOCATION); 45 | String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); 46 | 47 | if (locationURI != null) { 48 | httpOperation.setLocationURI(locationURI); 49 | } 50 | 51 | if (requiredStr != null) { 52 | httpOperation.setRequired(Boolean.valueOf(requiredStr)); 53 | } 54 | 55 | return httpOperation; 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPUrlEncodedImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.http.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class HTTPUrlEncodedImpl implements HTTPUrlEncoded 14 | { 15 | protected QName elementType = HTTPConstants.Q_ELEM_HTTP_URL_ENCODED; 16 | // Uses the wrapper type so we can tell if it was set or not. 17 | protected Boolean required = null; 18 | 19 | public static final long serialVersionUID = 1; 20 | 21 | /** 22 | * Set the type of this extensibility element. 23 | * 24 | * @param elementType the type 25 | */ 26 | @Override 27 | public void setElementType(QName elementType) 28 | { 29 | this.elementType = elementType; 30 | } 31 | 32 | /** 33 | * Get the type of this extensibility element. 34 | * 35 | * @return the extensibility element's type 36 | */ 37 | public QName getElementType() 38 | { 39 | return elementType; 40 | } 41 | 42 | /** 43 | * Set whether or not the semantics of this extension 44 | * are required. Relates to the wsdl:required attribute. 45 | */ 46 | @Override 47 | public void setRequired(Boolean required) 48 | { 49 | this.required = required; 50 | } 51 | 52 | /** 53 | * Get whether or not the semantics of this extension 54 | * are required. Relates to the wsdl:required attribute. 55 | */ 56 | public Boolean getRequired() 57 | { 58 | return required; 59 | } 60 | 61 | @Override 62 | public String toString() 63 | { 64 | 65 | String strBuf = "HTTPUrlEncoded (" + elementType + "):" + 66 | "\nrequired=" + required; 67 | 68 | return strBuf; 69 | } 70 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPUrlEncodedSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.http.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class HTTPUrlEncodedSerializer implements ExtensionSerializer, ExtensionDeserializer, Serializable { 20 | public static final long serialVersionUID = 1; 21 | 22 | public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { 23 | HTTPUrlEncoded httpUrlEncoded = (HTTPUrlEncoded) extension; 24 | 25 | if (httpUrlEncoded != null) { 26 | String tagName = DOMUtils.getQualifiedValue(HTTPConstants.NS_URI_HTTP, "urlEncoded", def); 27 | 28 | pw.print(" <" + tagName); 29 | 30 | Boolean required = httpUrlEncoded.getRequired(); 31 | 32 | if (required != null) { 33 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); 34 | } 35 | 36 | pw.println("/>"); 37 | } 38 | } 39 | 40 | public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { 41 | HTTPUrlEncoded httpUrlEncoded = (HTTPUrlEncoded) extReg.createExtension(parentType, elementType); 42 | String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); 43 | 44 | if (requiredStr != null) { 45 | httpUrlEncoded.setRequired(Boolean.valueOf(requiredStr)); 46 | } 47 | 48 | return httpUrlEncoded; 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPUrlReplacementImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.http.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class HTTPUrlReplacementImpl implements HTTPUrlReplacement 14 | { 15 | protected QName elementType = HTTPConstants.Q_ELEM_HTTP_URL_REPLACEMENT; 16 | // Uses the wrapper type so we can tell if it was set or not. 17 | protected Boolean required = null; 18 | 19 | public static final long serialVersionUID = 1; 20 | 21 | /** 22 | * Set the type of this extensibility element. 23 | * 24 | * @param elementType the type 25 | */ 26 | @Override 27 | public void setElementType(QName elementType) 28 | { 29 | this.elementType = elementType; 30 | } 31 | 32 | /** 33 | * Get the type of this extensibility element. 34 | * 35 | * @return the extensibility element's type 36 | */ 37 | public QName getElementType() 38 | { 39 | return elementType; 40 | } 41 | 42 | /** 43 | * Set whether or not the semantics of this extension 44 | * are required. Relates to the wsdl:required attribute. 45 | */ 46 | @Override 47 | public void setRequired(Boolean required) 48 | { 49 | this.required = required; 50 | } 51 | 52 | /** 53 | * Get whether or not the semantics of this extension 54 | * are required. Relates to the wsdl:required attribute. 55 | */ 56 | public Boolean getRequired() 57 | { 58 | return required; 59 | } 60 | 61 | @Override 62 | public String toString() 63 | { 64 | 65 | String strBuf = "HTTPUrlReplacement (" + elementType + "):" + 66 | "\nrequired=" + required; 67 | 68 | return strBuf; 69 | } 70 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/http/HTTPUrlReplacementSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.http; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.http.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class HTTPUrlReplacementSerializer implements ExtensionSerializer, ExtensionDeserializer, Serializable { 20 | public static final long serialVersionUID = 1; 21 | 22 | public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { 23 | HTTPUrlReplacement httpUrlReplacement = (HTTPUrlReplacement) extension; 24 | 25 | if (httpUrlReplacement != null) { 26 | String tagName = DOMUtils.getQualifiedValue(HTTPConstants.NS_URI_HTTP, "urlReplacement", def); 27 | 28 | pw.print(" <" + tagName); 29 | 30 | Boolean required = httpUrlReplacement.getRequired(); 31 | 32 | if (required != null) { 33 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); 34 | } 35 | 36 | pw.println("/>"); 37 | } 38 | } 39 | 40 | public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { 41 | HTTPUrlReplacement httpUrlReplacement = (HTTPUrlReplacement) extReg.createExtension(parentType, elementType); 42 | String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); 43 | 44 | if (requiredStr != null) { 45 | httpUrlReplacement.setRequired(Boolean.valueOf(requiredStr)); 46 | } 47 | 48 | return httpUrlReplacement; 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/mime/MIMEConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.mime; 6 | 7 | import javax.xml.namespace.*; 8 | import com.ibm.wsdl.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class MIMEConstants 14 | { 15 | // Namespace URIs. 16 | public static final String NS_URI_MIME = 17 | "http://schemas.xmlsoap.org/wsdl/mime/"; 18 | 19 | // Element names. 20 | public static final String ELEM_CONTENT = "content"; 21 | public static final String ELEM_MULTIPART_RELATED = "multipartRelated"; 22 | public static final String ELEM_MIME_XML = "mimeXml"; 23 | 24 | // Qualified element names. 25 | public static final QName Q_ELEM_MIME_CONTENT = 26 | new QName(NS_URI_MIME, ELEM_CONTENT); 27 | public static final QName Q_ELEM_MIME_MULTIPART_RELATED = 28 | new QName(NS_URI_MIME, ELEM_MULTIPART_RELATED); 29 | public static final QName Q_ELEM_MIME_PART = 30 | new QName(NS_URI_MIME, Constants.ELEM_PART); 31 | public static final QName Q_ELEM_MIME_MIME_XML = 32 | new QName(NS_URI_MIME, ELEM_MIME_XML); 33 | 34 | // Attribute names. 35 | public static final String ATTR_PART = "part"; 36 | 37 | private MIMEConstants() {} 38 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/mime/MIMEContentImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.mime; 6 | 7 | import javax.wsdl.extensions.mime.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class MIMEContentImpl implements MIMEContent 14 | { 15 | protected QName elementType = MIMEConstants.Q_ELEM_MIME_CONTENT; 16 | // Uses the wrapper type so we can tell if it was set or not. 17 | protected Boolean required = null; 18 | protected String part = null; 19 | protected String type = null; 20 | 21 | public static final long serialVersionUID = 1; 22 | 23 | /** 24 | * Set the type of this extensibility element. 25 | * 26 | * @param elementType the type 27 | */ 28 | @Override 29 | public void setElementType(QName elementType) 30 | { 31 | this.elementType = elementType; 32 | } 33 | 34 | /** 35 | * Get the type of this extensibility element. 36 | * 37 | * @return the extensibility element's type 38 | */ 39 | public QName getElementType() 40 | { 41 | return elementType; 42 | } 43 | 44 | /** 45 | * Set whether or not the semantics of this extension 46 | * are required. Relates to the wsdl:required attribute. 47 | */ 48 | @Override 49 | public void setRequired(Boolean required) 50 | { 51 | this.required = required; 52 | } 53 | 54 | /** 55 | * Get whether or not the semantics of this extension 56 | * are required. Relates to the wsdl:required attribute. 57 | */ 58 | public Boolean getRequired() 59 | { 60 | return required; 61 | } 62 | 63 | /** 64 | * Set the part for this MIME content. 65 | * 66 | * @param part the desired part 67 | */ 68 | @Override 69 | public void setPart(String part) 70 | { 71 | this.part = part; 72 | } 73 | 74 | /** 75 | * Get the part for this MIME content. 76 | */ 77 | public String getPart() 78 | { 79 | return part; 80 | } 81 | 82 | /** 83 | * Set the type for this MIME content. 84 | * 85 | * @param type the desired type 86 | */ 87 | @Override 88 | public void setType(String type) 89 | { 90 | this.type = type; 91 | } 92 | 93 | /** 94 | * Get the type for this MIME content. 95 | */ 96 | public String getType() 97 | { 98 | return type; 99 | } 100 | 101 | @Override 102 | public String toString() 103 | { 104 | StringBuilder strBuf = new StringBuilder(); 105 | 106 | strBuf.append("MIMEContent (" + elementType + "):"); 107 | strBuf.append("\nrequired=" + required); 108 | 109 | if (part != null) 110 | { 111 | strBuf.append("\npart=" + part); 112 | } 113 | 114 | if (type != null) 115 | { 116 | strBuf.append("\ntype=" + type); 117 | } 118 | 119 | return strBuf.toString(); 120 | } 121 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/mime/MIMEContentSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.mime; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.mime.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class MIMEContentSerializer implements ExtensionSerializer, 20 | ExtensionDeserializer, 21 | Serializable 22 | { 23 | public static final long serialVersionUID = 1; 24 | 25 | public void marshall(Class parentType, 26 | QName elementType, 27 | ExtensibilityElement extension, 28 | PrintWriter pw, 29 | Definition def, 30 | ExtensionRegistry extReg) 31 | throws WSDLException 32 | { 33 | MIMEContent mimeContent = (MIMEContent)extension; 34 | 35 | if (mimeContent != null) 36 | { 37 | String tagName = 38 | DOMUtils.getQualifiedValue(MIMEConstants.NS_URI_MIME, 39 | "content", 40 | def); 41 | 42 | if (parentType != null 43 | && MIMEPart.class.isAssignableFrom(parentType)) 44 | { 45 | pw.print(" "); 46 | } 47 | 48 | pw.print(" <" + tagName); 49 | 50 | DOMUtils.printAttribute(MIMEConstants.ATTR_PART, 51 | mimeContent.getPart(), 52 | pw); 53 | DOMUtils.printAttribute(Constants.ATTR_TYPE, 54 | mimeContent.getType(), 55 | pw); 56 | 57 | Boolean required = mimeContent.getRequired(); 58 | 59 | if (required != null) 60 | { 61 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, 62 | required.toString(), 63 | def, 64 | pw); 65 | } 66 | 67 | pw.println("/>"); 68 | } 69 | } 70 | 71 | public ExtensibilityElement unmarshall(Class parentType, 72 | QName elementType, 73 | Element el, 74 | Definition def, 75 | ExtensionRegistry extReg) 76 | throws WSDLException 77 | { 78 | MIMEContent mimeContent = (MIMEContent)extReg.createExtension(parentType, 79 | elementType); 80 | String part = DOMUtils.getAttribute(el, MIMEConstants.ATTR_PART); 81 | String type = DOMUtils.getAttribute(el, Constants.ATTR_TYPE); 82 | String requiredStr = DOMUtils.getAttributeNS(el, 83 | Constants.NS_URI_WSDL, 84 | Constants.ATTR_REQUIRED); 85 | 86 | if (part != null) { 87 | mimeContent.setPart(part); 88 | } 89 | 90 | if (type != null) { 91 | mimeContent.setType(type); 92 | } 93 | 94 | if (requiredStr != null) { 95 | mimeContent.setRequired(Boolean.valueOf(requiredStr)); 96 | } 97 | 98 | return mimeContent; 99 | } 100 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/mime/MIMEMimeXmlImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.mime; 6 | 7 | import javax.wsdl.extensions.mime.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class MIMEMimeXmlImpl implements MIMEMimeXml { 14 | protected QName elementType = MIMEConstants.Q_ELEM_MIME_MIME_XML; 15 | // Uses the wrapper type so we can tell if it was set or not. 16 | protected Boolean required = null; 17 | protected String part = null; 18 | 19 | public static final long serialVersionUID = 1; 20 | 21 | /** 22 | * Set the type of this extensibility element. 23 | * 24 | * @param elementType 25 | * the type 26 | */ 27 | @Override 28 | public void setElementType(QName elementType) { 29 | this.elementType = elementType; 30 | } 31 | 32 | /** 33 | * Get the type of this extensibility element. 34 | * 35 | * @return the extensibility element's type 36 | */ 37 | public QName getElementType() { 38 | return elementType; 39 | } 40 | 41 | /** 42 | * Set whether or not the semantics of this extension are required. Relates to the wsdl:required attribute. 43 | */ 44 | @Override 45 | public void setRequired(Boolean required) { 46 | this.required = required; 47 | } 48 | 49 | /** 50 | * Get whether or not the semantics of this extension are required. Relates to the wsdl:required attribute. 51 | */ 52 | public Boolean getRequired() { 53 | return required; 54 | } 55 | 56 | /** 57 | * Set the part for this MIME mimeXml. 58 | * 59 | * @param part 60 | * the desired part 61 | */ 62 | @Override 63 | public void setPart(String part) { 64 | this.part = part; 65 | } 66 | 67 | /** 68 | * Get the part for this MIME mimeXml. 69 | */ 70 | public String getPart() { 71 | return part; 72 | } 73 | 74 | @Override 75 | public String toString() { 76 | StringBuilder strBuf = new StringBuilder(); 77 | 78 | strBuf.append("MIMEMimeXml (" + elementType + "):"); 79 | strBuf.append("\nrequired=" + required); 80 | 81 | if (part != null) { 82 | strBuf.append("\npart=" + part); 83 | } 84 | 85 | return strBuf.toString(); 86 | } 87 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/mime/MIMEMimeXmlSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.mime; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.mime.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class MIMEMimeXmlSerializer implements ExtensionSerializer, 20 | ExtensionDeserializer, 21 | Serializable 22 | { 23 | public static final long serialVersionUID = 1; 24 | 25 | public void marshall(Class parentType, 26 | QName elementType, 27 | ExtensibilityElement extension, 28 | PrintWriter pw, 29 | Definition def, 30 | ExtensionRegistry extReg) 31 | throws WSDLException 32 | { 33 | MIMEMimeXml mimeMimeXml = (MIMEMimeXml)extension; 34 | 35 | if (mimeMimeXml != null) 36 | { 37 | String tagName = 38 | DOMUtils.getQualifiedValue(MIMEConstants.NS_URI_MIME, 39 | "mimeXml", 40 | def); 41 | 42 | if (parentType != null 43 | && MIMEPart.class.isAssignableFrom(parentType)) 44 | { 45 | pw.print(" "); 46 | } 47 | 48 | pw.print(" <" + tagName); 49 | 50 | DOMUtils.printAttribute(MIMEConstants.ATTR_PART, 51 | mimeMimeXml.getPart(), 52 | pw); 53 | 54 | Boolean required = mimeMimeXml.getRequired(); 55 | 56 | if (required != null) 57 | { 58 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, 59 | required.toString(), 60 | def, 61 | pw); 62 | } 63 | 64 | pw.println("/>"); 65 | } 66 | } 67 | 68 | public ExtensibilityElement unmarshall(Class parentType, 69 | QName elementType, 70 | Element el, 71 | Definition def, 72 | ExtensionRegistry extReg) 73 | throws WSDLException 74 | { 75 | MIMEMimeXml mimeMimeXml = (MIMEMimeXml)extReg.createExtension(parentType, 76 | elementType); 77 | String part = DOMUtils.getAttribute(el, MIMEConstants.ATTR_PART); 78 | String requiredStr = DOMUtils.getAttributeNS(el, 79 | Constants.NS_URI_WSDL, 80 | Constants.ATTR_REQUIRED); 81 | 82 | if (part != null) { 83 | mimeMimeXml.setPart(part); 84 | } 85 | 86 | if (requiredStr != null) { 87 | mimeMimeXml.setRequired(Boolean.valueOf(requiredStr)); 88 | } 89 | 90 | return mimeMimeXml; 91 | } 92 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/mime/MIMEMultipartRelatedImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.mime; 6 | 7 | import java.util.*; 8 | import javax.wsdl.extensions.mime.*; 9 | import javax.xml.namespace.*; 10 | 11 | /** 12 | * @author Matthew J. Duftler (duftler@us.ibm.com) 13 | */ 14 | public class MIMEMultipartRelatedImpl implements MIMEMultipartRelated 15 | { 16 | protected QName elementType = MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED; 17 | // Uses the wrapper type so we can tell if it was set or not. 18 | protected Boolean required = null; 19 | protected List mimeParts = new ArrayList<>(); 20 | 21 | public static final long serialVersionUID = 1; 22 | 23 | /** 24 | * Set the type of this extensibility element. 25 | * 26 | * @param elementType the type 27 | */ 28 | @Override 29 | public void setElementType(QName elementType) 30 | { 31 | this.elementType = elementType; 32 | } 33 | 34 | /** 35 | * Get the type of this extensibility element. 36 | * 37 | * @return the extensibility element's type 38 | */ 39 | public QName getElementType() 40 | { 41 | return elementType; 42 | } 43 | 44 | /** 45 | * Set whether or not the semantics of this extension 46 | * are required. Relates to the wsdl:required attribute. 47 | */ 48 | @Override 49 | public void setRequired(Boolean required) 50 | { 51 | this.required = required; 52 | } 53 | 54 | /** 55 | * Get whether or not the semantics of this extension 56 | * are required. Relates to the wsdl:required attribute. 57 | */ 58 | public Boolean getRequired() 59 | { 60 | return required; 61 | } 62 | 63 | /** 64 | * Add a MIME part to this MIME multipart related. 65 | * 66 | * @param mimePart the MIME part to be added 67 | */ 68 | public void addMIMEPart(MIMEPart mimePart) 69 | { 70 | mimeParts.add(mimePart); 71 | } 72 | 73 | /** 74 | * Remove a MIME part from this MIME multipart related. 75 | * 76 | * @param mimePart the MIME part to be removed. 77 | * @return the MIME part which was removed. 78 | */ 79 | @Override 80 | public MIMEPart removeMIMEPart(MIMEPart mimePart) 81 | { 82 | if(mimeParts.remove(mimePart)) 83 | return mimePart; 84 | else 85 | return null; 86 | } 87 | 88 | /** 89 | * Get all the MIME parts defined here. 90 | */ 91 | public List getMIMEParts() 92 | { 93 | return mimeParts; 94 | } 95 | 96 | @Override 97 | public String toString() { 98 | StringBuilder strBuf = new StringBuilder(); 99 | 100 | strBuf.append("MIMEMultipartRelated (" + elementType + "):"); 101 | strBuf.append("\nrequired=" + required); 102 | 103 | if (mimeParts != null) { 104 | Iterator mimePartIterator = mimeParts.iterator(); 105 | 106 | while (mimePartIterator.hasNext()) { 107 | strBuf.append("\n" + mimePartIterator.next()); 108 | } 109 | } 110 | 111 | return strBuf.toString(); 112 | } 113 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/mime/MIMEPartImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.mime; 6 | 7 | import java.util.*; 8 | import javax.wsdl.extensions.*; 9 | import javax.wsdl.extensions.mime.*; 10 | import javax.xml.namespace.*; 11 | 12 | /** 13 | * @author Matthew J. Duftler (duftler@us.ibm.com) 14 | */ 15 | public class MIMEPartImpl implements MIMEPart { 16 | protected QName elementType = MIMEConstants.Q_ELEM_MIME_PART; 17 | // Uses the wrapper type so we can tell if it was set or not. 18 | protected Boolean required = null; 19 | protected List extElements = new ArrayList<>(); 20 | 21 | public static final long serialVersionUID = 1; 22 | 23 | /** 24 | * Set the type of this extensibility element. 25 | * 26 | * @param elementType 27 | * the type 28 | */ 29 | @Override 30 | public void setElementType(QName elementType) { 31 | this.elementType = elementType; 32 | } 33 | 34 | /** 35 | * Get the type of this extensibility element. 36 | * 37 | * @return the extensibility element's type 38 | */ 39 | public QName getElementType() { 40 | return elementType; 41 | } 42 | 43 | /** 44 | * Set whether or not the semantics of this extension are required. Relates to the wsdl:required attribute. 45 | */ 46 | @Override 47 | public void setRequired(Boolean required) { 48 | this.required = required; 49 | } 50 | 51 | /** 52 | * Get whether or not the semantics of this extension are required. Relates to the wsdl:required attribute. 53 | */ 54 | public Boolean getRequired() { 55 | return required; 56 | } 57 | 58 | /** 59 | * Add an extensibility element. This is where the MIME elements go. 60 | * 61 | * @param extElement 62 | * the extensibility element to be added 63 | */ 64 | public void addExtensibilityElement(ExtensibilityElement extElement) { 65 | extElements.add(extElement); 66 | } 67 | 68 | /** 69 | * Remove an extensibility element. 70 | * 71 | * @param extElement 72 | * the extensibility element to be removed 73 | * @return the extensibility element which was removed 74 | */ 75 | @Override 76 | public ExtensibilityElement removeExtensibilityElement(ExtensibilityElement extElement) { 77 | if (extElements.remove(extElement)) 78 | return extElement; 79 | else 80 | return null; 81 | } 82 | 83 | /** 84 | * Get all the extensibility elements defined here. 85 | */ 86 | public List getExtensibilityElements() { 87 | return extElements; 88 | } 89 | 90 | @Override 91 | public String toString() { 92 | StringBuilder strBuf = new StringBuilder(); 93 | 94 | strBuf.append("MIMEPart (" + elementType + "):"); 95 | strBuf.append("\nrequired=" + required); 96 | 97 | if (extElements != null) { 98 | Iterator extIterator = extElements.iterator(); 99 | 100 | while (extIterator.hasNext()) { 101 | strBuf.append("\n" + extIterator.next()); 102 | } 103 | } 104 | 105 | return strBuf.toString(); 106 | } 107 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/schema/SchemaConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.schema; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | import javax.xml.namespace.QName; 10 | import com.ibm.wsdl.Constants; 11 | 12 | /** 13 | * Constants used for handling XML Schemas 14 | * 15 | * @author John Kaputin 16 | */ 17 | public class SchemaConstants { 18 | 19 | //Schema attribute names 20 | public static final String ATTR_ID = "id"; 21 | public static final String ATTR_SCHEMA_LOCATION = "schemaLocation"; 22 | 23 | //Schema element names 24 | public static final String ELEM_SCHEMA = "schema"; 25 | public static final String ELEM_INCLUDE = "include"; 26 | public static final String ELEM_REDEFINE = "redefine"; 27 | 28 | //Schema uri 29 | public static final String NS_URI_XSD_1999 = 30 | "http://www.w3.org/1999/XMLSchema"; 31 | public static final String NS_URI_XSD_2000 = 32 | "http://www.w3.org/2000/10/XMLSchema"; 33 | public static final String NS_URI_XSD_2001 = 34 | "http://www.w3.org/2001/XMLSchema"; 35 | 36 | //Schema qnames 37 | public static final QName Q_ELEM_XSD_1999 = 38 | new QName(NS_URI_XSD_1999, ELEM_SCHEMA); 39 | public static final QName Q_ELEM_XSD_2000 = 40 | new QName(NS_URI_XSD_2000, ELEM_SCHEMA); 41 | public static final QName Q_ELEM_XSD_2001 = 42 | new QName(NS_URI_XSD_2001, ELEM_SCHEMA); 43 | public static final List XSD_QNAME_LIST = Arrays.asList(Q_ELEM_XSD_1999, Q_ELEM_XSD_2000, Q_ELEM_XSD_2001); 44 | 45 | //Schema import qnames 46 | public static final QName Q_ELEM_IMPORT_XSD_1999 = new QName( 47 | NS_URI_XSD_1999, Constants.ELEM_IMPORT); 48 | public static final QName Q_ELEM_IMPORT_XSD_2000 = new QName( 49 | NS_URI_XSD_2000, Constants.ELEM_IMPORT); 50 | public static final QName Q_ELEM_IMPORT_XSD_2001 = new QName( 51 | NS_URI_XSD_2001, Constants.ELEM_IMPORT); 52 | public static final List XSD_IMPORT_QNAME_LIST = Arrays.asList(Q_ELEM_IMPORT_XSD_1999, Q_ELEM_IMPORT_XSD_2000, Q_ELEM_IMPORT_XSD_2001); 53 | 54 | 55 | //Schema include qnames 56 | public static final QName Q_ELEM_INCLUDE_XSD_1999 = new QName( 57 | NS_URI_XSD_1999, ELEM_INCLUDE); 58 | public static final QName Q_ELEM_INCLUDE_XSD_2000 = new QName( 59 | NS_URI_XSD_2000, ELEM_INCLUDE); 60 | public static final QName Q_ELEM_INCLUDE_XSD_2001 = new QName( 61 | NS_URI_XSD_2001, ELEM_INCLUDE); 62 | public static final List XSD_INCLUDE_QNAME_LIST = Arrays.asList(Q_ELEM_INCLUDE_XSD_1999, Q_ELEM_INCLUDE_XSD_2000, Q_ELEM_INCLUDE_XSD_2001); 63 | 64 | //Schema redefine qnames 65 | public static final QName Q_ELEM_REDEFINE_XSD_1999 = new QName( 66 | NS_URI_XSD_1999, ELEM_REDEFINE); 67 | public static final QName Q_ELEM_REDEFINE_XSD_2000 = new QName( 68 | NS_URI_XSD_2000, ELEM_REDEFINE); 69 | public static final QName Q_ELEM_REDEFINE_XSD_2001 = new QName( 70 | NS_URI_XSD_2001, ELEM_REDEFINE); 71 | public static final List XSD_REDEFINE_QNAME_LIST = Arrays.asList(Q_ELEM_REDEFINE_XSD_1999, Q_ELEM_REDEFINE_XSD_2000, Q_ELEM_REDEFINE_XSD_2001); 72 | 73 | private SchemaConstants() { 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/schema/SchemaImportImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.schema; 6 | 7 | import javax.wsdl.extensions.schema.SchemaImport; 8 | 9 | /** 10 | * @author Jeremy Hughes 11 | */ 12 | public class SchemaImportImpl extends SchemaReferenceImpl implements SchemaImport 13 | { 14 | public static final long serialVersionUID = 1; 15 | 16 | private String namespace = null; 17 | 18 | /** 19 | * @return Returns the namespace. 20 | */ 21 | public String getNamespaceURI() 22 | { 23 | return this.namespace; 24 | } 25 | 26 | /** 27 | * @param namespace The namespace to set. 28 | */ 29 | @Override 30 | public void setNamespaceURI(String namespace) 31 | { 32 | this.namespace = namespace; 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/schema/SchemaReferenceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.schema; 6 | 7 | import javax.wsdl.extensions.schema.Schema; 8 | import javax.wsdl.extensions.schema.SchemaReference; 9 | 10 | /** 11 | * @author Jeremy Hughes 12 | */ 13 | public class SchemaReferenceImpl implements SchemaReference { 14 | 15 | public static final long serialVersionUID = 1; 16 | 17 | private String id = null; 18 | 19 | private String schemaLocation = null; 20 | 21 | private Schema referencedSchema = null; 22 | 23 | /** 24 | * @return Returns the id. 25 | */ 26 | public String getId() { 27 | return this.id; 28 | } 29 | 30 | /** 31 | * @param id 32 | * The id to set. 33 | */ 34 | @Override 35 | public void setId(String id) { 36 | this.id = id; 37 | } 38 | 39 | /** 40 | * @return Returns the schemaLocation. 41 | */ 42 | public String getSchemaLocationURI() { 43 | return this.schemaLocation; 44 | } 45 | 46 | /** 47 | * @param schemaLocation 48 | * The schemaLocation to set. 49 | */ 50 | @Override 51 | public void setSchemaLocationURI(String schemaLocation) { 52 | this.schemaLocation = schemaLocation; 53 | } 54 | 55 | /** 56 | * @return Returns the importedSchema. 57 | */ 58 | public Schema getReferencedSchema() { 59 | return this.referencedSchema; 60 | } 61 | 62 | /** 63 | * @param referencedSchema 64 | * The importedSchema to set. 65 | */ 66 | @Override 67 | public void setReferencedSchema(Schema referencedSchema) { 68 | this.referencedSchema = referencedSchema; 69 | } 70 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/schema/SchemaSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.schema; 6 | 7 | import java.io.PrintWriter; 8 | import java.io.Serializable; 9 | 10 | import javax.wsdl.Definition; 11 | import javax.wsdl.WSDLException; 12 | import javax.wsdl.extensions.ExtensibilityElement; 13 | import javax.wsdl.extensions.ExtensionRegistry; 14 | import javax.wsdl.extensions.ExtensionSerializer; 15 | import javax.wsdl.extensions.schema.Schema; 16 | import javax.xml.namespace.QName; 17 | 18 | import com.ibm.wsdl.util.xml.DOM2Writer; 19 | 20 | /** 21 | * This class is used to serialize Schema instances 22 | * into the PrintWriter. 23 | * 24 | * @see SchemaImpl 25 | * @see SchemaDeserializer 26 | * 27 | * @author Jeremy Hughes 28 | */ 29 | public class SchemaSerializer implements ExtensionSerializer, Serializable 30 | { 31 | public static final long serialVersionUID = 1; 32 | 33 | public void marshall(Class parentType, 34 | QName elementType, 35 | ExtensibilityElement extension, 36 | PrintWriter pw, 37 | Definition def, 38 | ExtensionRegistry extReg) 39 | throws WSDLException 40 | { 41 | Schema schema = (Schema)extension; 42 | 43 | pw.print(" "); 44 | 45 | DOM2Writer.serializeAsXML(schema.getElement(), def.getNamespaces(), pw); 46 | 47 | pw.println(); 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPAddressImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import javax.wsdl.extensions.soap.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class SOAPAddressImpl implements SOAPAddress 14 | { 15 | protected QName elementType = SOAPConstants.Q_ELEM_SOAP_ADDRESS; 16 | // Uses the wrapper type so we can tell if it was set or not. 17 | protected Boolean required = null; 18 | protected String locationURI = null; 19 | 20 | public static final long serialVersionUID = 1; 21 | 22 | /** 23 | * Set the type of this extensibility element. 24 | * 25 | * @param elementType the type 26 | */ 27 | @Override 28 | public void setElementType(QName elementType) 29 | { 30 | this.elementType = elementType; 31 | } 32 | 33 | /** 34 | * Get the type of this extensibility element. 35 | * 36 | * @return the extensibility element's type 37 | */ 38 | public QName getElementType() 39 | { 40 | return elementType; 41 | } 42 | 43 | /** 44 | * Set whether or not the semantics of this extension 45 | * are required. Relates to the wsdl:required attribute. 46 | */ 47 | @Override 48 | public void setRequired(Boolean required) 49 | { 50 | this.required = required; 51 | } 52 | 53 | /** 54 | * Get whether or not the semantics of this extension 55 | * are required. Relates to the wsdl:required attribute. 56 | */ 57 | public Boolean getRequired() 58 | { 59 | return required; 60 | } 61 | 62 | /** 63 | * Set the location URI for this SOAP address. 64 | * 65 | * @param locationURI the desired location URI 66 | */ 67 | @Override 68 | public void setLocationURI(String locationURI) 69 | { 70 | this.locationURI = locationURI; 71 | } 72 | 73 | /** 74 | * Get the location URI for this SOAP address. 75 | */ 76 | public String getLocationURI() 77 | { 78 | return locationURI; 79 | } 80 | 81 | @Override 82 | public String toString() 83 | { 84 | StringBuilder strBuf = new StringBuilder(); 85 | 86 | strBuf.append("SOAPAddress (" + elementType + "):"); 87 | strBuf.append("\nrequired=" + required); 88 | 89 | if (locationURI != null) 90 | { 91 | strBuf.append("\nlocationURI=" + locationURI); 92 | } 93 | 94 | return strBuf.toString(); 95 | } 96 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPAddressSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.soap.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class SOAPAddressSerializer implements ExtensionSerializer, 20 | ExtensionDeserializer, 21 | Serializable 22 | { 23 | public static final long serialVersionUID = 1; 24 | 25 | public void marshall(Class parentType, 26 | QName elementType, 27 | ExtensibilityElement extension, 28 | PrintWriter pw, 29 | Definition def, 30 | ExtensionRegistry extReg) 31 | throws WSDLException 32 | { 33 | SOAPAddress soapAddress = (SOAPAddress)extension; 34 | 35 | if (soapAddress != null) 36 | { 37 | String tagName = 38 | DOMUtils.getQualifiedValue(SOAPConstants.NS_URI_SOAP, 39 | "address", 40 | def); 41 | 42 | pw.print(" <" + tagName); 43 | 44 | DOMUtils.printAttribute(Constants.ATTR_LOCATION, 45 | soapAddress.getLocationURI(), 46 | pw); 47 | 48 | Boolean required = soapAddress.getRequired(); 49 | 50 | if (required != null) 51 | { 52 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, 53 | required.toString(), 54 | def, 55 | pw); 56 | } 57 | 58 | pw.println("/>"); 59 | } 60 | } 61 | 62 | public ExtensibilityElement unmarshall(Class parentType, 63 | QName elementType, 64 | Element el, 65 | Definition def, 66 | ExtensionRegistry extReg) 67 | throws WSDLException 68 | { 69 | SOAPAddress soapAddress = (SOAPAddress)extReg.createExtension(parentType, 70 | elementType); 71 | String locationURI = DOMUtils.getAttribute(el, Constants.ATTR_LOCATION); 72 | String requiredStr = DOMUtils.getAttributeNS(el, 73 | Constants.NS_URI_WSDL, 74 | Constants.ATTR_REQUIRED); 75 | 76 | if (locationURI != null) 77 | { 78 | soapAddress.setLocationURI(locationURI); 79 | } 80 | 81 | if (requiredStr != null) 82 | { 83 | soapAddress.setRequired(Boolean.valueOf(requiredStr)); 84 | } 85 | 86 | return soapAddress; 87 | } 88 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPBindingImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import javax.wsdl.extensions.soap.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class SOAPBindingImpl implements SOAPBinding 14 | { 15 | protected QName elementType = SOAPConstants.Q_ELEM_SOAP_BINDING; 16 | protected Boolean required = null; 17 | protected String style = null; 18 | protected String transportURI = null; 19 | 20 | public static final long serialVersionUID = 1; 21 | 22 | /** 23 | * Set the type of this extensibility element. 24 | * 25 | * @param elementType the type 26 | */ 27 | @Override 28 | public void setElementType(QName elementType) 29 | { 30 | this.elementType = elementType; 31 | } 32 | 33 | /** 34 | * Get the type of this extensibility element. 35 | * 36 | * @return the extensibility element's type 37 | */ 38 | public QName getElementType() 39 | { 40 | return elementType; 41 | } 42 | 43 | /** 44 | * Set whether or not the semantics of this extension 45 | * are required. Relates to the wsdl:required attribute. 46 | */ 47 | @Override 48 | public void setRequired(Boolean required) 49 | { 50 | this.required = required; 51 | } 52 | 53 | /** 54 | * Get whether or not the semantics of this extension 55 | * are required. Relates to the wsdl:required attribute. 56 | */ 57 | public Boolean getRequired() 58 | { 59 | return required; 60 | } 61 | 62 | /** 63 | * Set the style for this SOAP binding. 64 | * 65 | * @param style the desired style 66 | */ 67 | @Override 68 | public void setStyle(String style) 69 | { 70 | this.style = style; 71 | } 72 | 73 | /** 74 | * Get the style for this SOAP binding. 75 | */ 76 | public String getStyle() 77 | { 78 | return style; 79 | } 80 | 81 | /** 82 | * Set the SOAP transport URI to be used for communicating 83 | * with this binding. 84 | * 85 | * @param transportURI the URI describing the transport 86 | * to be used 87 | */ 88 | @Override 89 | public void setTransportURI(String transportURI) 90 | { 91 | this.transportURI = transportURI; 92 | } 93 | 94 | /** 95 | * Get the transport URI to be used with this binding. 96 | * 97 | * @return the transport URI to be used 98 | */ 99 | public String getTransportURI() 100 | { 101 | return transportURI; 102 | } 103 | 104 | @Override 105 | public String toString() 106 | { 107 | StringBuilder strBuf = new StringBuilder(); 108 | 109 | strBuf.append("SOAPBinding (" + elementType + "):"); 110 | strBuf.append("\nrequired=" + required); 111 | 112 | if (transportURI != null) 113 | { 114 | strBuf.append("\ntransportURI=" + transportURI); 115 | } 116 | 117 | if (style != null) 118 | { 119 | strBuf.append("\nstyle=" + style); 120 | } 121 | 122 | return strBuf.toString(); 123 | } 124 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPBindingSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.soap.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class SOAPBindingSerializer implements ExtensionSerializer, 20 | ExtensionDeserializer, 21 | Serializable 22 | { 23 | public static final long serialVersionUID = 1; 24 | 25 | public void marshall(Class parentType, 26 | QName elementType, 27 | ExtensibilityElement extension, 28 | PrintWriter pw, 29 | Definition def, 30 | ExtensionRegistry extReg) 31 | throws WSDLException 32 | { 33 | SOAPBinding soapBinding = (SOAPBinding)extension; 34 | 35 | if (soapBinding != null) 36 | { 37 | String tagName = 38 | DOMUtils.getQualifiedValue(SOAPConstants.NS_URI_SOAP, 39 | "binding", 40 | def); 41 | 42 | pw.print(" <" + tagName); 43 | 44 | DOMUtils.printAttribute(SOAPConstants.ATTR_STYLE, 45 | soapBinding.getStyle(), 46 | pw); 47 | DOMUtils.printAttribute(SOAPConstants.ATTR_TRANSPORT, 48 | soapBinding.getTransportURI(), 49 | pw); 50 | 51 | Boolean required = soapBinding.getRequired(); 52 | 53 | if (required != null) 54 | { 55 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, 56 | required.toString(), 57 | def, 58 | pw); 59 | } 60 | 61 | pw.println("/>"); 62 | } 63 | } 64 | 65 | public ExtensibilityElement unmarshall(Class parentType, 66 | QName elementType, 67 | Element el, 68 | Definition def, 69 | ExtensionRegistry extReg) 70 | throws WSDLException 71 | { 72 | SOAPBinding soapBinding = (SOAPBinding)extReg.createExtension(parentType, 73 | elementType); 74 | String transportURI = DOMUtils.getAttribute(el, 75 | SOAPConstants.ATTR_TRANSPORT); 76 | String style = DOMUtils.getAttribute(el, SOAPConstants.ATTR_STYLE); 77 | String requiredStr = DOMUtils.getAttributeNS(el, 78 | Constants.NS_URI_WSDL, 79 | Constants.ATTR_REQUIRED); 80 | 81 | if (transportURI != null) 82 | { 83 | soapBinding.setTransportURI(transportURI); 84 | } 85 | 86 | if (style != null) 87 | { 88 | soapBinding.setStyle(style); 89 | } 90 | 91 | if (requiredStr != null) 92 | { 93 | soapBinding.setRequired(Boolean.valueOf(requiredStr)); 94 | } 95 | 96 | return soapBinding; 97 | } 98 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPBodyImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import java.util.*; 8 | import javax.wsdl.extensions.soap.*; 9 | import javax.xml.namespace.*; 10 | 11 | /** 12 | * @author Matthew J. Duftler (duftler@us.ibm.com) 13 | */ 14 | public class SOAPBodyImpl implements SOAPBody 15 | { 16 | protected QName elementType = SOAPConstants.Q_ELEM_SOAP_BODY; 17 | protected Boolean required = null; 18 | protected List parts = null; 19 | protected String use = null; 20 | protected List encodingStyles = null; 21 | protected String namespaceURI = null; 22 | 23 | public static final long serialVersionUID = 1; 24 | 25 | /** 26 | * Set the type of this extensibility element. 27 | * 28 | * @param elementType the type 29 | */ 30 | @Override 31 | public void setElementType(QName elementType) 32 | { 33 | this.elementType = elementType; 34 | } 35 | 36 | /** 37 | * Get the type of this extensibility element. 38 | * 39 | * @return the extensibility element's type 40 | */ 41 | public QName getElementType() 42 | { 43 | return elementType; 44 | } 45 | 46 | /** 47 | * Set whether or not the semantics of this extension 48 | * are required. Relates to the wsdl:required attribute. 49 | */ 50 | @Override 51 | public void setRequired(Boolean required) 52 | { 53 | this.required = required; 54 | } 55 | 56 | /** 57 | * Get whether or not the semantics of this extension 58 | * are required. Relates to the wsdl:required attribute. 59 | */ 60 | public Boolean getRequired() 61 | { 62 | return required; 63 | } 64 | 65 | /** 66 | * Set the parts for this SOAP body. 67 | * 68 | * @param parts the desired parts 69 | */ 70 | @Override 71 | public void setParts(List parts) 72 | { 73 | this.parts = parts; 74 | } 75 | 76 | /** 77 | * Get the parts for this SOAP body. 78 | */ 79 | public List getParts() 80 | { 81 | return parts; 82 | } 83 | 84 | /** 85 | * Set the use for this SOAP body. 86 | * 87 | * @param use the desired use 88 | */ 89 | @Override 90 | public void setUse(String use) 91 | { 92 | this.use = use; 93 | } 94 | 95 | /** 96 | * Get the use for this SOAP body. 97 | */ 98 | public String getUse() 99 | { 100 | return use; 101 | } 102 | 103 | /** 104 | * Set the encodingStyles for this SOAP body. 105 | * 106 | * @param encodingStyles the desired encodingStyles 107 | */ 108 | @Override 109 | public void setEncodingStyles(List encodingStyles) 110 | { 111 | this.encodingStyles = encodingStyles; 112 | } 113 | 114 | /** 115 | * Get the encodingStyles for this SOAP body. 116 | */ 117 | public List getEncodingStyles() 118 | { 119 | return encodingStyles; 120 | } 121 | 122 | /** 123 | * Set the namespace URI for this SOAP body. 124 | * 125 | * @param namespaceURI the desired namespace URI 126 | */ 127 | @Override 128 | public void setNamespaceURI(String namespaceURI) 129 | { 130 | this.namespaceURI = namespaceURI; 131 | } 132 | 133 | /** 134 | * Get the namespace URI for this SOAP body. 135 | */ 136 | public String getNamespaceURI() 137 | { 138 | return namespaceURI; 139 | } 140 | 141 | @Override 142 | public String toString() 143 | { 144 | StringBuffer strBuf = new StringBuffer(); 145 | 146 | strBuf.append("SOAPBody (" + elementType + "):"); 147 | strBuf.append("\nrequired=" + required); 148 | 149 | if (parts != null) 150 | { 151 | strBuf.append("\nparts=" + parts); 152 | } 153 | 154 | if (use != null) 155 | { 156 | strBuf.append("\nuse=" + use); 157 | } 158 | 159 | if (encodingStyles != null) 160 | { 161 | strBuf.append("\nencodingStyles=" + encodingStyles); 162 | } 163 | 164 | if (namespaceURI != null) 165 | { 166 | strBuf.append("\nnamespaceURI=" + namespaceURI); 167 | } 168 | 169 | return strBuf.toString(); 170 | } 171 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import javax.xml.namespace.*; 8 | import com.ibm.wsdl.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public class SOAPConstants 14 | { 15 | // Namespace URIs. 16 | public static final String NS_URI_SOAP = 17 | "http://schemas.xmlsoap.org/wsdl/soap/"; 18 | 19 | // Element names. 20 | public static final String ELEM_BODY = "body"; 21 | public static final String ELEM_HEADER = "header"; 22 | public static final String ELEM_HEADER_FAULT = "headerfault"; 23 | public static final String ELEM_ADDRESS = "address"; 24 | 25 | // Qualified element names. 26 | public static final QName Q_ELEM_SOAP_BINDING = 27 | new QName(NS_URI_SOAP, Constants.ELEM_BINDING); 28 | public static final QName Q_ELEM_SOAP_BODY = 29 | new QName(NS_URI_SOAP, ELEM_BODY); 30 | public static final QName Q_ELEM_SOAP_HEADER = 31 | new QName(NS_URI_SOAP, ELEM_HEADER); 32 | public static final QName Q_ELEM_SOAP_HEADER_FAULT = 33 | new QName(NS_URI_SOAP, ELEM_HEADER_FAULT); 34 | public static final QName Q_ELEM_SOAP_ADDRESS = 35 | new QName(NS_URI_SOAP, ELEM_ADDRESS); 36 | public static final QName Q_ELEM_SOAP_OPERATION = 37 | new QName(NS_URI_SOAP, Constants.ELEM_OPERATION); 38 | public static final QName Q_ELEM_SOAP_FAULT = 39 | new QName(NS_URI_SOAP, Constants.ELEM_FAULT); 40 | 41 | // Attribute names. 42 | public static final String ATTR_TRANSPORT = "transport"; 43 | public static final String ATTR_STYLE = "style"; 44 | public static final String ATTR_SOAP_ACTION = "soapAction"; 45 | public static final String ATTR_PARTS = "parts"; 46 | public static final String ATTR_USE = "use"; 47 | public static final String ATTR_ENCODING_STYLE = "encodingStyle"; 48 | public static final String ATTR_PART = "part"; 49 | 50 | private SOAPConstants() {} 51 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPFaultSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.soap.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.*; 15 | import com.ibm.wsdl.util.xml.*; 16 | 17 | /** 18 | * @author Matthew J. Duftler (duftler@us.ibm.com) 19 | */ 20 | public class SOAPFaultSerializer implements ExtensionSerializer, ExtensionDeserializer, Serializable { 21 | public static final long serialVersionUID = 1; 22 | 23 | public void marshall(Class parentType, QName elementType, ExtensibilityElement extension, PrintWriter pw, Definition def, ExtensionRegistry extReg) throws WSDLException { 24 | SOAPFault soapFault = (SOAPFault) extension; 25 | 26 | if (soapFault != null) { 27 | String tagName = DOMUtils.getQualifiedValue(SOAPConstants.NS_URI_SOAP, "fault", def); 28 | 29 | pw.print(" <" + tagName); 30 | 31 | DOMUtils.printAttribute(Constants.ATTR_NAME, soapFault.getName(), pw); 32 | DOMUtils.printAttribute(SOAPConstants.ATTR_USE, soapFault.getUse(), pw); 33 | DOMUtils.printAttribute(SOAPConstants.ATTR_ENCODING_STYLE, StringUtils.getNMTokens(soapFault.getEncodingStyles()), pw); 34 | DOMUtils.printAttribute(Constants.ATTR_NAMESPACE, soapFault.getNamespaceURI(), pw); 35 | 36 | Boolean required = soapFault.getRequired(); 37 | 38 | if (required != null) { 39 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, required.toString(), def, pw); 40 | } 41 | 42 | pw.println("/>"); 43 | } 44 | } 45 | 46 | public ExtensibilityElement unmarshall(Class parentType, QName elementType, Element el, Definition def, ExtensionRegistry extReg) throws WSDLException { 47 | SOAPFault soapFault = (SOAPFault) extReg.createExtension(parentType, elementType); 48 | String name = DOMUtils.getAttribute(el, Constants.ATTR_NAME); 49 | String use = DOMUtils.getAttribute(el, SOAPConstants.ATTR_USE); 50 | String encStyleStr = DOMUtils.getAttribute(el, SOAPConstants.ATTR_ENCODING_STYLE); 51 | String namespaceURI = DOMUtils.getAttribute(el, Constants.ATTR_NAMESPACE); 52 | String requiredStr = DOMUtils.getAttributeNS(el, Constants.NS_URI_WSDL, Constants.ATTR_REQUIRED); 53 | 54 | if (name != null) { 55 | soapFault.setName(name); 56 | } 57 | 58 | if (use != null) { 59 | soapFault.setUse(use); 60 | } 61 | 62 | if (encStyleStr != null) { 63 | soapFault.setEncodingStyles(StringUtils.parseNMTokens(encStyleStr)); 64 | } 65 | 66 | if (namespaceURI != null) { 67 | soapFault.setNamespaceURI(namespaceURI); 68 | } 69 | 70 | if (requiredStr != null) { 71 | soapFault.setRequired(Boolean.valueOf(requiredStr)); 72 | } 73 | 74 | return soapFault; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPOperationImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import javax.wsdl.extensions.soap.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * This class stores information associated with a SOAP operation that 12 | * acts as the concrete implementation of an abstract operation specified 13 | * in WSDL. 14 | * 15 | * @author Nirmal Mukhi (nmukhi@us.ibm.com) 16 | * @author Matthew J. Duftler (duftler@us.ibm.com) 17 | */ 18 | public class SOAPOperationImpl implements SOAPOperation 19 | { 20 | protected QName elementType = SOAPConstants.Q_ELEM_SOAP_OPERATION; 21 | protected Boolean required = null; 22 | protected String soapActionURI = null; 23 | protected String style = null; 24 | 25 | public static final long serialVersionUID = 1; 26 | 27 | /** 28 | * Set the type of this extensibility element. 29 | * 30 | * @param elementType the type 31 | */ 32 | @Override 33 | public void setElementType(QName elementType) 34 | { 35 | this.elementType = elementType; 36 | } 37 | 38 | /** 39 | * Get the type of this extensibility element. 40 | * 41 | * @return the extensibility element's type 42 | */ 43 | public QName getElementType() 44 | { 45 | return elementType; 46 | } 47 | 48 | /** 49 | * Set whether or not the semantics of this extension 50 | * are required. Relates to the wsdl:required attribute. 51 | */ 52 | @Override 53 | public void setRequired(Boolean required) 54 | { 55 | this.required = required; 56 | } 57 | 58 | /** 59 | * Get whether or not the semantics of this extension 60 | * are required. Relates to the wsdl:required attribute. 61 | */ 62 | public Boolean getRequired() 63 | { 64 | return required; 65 | } 66 | 67 | /** 68 | * Set the SOAP action attribute. 69 | * 70 | * @param soapActionURI the desired value of the SOAP 71 | * action header for this operation. 72 | */ 73 | @Override 74 | public void setSoapActionURI(String soapActionURI) 75 | { 76 | this.soapActionURI = soapActionURI; 77 | } 78 | 79 | /** 80 | * Get the value of the SOAP action attribute. 81 | * 82 | * @return the SOAP action attribute's value 83 | */ 84 | public String getSoapActionURI() 85 | { 86 | return soapActionURI; 87 | } 88 | 89 | /** 90 | * Set the style for this SOAP operation. 91 | * 92 | * @param style the desired style 93 | */ 94 | @Override 95 | public void setStyle(String style) 96 | { 97 | this.style = style; 98 | } 99 | 100 | /** 101 | * Get the style for this SOAP operation. 102 | */ 103 | public String getStyle() 104 | { 105 | return style; 106 | } 107 | 108 | @Override 109 | public String toString() 110 | { 111 | StringBuilder strBuf = new StringBuilder(); 112 | 113 | strBuf.append("SOAPOperation (" + elementType + "):"); 114 | strBuf.append("\nrequired=" + required); 115 | 116 | if (soapActionURI != null) 117 | { 118 | strBuf.append("\nsoapActionURI=" + soapActionURI); 119 | } 120 | 121 | if (style != null) 122 | { 123 | strBuf.append("\nstyle=" + style); 124 | } 125 | 126 | return strBuf.toString(); 127 | } 128 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap/SOAPOperationSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.soap.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * @author Matthew J. Duftler (duftler@us.ibm.com) 18 | */ 19 | public class SOAPOperationSerializer implements ExtensionSerializer, 20 | ExtensionDeserializer, 21 | Serializable 22 | { 23 | public static final long serialVersionUID = 1; 24 | 25 | public void marshall(Class parentType, 26 | QName elementType, 27 | ExtensibilityElement extension, 28 | PrintWriter pw, 29 | Definition def, 30 | ExtensionRegistry extReg) 31 | throws WSDLException 32 | { 33 | SOAPOperation soapOperation = (SOAPOperation)extension; 34 | 35 | if (soapOperation != null) 36 | { 37 | String tagName = 38 | DOMUtils.getQualifiedValue(SOAPConstants.NS_URI_SOAP, 39 | "operation", 40 | def); 41 | 42 | pw.print(" <" + tagName); 43 | 44 | DOMUtils.printAttribute(SOAPConstants.ATTR_SOAP_ACTION, 45 | soapOperation.getSoapActionURI(), 46 | pw); 47 | DOMUtils.printAttribute(SOAPConstants.ATTR_STYLE, 48 | soapOperation.getStyle(), 49 | pw); 50 | 51 | Boolean required = soapOperation.getRequired(); 52 | 53 | if (required != null) 54 | { 55 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, 56 | required.toString(), 57 | def, 58 | pw); 59 | } 60 | 61 | pw.println("/>"); 62 | } 63 | } 64 | 65 | public ExtensibilityElement unmarshall(Class parentType, 66 | QName elementType, 67 | Element el, 68 | Definition def, 69 | ExtensionRegistry extReg) 70 | throws WSDLException 71 | { 72 | SOAPOperation soapOperation = 73 | (SOAPOperation)extReg.createExtension(parentType, elementType); 74 | String soapActionURI = DOMUtils.getAttribute(el, 75 | SOAPConstants.ATTR_SOAP_ACTION); 76 | String style = DOMUtils.getAttribute(el, SOAPConstants.ATTR_STYLE); 77 | String requiredStr = DOMUtils.getAttributeNS(el, 78 | Constants.NS_URI_WSDL, 79 | Constants.ATTR_REQUIRED); 80 | 81 | if (soapActionURI != null) 82 | { 83 | soapOperation.setSoapActionURI(soapActionURI); 84 | } 85 | 86 | if (style != null) 87 | { 88 | soapOperation.setStyle(style); 89 | } 90 | 91 | if (requiredStr != null) 92 | { 93 | soapOperation.setRequired(Boolean.valueOf(requiredStr)); 94 | } 95 | 96 | return soapOperation; 97 | } 98 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap12/SOAP12AddressImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap12; 6 | 7 | import javax.wsdl.extensions.soap12.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * Copied from com.ibm.wsdl.extensions.soap.SOAPAddressImpl 12 | */ 13 | public class SOAP12AddressImpl implements SOAP12Address 14 | { 15 | protected QName elementType = SOAP12Constants.Q_ELEM_SOAP_ADDRESS; 16 | // Uses the wrapper type so we can tell if it was set or not. 17 | protected Boolean required = null; 18 | protected String locationURI = null; 19 | 20 | public static final long serialVersionUID = 1; 21 | 22 | /** 23 | * Set the type of this extensibility element. 24 | * 25 | * @param elementType the type 26 | */ 27 | @Override 28 | public void setElementType(QName elementType) 29 | { 30 | this.elementType = elementType; 31 | } 32 | 33 | /** 34 | * Get the type of this extensibility element. 35 | * 36 | * @return the extensibility element's type 37 | */ 38 | public QName getElementType() 39 | { 40 | return elementType; 41 | } 42 | 43 | /** 44 | * Set whether or not the semantics of this extension 45 | * are required. Relates to the wsdl:required attribute. 46 | */ 47 | @Override 48 | public void setRequired(Boolean required) 49 | { 50 | this.required = required; 51 | } 52 | 53 | /** 54 | * Get whether or not the semantics of this extension 55 | * are required. Relates to the wsdl:required attribute. 56 | */ 57 | public Boolean getRequired() 58 | { 59 | return required; 60 | } 61 | 62 | /** 63 | * Set the location URI for this SOAP address. 64 | * 65 | * @param locationURI the desired location URI 66 | */ 67 | @Override 68 | public void setLocationURI(String locationURI) 69 | { 70 | this.locationURI = locationURI; 71 | } 72 | 73 | /** 74 | * Get the location URI for this SOAP address. 75 | */ 76 | public String getLocationURI() 77 | { 78 | return locationURI; 79 | } 80 | 81 | @Override 82 | public String toString() 83 | { 84 | StringBuffer strBuf = new StringBuffer(); 85 | 86 | strBuf.append("SOAPAddress (" + elementType + "):"); 87 | strBuf.append("\nrequired=" + required); 88 | 89 | if (locationURI != null) 90 | { 91 | strBuf.append("\nlocationURI=" + locationURI); 92 | } 93 | 94 | return strBuf.toString(); 95 | } 96 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap12/SOAP12AddressSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap12; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.soap12.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * Copied from com.ibm.wsdl.extensions.soap.SOAPAddressSerializer 18 | */ 19 | public class SOAP12AddressSerializer implements ExtensionSerializer, 20 | ExtensionDeserializer, 21 | Serializable 22 | { 23 | public static final long serialVersionUID = 1; 24 | 25 | public void marshall(Class parentType, 26 | QName elementType, 27 | ExtensibilityElement extension, 28 | PrintWriter pw, 29 | Definition def, 30 | ExtensionRegistry extReg) 31 | throws WSDLException 32 | { 33 | SOAP12Address soapAddress = (SOAP12Address)extension; 34 | 35 | if (soapAddress != null) 36 | { 37 | String tagName = 38 | DOMUtils.getQualifiedValue(SOAP12Constants.NS_URI_SOAP12, 39 | "address", 40 | def); 41 | 42 | pw.print(" <" + tagName); 43 | 44 | DOMUtils.printAttribute(Constants.ATTR_LOCATION, 45 | soapAddress.getLocationURI(), 46 | pw); 47 | 48 | Boolean required = soapAddress.getRequired(); 49 | 50 | if (required != null) 51 | { 52 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, 53 | required.toString(), 54 | def, 55 | pw); 56 | } 57 | 58 | pw.println("/>"); 59 | } 60 | } 61 | 62 | public ExtensibilityElement unmarshall(Class parentType, 63 | QName elementType, 64 | Element el, 65 | Definition def, 66 | ExtensionRegistry extReg) 67 | throws WSDLException 68 | { 69 | SOAP12Address soapAddress = (SOAP12Address)extReg.createExtension(parentType, 70 | elementType); 71 | String locationURI = DOMUtils.getAttribute(el, Constants.ATTR_LOCATION); 72 | String requiredStr = DOMUtils.getAttributeNS(el, 73 | Constants.NS_URI_WSDL, 74 | Constants.ATTR_REQUIRED); 75 | 76 | if (locationURI != null) 77 | { 78 | soapAddress.setLocationURI(locationURI); 79 | } 80 | 81 | if (requiredStr != null) 82 | { 83 | soapAddress.setRequired(Boolean.valueOf(requiredStr)); 84 | } 85 | 86 | return soapAddress; 87 | } 88 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap12/SOAP12BindingImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap12; 6 | 7 | import javax.wsdl.extensions.soap12.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * Copied from com.ibm.wsdl.extensions.soap.SOAPBindingImpl 12 | */ 13 | public class SOAP12BindingImpl implements SOAP12Binding 14 | { 15 | protected QName elementType = SOAP12Constants.Q_ELEM_SOAP_BINDING; 16 | protected Boolean required = null; 17 | protected String style = null; 18 | protected String transportURI = null; 19 | 20 | public static final long serialVersionUID = 1; 21 | 22 | /** 23 | * Set the type of this extensibility element. 24 | * 25 | * @param elementType the type 26 | */ 27 | @Override 28 | public void setElementType(QName elementType) 29 | { 30 | this.elementType = elementType; 31 | } 32 | 33 | /** 34 | * Get the type of this extensibility element. 35 | * 36 | * @return the extensibility element's type 37 | */ 38 | public QName getElementType() 39 | { 40 | return elementType; 41 | } 42 | 43 | /** 44 | * Set whether or not the semantics of this extension 45 | * are required. Relates to the wsdl:required attribute. 46 | */ 47 | @Override 48 | public void setRequired(Boolean required) 49 | { 50 | this.required = required; 51 | } 52 | 53 | /** 54 | * Get whether or not the semantics of this extension 55 | * are required. Relates to the wsdl:required attribute. 56 | */ 57 | public Boolean getRequired() 58 | { 59 | return required; 60 | } 61 | 62 | /** 63 | * Set the style for this SOAP binding. 64 | * 65 | * @param style the desired style 66 | */ 67 | @Override 68 | public void setStyle(String style) 69 | { 70 | this.style = style; 71 | } 72 | 73 | /** 74 | * Get the style for this SOAP binding. 75 | */ 76 | public String getStyle() 77 | { 78 | return style; 79 | } 80 | 81 | /** 82 | * Set the SOAP transport URI to be used for communicating 83 | * with this binding. 84 | * 85 | * @param transportURI the URI describing the transport 86 | * to be used 87 | */ 88 | @Override 89 | public void setTransportURI(String transportURI) 90 | { 91 | this.transportURI = transportURI; 92 | } 93 | 94 | /** 95 | * Get the transport URI to be used with this binding. 96 | * 97 | * @return the transport URI to be used 98 | */ 99 | public String getTransportURI() 100 | { 101 | return transportURI; 102 | } 103 | 104 | @Override 105 | public String toString() 106 | { 107 | StringBuffer strBuf = new StringBuffer(); 108 | 109 | strBuf.append("SOAPBinding (" + elementType + "):"); 110 | strBuf.append("\nrequired=" + required); 111 | 112 | if (transportURI != null) 113 | { 114 | strBuf.append("\ntransportURI=" + transportURI); 115 | } 116 | 117 | if (style != null) 118 | { 119 | strBuf.append("\nstyle=" + style); 120 | } 121 | 122 | return strBuf.toString(); 123 | } 124 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap12/SOAP12BindingSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap12; 6 | 7 | import java.io.*; 8 | import org.w3c.dom.*; 9 | import javax.wsdl.*; 10 | import javax.wsdl.extensions.*; 11 | import javax.wsdl.extensions.soap12.*; 12 | import javax.xml.namespace.*; 13 | import com.ibm.wsdl.*; 14 | import com.ibm.wsdl.util.xml.*; 15 | 16 | /** 17 | * Copied from com.ibm.wsdl.extensions.soap.SOAPBindingSerializer 18 | */ 19 | public class SOAP12BindingSerializer implements ExtensionSerializer, 20 | ExtensionDeserializer, 21 | Serializable 22 | { 23 | public static final long serialVersionUID = 1; 24 | 25 | public void marshall(Class parentType, 26 | QName elementType, 27 | ExtensibilityElement extension, 28 | PrintWriter pw, 29 | Definition def, 30 | ExtensionRegistry extReg) 31 | throws WSDLException 32 | { 33 | SOAP12Binding soapBinding = (SOAP12Binding)extension; 34 | 35 | if (soapBinding != null) 36 | { 37 | String tagName = 38 | DOMUtils.getQualifiedValue(SOAP12Constants.NS_URI_SOAP12, 39 | "binding", 40 | def); 41 | 42 | pw.print(" <" + tagName); 43 | 44 | DOMUtils.printAttribute(SOAP12Constants.ATTR_STYLE, 45 | soapBinding.getStyle(), 46 | pw); 47 | DOMUtils.printAttribute(SOAP12Constants.ATTR_TRANSPORT, 48 | soapBinding.getTransportURI(), 49 | pw); 50 | 51 | Boolean required = soapBinding.getRequired(); 52 | 53 | if (required != null) 54 | { 55 | DOMUtils.printQualifiedAttribute(Constants.Q_ATTR_REQUIRED, 56 | required.toString(), 57 | def, 58 | pw); 59 | } 60 | 61 | pw.println("/>"); 62 | } 63 | } 64 | 65 | public ExtensibilityElement unmarshall(Class parentType, 66 | QName elementType, 67 | Element el, 68 | Definition def, 69 | ExtensionRegistry extReg) 70 | throws WSDLException 71 | { 72 | SOAP12Binding soapBinding = (SOAP12Binding)extReg.createExtension(parentType, 73 | elementType); 74 | String transportURI = DOMUtils.getAttribute(el, 75 | SOAP12Constants.ATTR_TRANSPORT); 76 | String style = DOMUtils.getAttribute(el, SOAP12Constants.ATTR_STYLE); 77 | String requiredStr = DOMUtils.getAttributeNS(el, 78 | Constants.NS_URI_WSDL, 79 | Constants.ATTR_REQUIRED); 80 | 81 | if (transportURI != null) 82 | { 83 | soapBinding.setTransportURI(transportURI); 84 | } 85 | 86 | if (style != null) 87 | { 88 | soapBinding.setStyle(style); 89 | } 90 | 91 | if (requiredStr != null) 92 | { 93 | soapBinding.setRequired(Boolean.valueOf(requiredStr)); 94 | } 95 | 96 | return soapBinding; 97 | } 98 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap12/SOAP12Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap12; 6 | 7 | import javax.xml.namespace.*; 8 | import com.ibm.wsdl.*; 9 | 10 | /** 11 | * Based on com.ibm.wsdl.extensions.soap.SOAPConstants 12 | */ 13 | public class SOAP12Constants 14 | { 15 | // Namespace URIs. 16 | public static final String NS_URI_SOAP12 = 17 | "http://schemas.xmlsoap.org/wsdl/soap12/"; 18 | 19 | // Element names. 20 | public static final String ELEM_BODY = "body"; 21 | public static final String ELEM_HEADER = "header"; 22 | public static final String ELEM_HEADER_FAULT = "headerfault"; 23 | public static final String ELEM_ADDRESS = "address"; 24 | 25 | // Qualified element names. 26 | public static final QName Q_ELEM_SOAP_BINDING = 27 | new QName(NS_URI_SOAP12, Constants.ELEM_BINDING); 28 | public static final QName Q_ELEM_SOAP_BODY = 29 | new QName(NS_URI_SOAP12, ELEM_BODY); 30 | public static final QName Q_ELEM_SOAP_HEADER = 31 | new QName(NS_URI_SOAP12, ELEM_HEADER); 32 | public static final QName Q_ELEM_SOAP_HEADER_FAULT = 33 | new QName(NS_URI_SOAP12, ELEM_HEADER_FAULT); 34 | public static final QName Q_ELEM_SOAP_ADDRESS = 35 | new QName(NS_URI_SOAP12, ELEM_ADDRESS); 36 | public static final QName Q_ELEM_SOAP_OPERATION = 37 | new QName(NS_URI_SOAP12, Constants.ELEM_OPERATION); 38 | public static final QName Q_ELEM_SOAP_FAULT = 39 | new QName(NS_URI_SOAP12, Constants.ELEM_FAULT); 40 | 41 | // Attribute names. 42 | public static final String ATTR_TRANSPORT = "transport"; 43 | public static final String ATTR_STYLE = "style"; 44 | public static final String ATTR_SOAP_ACTION = "soapAction"; 45 | public static final String ATTR_SOAP_ACTION_REQUIRED = "soapActionRequired"; 46 | public static final String ATTR_PARTS = "parts"; 47 | public static final String ATTR_USE = "use"; 48 | public static final String ATTR_ENCODING_STYLE = "encodingStyle"; 49 | public static final String ATTR_PART = "part"; 50 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap12/SOAP12FaultImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap12; 6 | 7 | import javax.wsdl.extensions.soap12.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * Based on com.ibm.wsdl.extensions.soap.SOAPFaultImpl 12 | */ 13 | public class SOAP12FaultImpl implements SOAP12Fault 14 | { 15 | protected QName elementType = SOAP12Constants.Q_ELEM_SOAP_FAULT; 16 | protected Boolean required = null; 17 | protected String name = null; 18 | protected String use = null; 19 | protected String encodingStyle = null; 20 | protected String namespaceURI = null; 21 | 22 | public static final long serialVersionUID = 1; 23 | 24 | /** 25 | * Set the type of this extensibility element. 26 | * 27 | * @param elementType the type 28 | */ 29 | @Override 30 | public void setElementType(QName elementType) 31 | { 32 | this.elementType = elementType; 33 | } 34 | 35 | /** 36 | * Get the type of this extensibility element. 37 | * 38 | * @return the extensibility element's type 39 | */ 40 | public QName getElementType() 41 | { 42 | return elementType; 43 | } 44 | 45 | /** 46 | * Set whether or not the semantics of this extension 47 | * are required. Relates to the wsdl:required attribute. 48 | */ 49 | @Override 50 | public void setRequired(Boolean required) 51 | { 52 | this.required = required; 53 | } 54 | 55 | /** 56 | * Get whether or not the semantics of this extension 57 | * are required. Relates to the wsdl:required attribute. 58 | */ 59 | public Boolean getRequired() 60 | { 61 | return required; 62 | } 63 | 64 | /** 65 | * Set the name for this SOAP fault. 66 | * 67 | * @param name the desired name 68 | */ 69 | @Override 70 | public void setName(String name) 71 | { 72 | this.name = name; 73 | } 74 | 75 | /** 76 | * Get the name for this SOAP fault. 77 | */ 78 | public String getName() 79 | { 80 | return name; 81 | } 82 | 83 | /** 84 | * Set the use for this SOAP fault. 85 | * 86 | * @param use the desired use 87 | */ 88 | @Override 89 | public void setUse(String use) 90 | { 91 | this.use = use; 92 | } 93 | 94 | /** 95 | * Get the use for this SOAP fault. 96 | */ 97 | public String getUse() 98 | { 99 | return use; 100 | } 101 | 102 | /** 103 | * Set the encodingStyle for this SOAP fault. 104 | * 105 | * @param encodingStyle the desired encodingStyle 106 | */ 107 | @Override 108 | public void setEncodingStyle(String encodingStyle) 109 | { 110 | this.encodingStyle = encodingStyle; 111 | } 112 | 113 | /** 114 | * Get the encodingStyle for this SOAP fault. 115 | */ 116 | public String getEncodingStyle() 117 | { 118 | return encodingStyle; 119 | } 120 | 121 | /** 122 | * Set the namespace URI for this SOAP fault. 123 | * 124 | * @param namespaceURI the desired namespace URI 125 | */ 126 | @Override 127 | public void setNamespaceURI(String namespaceURI) 128 | { 129 | this.namespaceURI = namespaceURI; 130 | } 131 | 132 | /** 133 | * Get the namespace URI for this SOAP fault. 134 | */ 135 | public String getNamespaceURI() 136 | { 137 | return namespaceURI; 138 | } 139 | 140 | @Override 141 | public String toString() 142 | { 143 | StringBuffer strBuf = new StringBuffer(); 144 | 145 | strBuf.append("SOAPFault (" + elementType + "):"); 146 | strBuf.append("\nrequired=" + required); 147 | 148 | if (name != null) 149 | { 150 | strBuf.append("\nname=" + name); 151 | } 152 | 153 | if (use != null) 154 | { 155 | strBuf.append("\nuse=" + use); 156 | } 157 | 158 | if (encodingStyle != null) 159 | { 160 | strBuf.append("\nencodingStyle=" + encodingStyle); 161 | } 162 | 163 | if (namespaceURI != null) 164 | { 165 | strBuf.append("\nnamespaceURI=" + namespaceURI); 166 | } 167 | 168 | return strBuf.toString(); 169 | } 170 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/extensions/soap12/SOAP12OperationImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2006 3 | */ 4 | 5 | package com.ibm.wsdl.extensions.soap12; 6 | 7 | import javax.wsdl.extensions.soap12.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * Based on com.ibm.wsdl.extensions.soap.SOAPOperationImpl 12 | */ 13 | public class SOAP12OperationImpl implements SOAP12Operation 14 | { 15 | protected QName elementType = SOAP12Constants.Q_ELEM_SOAP_OPERATION; 16 | protected Boolean required = null; 17 | protected String soapActionURI = null; 18 | protected Boolean soapActionRequired = null; 19 | protected String style = null; 20 | 21 | public static final long serialVersionUID = 1; 22 | 23 | /** 24 | * Set the type of this extensibility element. 25 | * 26 | * @param elementType the type 27 | */ 28 | @Override 29 | public void setElementType(QName elementType) 30 | { 31 | this.elementType = elementType; 32 | } 33 | 34 | /** 35 | * Get the type of this extensibility element. 36 | * 37 | * @return the extensibility element's type 38 | */ 39 | public QName getElementType() 40 | { 41 | return elementType; 42 | } 43 | 44 | /** 45 | * Set whether or not the semantics of this extension 46 | * are required. Relates to the wsdl:required attribute. 47 | */ 48 | @Override 49 | public void setRequired(Boolean required) 50 | { 51 | this.required = required; 52 | } 53 | 54 | /** 55 | * Get whether or not the semantics of this extension 56 | * are required. Relates to the wsdl:required attribute. 57 | */ 58 | public Boolean getRequired() 59 | { 60 | return required; 61 | } 62 | 63 | /** 64 | * Set the SOAP action attribute. 65 | * 66 | * @param soapActionURI the desired value of the SOAP 67 | * action header for this operation. 68 | */ 69 | @Override 70 | public void setSoapActionURI(String soapActionURI) 71 | { 72 | this.soapActionURI = soapActionURI; 73 | } 74 | 75 | /** 76 | * Get the value of the SOAP action attribute. 77 | * 78 | * @return the SOAP action attribute's value 79 | */ 80 | public String getSoapActionURI() 81 | { 82 | return soapActionURI; 83 | } 84 | 85 | /** 86 | * Specify whether the SOAP Action is required for this operation. 87 | * 88 | * @param soapActionRequired true if the SOAP Action is required, otherwise false. 89 | */ 90 | @Override 91 | public void setSoapActionRequired(Boolean soapActionRequired) 92 | { 93 | this.soapActionRequired = soapActionRequired; 94 | } 95 | 96 | /** 97 | * Indicates whether the SOAP Action is required for this operation. 98 | * 99 | * @return true if the SOAP action is required, otherwise false. 100 | */ 101 | public Boolean getSoapActionRequired() 102 | { 103 | return soapActionRequired; 104 | } 105 | 106 | /** 107 | * Set the style for this SOAP operation. 108 | * 109 | * @param style the desired style 110 | */ 111 | @Override 112 | public void setStyle(String style) 113 | { 114 | this.style = style; 115 | } 116 | 117 | /** 118 | * Get the style for this SOAP operation. 119 | */ 120 | public String getStyle() 121 | { 122 | return style; 123 | } 124 | 125 | @Override 126 | public String toString() 127 | { 128 | StringBuffer strBuf = new StringBuffer(); 129 | 130 | strBuf.append("SOAPOperation (" + elementType + "):"); 131 | strBuf.append("\nrequired=" + required); 132 | 133 | if (soapActionURI != null) 134 | { 135 | strBuf.append("\nsoapActionURI=" + soapActionURI); 136 | } 137 | 138 | if (soapActionRequired != null) 139 | { 140 | strBuf.append("\nsoapActionRequired=" + soapActionRequired); 141 | } 142 | 143 | if (style != null) 144 | { 145 | strBuf.append("\nstyle=" + style); 146 | } 147 | 148 | return strBuf.toString(); 149 | } 150 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/factory/WSDLFactoryImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.factory; 6 | 7 | import javax.wsdl.*; 8 | import javax.wsdl.extensions.*; 9 | import javax.wsdl.factory.*; 10 | import javax.wsdl.xml.*; 11 | import com.ibm.wsdl.*; 12 | import com.ibm.wsdl.extensions.*; 13 | import com.ibm.wsdl.xml.*; 14 | 15 | /** 16 | * This class is a concrete implementation of the abstract class 17 | * WSDLFactory. Some ideas used here have been shamelessly 18 | * copied from the wonderful JAXP and Xerces work. 19 | * 20 | * @author Matthew J. Duftler (duftler@us.ibm.com) 21 | */ 22 | public class WSDLFactoryImpl extends WSDLFactory 23 | { 24 | /** 25 | * Create a new instance of a Definition, with an instance 26 | * of a PopulatedExtensionRegistry as its ExtensionRegistry. 27 | * 28 | * @see com.ibm.wsdl.extensions.PopulatedExtensionRegistry 29 | */ 30 | @Override 31 | public Definition newDefinition() 32 | { 33 | Definition def = new DefinitionImpl(); 34 | ExtensionRegistry extReg = newPopulatedExtensionRegistry(); 35 | 36 | def.setExtensionRegistry(extReg); 37 | 38 | return def; 39 | } 40 | 41 | /** 42 | * Create a new instance of a WSDLReader. 43 | */ 44 | @Override 45 | public WSDLReader newWSDLReader() 46 | { 47 | return new WSDLReaderImpl(); 48 | } 49 | 50 | /** 51 | * Create a new instance of a WSDLWriter. 52 | */ 53 | @Override 54 | public WSDLWriter newWSDLWriter() 55 | { 56 | return new WSDLWriterImpl(); 57 | } 58 | 59 | /** 60 | * Create a new instance of an ExtensionRegistry with pre-registered 61 | * serializers/deserializers for the SOAP, HTTP and MIME 62 | * extensions. Java extensionTypes are also mapped for all 63 | * the SOAP, HTTP and MIME extensions. 64 | */ 65 | @Override 66 | public ExtensionRegistry newPopulatedExtensionRegistry() 67 | { 68 | return new PopulatedExtensionRegistry(); 69 | } 70 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/util/IOUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.util; 6 | 7 | import java.io.*; 8 | 9 | /** 10 | * This file is a collection of input/output utilities. 11 | * 12 | * @author Sanjiva Weerawarana 13 | * @author Matthew J. Duftler 14 | */ 15 | public class IOUtils { 16 | // debug flag - generates debug stuff if true 17 | static boolean debug = false; 18 | 19 | private IOUtils() { 20 | 21 | } 22 | 23 | ////////////////////////////////////////////////////////////////////////// 24 | 25 | public static String getStringFromReader (Reader reader) throws IOException { 26 | BufferedReader bufIn = new BufferedReader(reader); 27 | StringWriter swOut = new StringWriter(); 28 | PrintWriter pwOut = new PrintWriter(swOut); 29 | String tempLine; 30 | 31 | while ((tempLine = bufIn.readLine()) != null) { 32 | pwOut.println(tempLine); 33 | } 34 | 35 | pwOut.flush(); 36 | 37 | return swOut.toString(); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/util/ObjectRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package com.ibm.wsdl.util; 6 | 7 | import java.util.*; 8 | 9 | /** 10 | * The ObjectRegistry is used to do name-to-object reference lookups. 11 | * If an ObjectRegistry is passed as a constructor argument, then this 12 | * ObjectRegistry will be a cascading registry: when a lookup is 13 | * invoked, it will first look in its own table for a name, and if it's not 14 | * there, it will cascade to the parent ObjectRegistry. 15 | * All registration is always local. [??] 16 | * 17 | * @author Sanjiva Weerawarana 18 | * @author Matthew J. Duftler 19 | */ 20 | public class ObjectRegistry { 21 | Hashtable reg = new Hashtable (); 22 | ObjectRegistry parent = null; 23 | 24 | public ObjectRegistry () { 25 | } 26 | 27 | public ObjectRegistry (Map initialValues) { 28 | if(initialValues != null) 29 | { 30 | Iterator itr = initialValues.keySet().iterator(); 31 | while(itr.hasNext()) 32 | { 33 | String name = (String) itr.next(); 34 | register(name, initialValues.get(name)); 35 | } 36 | } 37 | } 38 | 39 | public ObjectRegistry (ObjectRegistry parent) { 40 | this.parent = parent; 41 | } 42 | 43 | // register an object 44 | public void register (String name, Object obj) { 45 | reg.put (name, obj); 46 | } 47 | 48 | // unregister an object (silent if unknown name) 49 | public void unregister (String name) { 50 | reg.remove (name); 51 | } 52 | 53 | // lookup an object: cascade up if needed 54 | public Object lookup (String name) throws IllegalArgumentException { 55 | Object obj = reg.get (name); 56 | 57 | if (obj == null && parent != null) { 58 | obj = parent.lookup (name); 59 | } 60 | 61 | if (obj == null) { 62 | throw new IllegalArgumentException ("object '" + name + "' not in registry"); 63 | } 64 | 65 | return obj; 66 | } 67 | } -------------------------------------------------------------------------------- /src/main/java/com/ibm/wsdl/util/xml/QNameUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2002, 2005 3 | */ 4 | 5 | package com.ibm.wsdl.util.xml; 6 | 7 | import javax.xml.namespace.*; 8 | import org.w3c.dom.*; 9 | 10 | public class QNameUtils 11 | { 12 | public static boolean matches(QName qname, Node node) 13 | { 14 | return (node != null && qname.equals(newQName(node))); 15 | } 16 | 17 | public static QName newQName(Node node) 18 | { 19 | if (node != null) 20 | { 21 | return new QName(node.getNamespaceURI(), node.getLocalName()); 22 | } 23 | else 24 | { 25 | return new QName(null, null); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/BindingFault.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents a fault binding. That is, it contains 9 | * the information that would be specified in a fault element 10 | * contained within an operation element contained within a 11 | * binding element. 12 | * 13 | * @author Matthew J. Duftler 14 | */ 15 | public interface BindingFault extends WSDLElement 16 | { 17 | /** 18 | * Set the name of this fault binding. 19 | * 20 | * @param name the desired name 21 | */ 22 | void setName(String name); 23 | 24 | /** 25 | * Get the name of this fault binding. 26 | * 27 | * @return the fault binding name 28 | */ 29 | String getName(); 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/BindingInput.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents an input binding. That is, it contains 9 | * the information that would be specified in an input element 10 | * contained within an operation element contained within a 11 | * binding element. 12 | * 13 | * @author Matthew J. Duftler 14 | */ 15 | public interface BindingInput extends WSDLElement 16 | { 17 | /** 18 | * Set the name of this input binding. 19 | * 20 | * @param name the desired name 21 | */ 22 | void setName(String name); 23 | 24 | /** 25 | * Get the name of this input binding. 26 | * 27 | * @return the input binding name 28 | */ 29 | String getName(); 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/BindingOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | import java.util.*; 8 | 9 | /** 10 | * This interface represents a WSDL operation binding. 11 | * That is, it holds the information that would be 12 | * specified in the operation element contained within 13 | * a binding element. 14 | * 15 | * @author Matthew J. Duftler (duftler@us.ibm.com) 16 | */ 17 | public interface BindingOperation extends WSDLElement 18 | { 19 | /** 20 | * Set the name of this operation binding. 21 | * 22 | * @param name the desired name 23 | */ 24 | void setName(String name); 25 | 26 | /** 27 | * Get the name of this operation binding. 28 | * 29 | * @return the operation binding name 30 | */ 31 | String getName(); 32 | 33 | /** 34 | * Set the operation that this operation binding binds. 35 | * 36 | * @param operation the operation this operation binding binds 37 | */ 38 | void setOperation(Operation operation); 39 | 40 | /** 41 | * Get the operation that this operation binding binds. 42 | * 43 | * @return the operation that this operation binding binds 44 | */ 45 | Operation getOperation(); 46 | 47 | /** 48 | * Set the input binding for this operation binding. 49 | * 50 | * @param bindingInput the new input binding 51 | */ 52 | void setBindingInput(BindingInput bindingInput); 53 | 54 | /** 55 | * Get the input binding for this operation binding. 56 | * 57 | * @return the input binding 58 | */ 59 | BindingInput getBindingInput(); 60 | 61 | /** 62 | * Set the output binding for this operation binding. 63 | * 64 | * @param bindingOutput the new output binding 65 | */ 66 | void setBindingOutput(BindingOutput bindingOutput); 67 | 68 | /** 69 | * Get the output binding for this operation binding. 70 | * 71 | * @return the output binding for the operation binding 72 | */ 73 | BindingOutput getBindingOutput(); 74 | 75 | /** 76 | * Add a fault binding. 77 | * 78 | * @param bindingFault the new fault binding 79 | */ 80 | void addBindingFault(BindingFault bindingFault); 81 | 82 | /** 83 | * Remove a fault binding. 84 | * 85 | * @param name the name of the fault binding to be removed 86 | * @return the BindingFault which was removed 87 | */ 88 | BindingFault removeBindingFault(String name); 89 | 90 | /** 91 | * Get the specified fault binding. 92 | * 93 | * @param name the name of the desired fault binding. 94 | * @return the corresponding fault binding, or null if there wasn't 95 | * any matching fault binding 96 | */ 97 | BindingFault getBindingFault(String name); 98 | 99 | /** 100 | * Get all the fault bindings associated with this operation binding. 101 | * 102 | * @return names of fault bindings 103 | */ 104 | Map getBindingFaults(); 105 | 106 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/BindingOutput.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents an output binding. That is, it contains 9 | * the information that would be specified in an output element 10 | * contained within an operation element contained within a 11 | * binding element. 12 | * 13 | * @author Matthew J. Duftler 14 | */ 15 | public interface BindingOutput extends WSDLElement 16 | { 17 | /** 18 | * Set the name of this output binding. 19 | * 20 | * @param name the desired name 21 | */ 22 | void setName(String name); 23 | 24 | /** 25 | * Get the name of this output binding. 26 | * 27 | * @return the output binding name 28 | */ 29 | String getName(); 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Fault.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents a fault message, and contains the name 9 | * of the fault and the message itself. 10 | * 11 | * @author Matthew J. Duftler 12 | */ 13 | public interface Fault extends WSDLElement 14 | { 15 | /** 16 | * Set the name of this fault message. 17 | * 18 | * @param name the desired name 19 | */ 20 | void setName(String name); 21 | 22 | /** 23 | * Get the name of this fault message. 24 | * 25 | * @return the fault message name 26 | */ 27 | String getName(); 28 | 29 | void setMessage(Message message); 30 | 31 | Message getMessage(); 32 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Import.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents an import, and may contain a reference 9 | * to the imported definition. 10 | * 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public interface Import extends WSDLElement 14 | { 15 | /** 16 | * Set the namespace URI of this import. 17 | * 18 | * @param namespaceURI the desired namespace URI 19 | */ 20 | void setNamespaceURI(String namespaceURI); 21 | 22 | /** 23 | * Get the namespace URI of this import. 24 | */ 25 | String getNamespaceURI(); 26 | 27 | /** 28 | * Set the location URI of this import. 29 | * 30 | * @param locationURI the desired location URI 31 | */ 32 | void setLocationURI(String locationURI); 33 | 34 | /** 35 | * Get the location URI of this import. 36 | */ 37 | String getLocationURI(); 38 | 39 | /** 40 | * This property can be used to hang a referenced Definition, 41 | * and the top-level Definition (i.e. the one with the <import>) 42 | * will use this Definition when resolving referenced WSDL parts. 43 | * This would need to be made into a generic reference to handle 44 | * other types of referenced documents. 45 | */ 46 | void setDefinition(Definition definition); 47 | 48 | /** 49 | * This property can be used to hang a referenced Definition, 50 | * and the top-level Definition (i.e. the one with the <import>) 51 | * will use this Definition when resolving referenced WSDL parts. 52 | * This would need to be made into a generic reference to handle 53 | * other types of referenced documents. 54 | */ 55 | Definition getDefinition(); 56 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Input.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents an input message, and contains the name 9 | * of the input and the message itself. 10 | * 11 | * @author Matthew J. Duftler 12 | */ 13 | public interface Input extends WSDLElement 14 | { 15 | /** 16 | * Set the name of this input message. 17 | * 18 | * @param name the desired name 19 | */ 20 | void setName(String name); 21 | 22 | /** 23 | * Get the name of this input message. 24 | * 25 | * @return the input message name 26 | */ 27 | String getName(); 28 | 29 | void setMessage(Message message); 30 | 31 | Message getMessage(); 32 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Message.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | import java.util.*; 8 | import javax.xml.namespace.QName; 9 | 10 | /** 11 | * This interface describes a message used for communication with an operation. 12 | * 13 | * @author Paul Fremantle 14 | * @author Nirmal Mukhi 15 | * @author Matthew J. Duftler 16 | */ 17 | public interface Message extends WSDLElement 18 | { 19 | /** 20 | * Set the name of this message. 21 | * 22 | * @param name the desired name 23 | */ 24 | void setQName(QName name); 25 | 26 | /** 27 | * Get the name of this message. 28 | * 29 | * @return the message name 30 | */ 31 | QName getQName(); 32 | 33 | /** 34 | * Add a part to this message. 35 | * 36 | * @param part the part to be added 37 | */ 38 | void addPart(Part part); 39 | 40 | /** 41 | * Get the specified part. 42 | * 43 | * @param name the name of the desired part. 44 | * @return the corresponding part, or null if there wasn't 45 | * any matching part 46 | */ 47 | Part getPart(String name); 48 | 49 | /** 50 | * Remove the specified part. 51 | * 52 | * @param name the name of the part to be removed. 53 | * @return the part which was removed 54 | */ 55 | Part removePart(String name); 56 | 57 | /** 58 | * Get all the parts defined here. 59 | */ 60 | Map getParts(); 61 | 62 | /** 63 | * Get an ordered list of parts as specified by the partOrder 64 | * argument. 65 | * 66 | * @param partOrder a list of strings, with each string referring 67 | * to a part by its name. If this argument is null, the parts are 68 | * returned in the order in which they were added to the message. 69 | * @return the list of parts 70 | */ 71 | List getOrderedParts(List partOrder); 72 | 73 | void setUndefined(boolean isUndefined); 74 | 75 | boolean isUndefined(); 76 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Operation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | import java.util.*; 8 | 9 | import javax.xml.namespace.QName; 10 | 11 | /** 12 | * This interface represents a WSDL operation. 13 | * It includes information on input, output and fault 14 | * messages associated with usage of the operation. 15 | * 16 | * @author Paul Fremantle (pzf@us.ibm.com) 17 | * @author Nirmal Mukhi (nmukhi@us.ibm.com) 18 | * @author Matthew J. Duftler (duftler@us.ibm.com) 19 | */ 20 | public interface Operation extends WSDLElement 21 | { 22 | /** 23 | * Set the name of this operation. 24 | * 25 | * @param name the desired name 26 | */ 27 | void setName(String name); 28 | 29 | /** 30 | * Get the name of this operation. 31 | * 32 | * @return the operation name 33 | */ 34 | String getName(); 35 | 36 | /** 37 | * Set the input message specification for this operation. 38 | * 39 | * @param input the new input message 40 | */ 41 | void setInput(Input input); 42 | 43 | /** 44 | * Get the input message specification for this operation. 45 | * 46 | * @return the input message 47 | */ 48 | Input getInput(); 49 | 50 | /** 51 | * Set the output message specification for this operation. 52 | * 53 | * @param output the new output message 54 | */ 55 | void setOutput(Output output); 56 | 57 | /** 58 | * Get the output message specification for this operation. 59 | * 60 | * @return the output message specification for the operation 61 | */ 62 | Output getOutput(); 63 | 64 | /** 65 | * Add a fault message that must be associated with this 66 | * operation. 67 | * 68 | * @param fault the new fault message 69 | */ 70 | void addFault(Fault fault); 71 | 72 | /** 73 | * Get the specified fault message. 74 | * 75 | * @param name the name of the desired fault message. 76 | * @return the corresponding fault message, or null if there wasn't 77 | * any matching message 78 | */ 79 | Fault getFault(String name); 80 | 81 | /** 82 | * Remove the specified fault message. 83 | * 84 | * @param name the name of the fault message to be removed. 85 | * @return the fault message which was removed 86 | */ 87 | Fault removeFault(String name); 88 | 89 | /** 90 | * Get all the fault messages associated with this operation. 91 | * 92 | * @return names of fault messages 93 | */ 94 | Map getFaults(); 95 | 96 | /** 97 | * Set the style for this operation (request-response, 98 | * one way, solicit-response or notification). 99 | * 100 | * @param style the new operation style 101 | */ 102 | void setStyle(OperationType style); 103 | 104 | /** 105 | * Get the operation type. 106 | * 107 | * @return the operation type 108 | */ 109 | OperationType getStyle(); 110 | 111 | /** 112 | * Set the parameter ordering for a request-response, 113 | * or solicit-response operation. 114 | * 115 | * @param parameterOrder a list of named parameters 116 | * containing the part names to reflect the desired 117 | * order of parameters for RPC-style operations 118 | */ 119 | void setParameterOrdering(List parameterOrder); 120 | 121 | /** 122 | * Get the parameter ordering for this operation. 123 | * 124 | * @return the parameter ordering, a list consisting 125 | * of message part names 126 | */ 127 | List getParameterOrdering(); 128 | 129 | void setUndefined(boolean isUndefined); 130 | 131 | boolean isUndefined(); 132 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/OperationType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | import java.io.ObjectStreamException; 8 | 9 | /** 10 | * This class represents an operation type which can be one of request-response, solicit response, one way or notification. This represents a safe way to prevent usage of invalid values since the only objects of this class available are the public static instances declared within the class. Need to 11 | * figure out if this should be made into an interface. 12 | */ 13 | public class OperationType implements java.io.Serializable { 14 | private final String id; 15 | private final int intId; 16 | 17 | private static int counter = 0; 18 | 19 | public static final long serialVersionUID = 1; 20 | 21 | public static final OperationType ONE_WAY = new OperationType("ONE_WAY"); 22 | public static final OperationType REQUEST_RESPONSE = new OperationType("REQUEST_RESPONSE"); 23 | public static final OperationType SOLICIT_RESPONSE = new OperationType("SOLICIT_RESPONSE"); 24 | public static final OperationType NOTIFICATION = new OperationType("NOTIFICATION"); 25 | // If new values of op type are ever added (highly unlikely) 26 | // they must be added here, after the existing values. Otherwise 27 | // readResolve will return the wrong instances at deserialization. 28 | 29 | private static final OperationType[] INSTANCES = { ONE_WAY, REQUEST_RESPONSE, SOLICIT_RESPONSE, NOTIFICATION }; 30 | 31 | private OperationType(String id) { 32 | this.id = id; 33 | this.intId = counter++; 34 | } 35 | 36 | private String getId() { 37 | return id; 38 | } 39 | 40 | /* 41 | * The following equals method is not used within wsdl4j but it is historically part of the jsr110 jwsdl API, so it will not likely be removed. Although it overloads the Object.equals method (i.e. it has a different arg) it does not override it, so Object.equals will still be used by the 42 | * readResolve method at deserialization. 43 | */ 44 | public boolean equals(OperationType operationType) { 45 | return operationType != null && id.equals(operationType.getId()); 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return id + "," + intId; 51 | } 52 | 53 | /* 54 | * The readResolve method has been added because this class implements a typesafe enumeration and it is serializable. This method will ensure that at deserialization the orginal instances of the enumeration are used, so that Object.equals and the '==' operator behave as expected. 55 | */ 56 | private Object readResolve() throws ObjectStreamException { 57 | return INSTANCES[intId]; 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Output.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents an output message, and contains the name 9 | * of the output and the message itself. 10 | * 11 | * @author Matthew J. Duftler 12 | */ 13 | public interface Output extends WSDLElement 14 | { 15 | /** 16 | * Set the name of this output message. 17 | * 18 | * @param name the desired name 19 | */ 20 | void setName(String name); 21 | 22 | /** 23 | * Get the name of this output message. 24 | * 25 | * @return the output message name 26 | */ 27 | String getName(); 28 | 29 | void setMessage(Message message); 30 | 31 | Message getMessage(); 32 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Part.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | import javax.xml.namespace.*; 8 | 9 | /** 10 | * This interface represents a message part and contains the part's 11 | * name, elementName, typeName, and any extensibility attributes. 12 | * 13 | * @author Paul Fremantle 14 | * @author Nirmal Mukhi 15 | * @author Matthew J. Duftler 16 | */ 17 | public interface Part extends WSDLElement 18 | { 19 | /** 20 | * Set the name of this part. 21 | * 22 | * @param name the desired name 23 | */ 24 | void setName(String name); 25 | 26 | /** 27 | * Get the name of this part. 28 | * 29 | * @return the part name 30 | */ 31 | String getName(); 32 | 33 | void setElementName(QName elementName); 34 | 35 | QName getElementName(); 36 | 37 | void setTypeName(QName typeName); 38 | 39 | QName getTypeName(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Port.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents a port, an endpoint for the 9 | * functionality described by a particular port type. 10 | * 11 | * @author Paul Fremantle 12 | * @author Nirmal Mukhi 13 | * @author Matthew J. Duftler 14 | */ 15 | public interface Port extends WSDLElement 16 | { 17 | /** 18 | * Set the name of this port. 19 | * 20 | * @param name the desired name 21 | */ 22 | void setName(String name); 23 | 24 | /** 25 | * Get the name of this port. 26 | * 27 | * @return the port name 28 | */ 29 | String getName(); 30 | 31 | /** 32 | * Set the binding this port should refer to. 33 | * 34 | * @param binding the desired binding 35 | */ 36 | void setBinding(Binding binding); 37 | 38 | /** 39 | * Get the binding this port refers to. 40 | * 41 | * @return the binding associated with this port 42 | */ 43 | Binding getBinding(); 44 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Service.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | import java.util.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * This interface represents a service, which groups related 12 | * ports to provide some functionality. 13 | * 14 | * @author Paul Fremantle 15 | * @author Nirmal Mukhi 16 | * @author Matthew J. Duftler 17 | */ 18 | public interface Service extends WSDLElement 19 | { 20 | /** 21 | * Set the name of this service. 22 | * 23 | * @param name the desired name 24 | */ 25 | void setQName(QName name); 26 | 27 | /** 28 | * Get the name of this service. 29 | * 30 | * @return the service name 31 | */ 32 | QName getQName(); 33 | 34 | /** 35 | * Add a port to this service. 36 | * 37 | * @param port the port to be added 38 | */ 39 | void addPort(Port port); 40 | 41 | /** 42 | * Get the specified port. 43 | * 44 | * @param name the name of the desired port. 45 | * @return the corresponding port, or null if there wasn't 46 | * any matching port 47 | */ 48 | Port getPort(String name); 49 | 50 | /** 51 | * Remove the specified port. 52 | * 53 | * @param name the name of the port to be removed. 54 | * @return the port which was removed. 55 | */ 56 | Port removePort(String name); 57 | 58 | /** 59 | * Get all the ports defined here. 60 | */ 61 | Map getPorts(); 62 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/Types.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | /** 8 | * This interface represents the <types> section of a WSDL document. 9 | * 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface Types extends WSDLElement 13 | { 14 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/WSDLElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | import javax.wsdl.extensions.AttributeExtensible; 8 | import javax.wsdl.extensions.ElementExtensible; 9 | 10 | import org.w3c.dom.Element; 11 | 12 | /** 13 | * This interface represents all WSDL Elements 14 | */ 15 | public interface WSDLElement extends java.io.Serializable, 16 | AttributeExtensible, 17 | ElementExtensible 18 | { 19 | /** 20 | * Set the documentation element for this document. 21 | * 22 | * @param docEl the documentation element 23 | */ 24 | void setDocumentationElement(Element docEl); 25 | 26 | /** 27 | * Get the documentation element. 28 | * 29 | * @return the documentation element 30 | */ 31 | Element getDocumentationElement(); 32 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/WSDLException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl; 6 | 7 | public class WSDLException extends Exception 8 | { 9 | public static final long serialVersionUID = 1; 10 | 11 | public static final String INVALID_WSDL = "INVALID_WSDL"; 12 | public static final String PARSER_ERROR = "PARSER_ERROR"; 13 | public static final String OTHER_ERROR = "OTHER_ERROR"; 14 | public static final String CONFIGURATION_ERROR = "CONFIGURATION_ERROR"; 15 | public static final String UNBOUND_PREFIX = "UNBOUND_PREFIX"; 16 | public static final String NO_PREFIX_SPECIFIED = "NO_PREFIX_SPECIFIED"; 17 | 18 | private String faultCode = null; 19 | private Throwable targetThrowable = null; 20 | private String location = null; 21 | 22 | public WSDLException(String faultCode, String msg, Throwable t) 23 | { 24 | super(msg, t); 25 | setFaultCode(faultCode); 26 | } 27 | 28 | public WSDLException(String faultCode, String msg) 29 | { 30 | this(faultCode, msg, null); 31 | } 32 | 33 | public void setFaultCode(String faultCode) 34 | { 35 | this.faultCode = faultCode; 36 | } 37 | 38 | public String getFaultCode() 39 | { 40 | return faultCode; 41 | } 42 | 43 | public void setTargetException(Throwable targetThrowable) 44 | { 45 | this.targetThrowable = targetThrowable; 46 | } 47 | 48 | public Throwable getTargetException() 49 | { 50 | if(targetThrowable == null) return getCause(); 51 | else return targetThrowable; 52 | } 53 | 54 | /** 55 | * Set the location using an XPath expression. Used for error messages. 56 | * 57 | * @param location an XPath expression describing the location where 58 | * the exception occurred. 59 | */ 60 | public void setLocation(String location) 61 | { 62 | this.location = location; 63 | } 64 | 65 | /** 66 | * Get the location, if one was set. Should be an XPath expression which 67 | * is used for error messages. 68 | */ 69 | public String getLocation() 70 | { 71 | return location; 72 | } 73 | 74 | public String getMessage() 75 | { 76 | StringBuffer strBuf = new StringBuffer(); 77 | 78 | strBuf.append("WSDLException"); 79 | 80 | if (location != null) 81 | { 82 | try 83 | { 84 | strBuf.append(" (at " + location + ")"); 85 | } 86 | catch (IllegalArgumentException e) 87 | { 88 | } 89 | } 90 | 91 | if (faultCode != null) 92 | { 93 | strBuf.append(": faultCode=" + faultCode); 94 | } 95 | 96 | String thisMsg = super.getMessage(); 97 | String targetMsg = null; 98 | String targetName = null; 99 | if(getTargetException() != null) 100 | { 101 | targetMsg = getTargetException().getMessage(); 102 | targetName = getTargetException().getClass().getName(); 103 | } 104 | 105 | if (thisMsg != null 106 | && (!thisMsg.equals(targetMsg))) 107 | { 108 | strBuf.append(": " + thisMsg); 109 | } 110 | 111 | if (targetName != null) 112 | { 113 | strBuf.append(": " + targetName); 114 | } 115 | 116 | if (targetMsg != null) 117 | { 118 | strBuf.append(": " + targetMsg); 119 | } 120 | 121 | return strBuf.toString(); 122 | } 123 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/AttributeExtensible.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions; 6 | 7 | import java.util.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * Classes that implement this interface can contain extensibility 12 | * attributes. 13 | * 14 | * @author Matthew J. Duftler 15 | * @author Paul Fremantle 16 | */ 17 | public interface AttributeExtensible 18 | { 19 | int NO_DECLARED_TYPE = -1; 20 | int STRING_TYPE = 0; 21 | int QNAME_TYPE = 1; 22 | int LIST_OF_STRINGS_TYPE = 2; 23 | int LIST_OF_QNAMES_TYPE = 3; 24 | 25 | /** 26 | * Set an extension attribute on this element. Pass in a null value to remove 27 | * an extension attribute. 28 | * 29 | * @param name the extension attribute name 30 | * @param value the extension attribute value. Can be a String, a QName, a 31 | * List of Strings, or a List of QNames. 32 | * 33 | * @see #getExtensionAttribute 34 | * @see #getExtensionAttributes 35 | * @see ExtensionRegistry#registerExtensionAttributeType 36 | * @see ExtensionRegistry#queryExtensionAttributeType 37 | */ 38 | void setExtensionAttribute(QName name, Object value); 39 | 40 | /** 41 | * Retrieve an extension attribute from this element. If the extension 42 | * attribute is not defined, null is returned. 43 | * 44 | * @param name the extension attribute name 45 | * 46 | * @return the value of the extension attribute, or null if 47 | * it is not defined. Can be a String, a QName, a List of Strings, or a List 48 | * of QNames. 49 | * 50 | * @see #setExtensionAttribute 51 | * @see #getExtensionAttributes 52 | * @see ExtensionRegistry#registerExtensionAttributeType 53 | * @see ExtensionRegistry#queryExtensionAttributeType 54 | */ 55 | Object getExtensionAttribute(QName name); 56 | 57 | /** 58 | * Get the map containing all the extension attributes defined 59 | * on this element. The keys are the qnames of the attributes. 60 | * 61 | * @return a map containing all the extension attributes defined 62 | * on this element 63 | * 64 | * @see #setExtensionAttribute 65 | * @see #getExtensionAttribute 66 | * @see ExtensionRegistry#registerExtensionAttributeType 67 | * @see ExtensionRegistry#queryExtensionAttributeType 68 | */ 69 | Map getExtensionAttributes(); 70 | 71 | /** 72 | * Get the list of local attribute names defined for this element in 73 | * the WSDL specification. 74 | * 75 | * @return a List of Strings, one for each local attribute name 76 | */ 77 | List getNativeAttributeNames(); 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/ElementExtensible.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2006 3 | */ 4 | 5 | package javax.wsdl.extensions; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Classes that implement this interface can contain extensibility 11 | * elements. 12 | * 13 | * @author John Kaputin 14 | */ 15 | public interface ElementExtensible { 16 | 17 | /** 18 | * Add an extensibility element. 19 | * 20 | * @param extElement the extensibility element to be added 21 | */ 22 | void addExtensibilityElement(ExtensibilityElement extElement); 23 | 24 | /** 25 | * Remove an extensibility element. 26 | * 27 | * @param extElement the extensibility element to be removed 28 | * @return the extensibility element which was removed 29 | */ 30 | ExtensibilityElement removeExtensibilityElement(ExtensibilityElement extElement); 31 | 32 | /** 33 | * Get all the extensibility elements defined here. 34 | */ 35 | List getExtensibilityElements(); 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/ExtensibilityElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions; 6 | 7 | import javax.xml.namespace.*; 8 | 9 | /** 10 | * This interface should be implemented by classes intending to represent 11 | * extensions. 12 | * 13 | * @author Matthew J. Duftler (duftler@us.ibm.com) 14 | */ 15 | public interface ExtensibilityElement 16 | { 17 | /** 18 | * Set the type of this extensibility element. 19 | * 20 | * @param elementType the type 21 | */ 22 | void setElementType(QName elementType); 23 | 24 | /** 25 | * Get the type of this extensibility element. 26 | * 27 | * @return the extensibility element's type 28 | */ 29 | QName getElementType(); 30 | 31 | /** 32 | * Set whether or not the semantics of this extension 33 | * are required. Relates to the wsdl:required attribute. 34 | */ 35 | void setRequired(Boolean required); 36 | 37 | /** 38 | * Get whether or not the semantics of this extension 39 | * are required. Relates to the wsdl:required attribute. 40 | */ 41 | Boolean getRequired(); 42 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/ExtensionDeserializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions; 6 | 7 | import org.w3c.dom.*; 8 | import javax.wsdl.*; 9 | import javax.xml.namespace.*; 10 | 11 | /** 12 | * This interface should be implemented by classes which deserialize 13 | * org.w3c.dom.Elements into extension-specific instances of 14 | * ExtensibilityElement. 15 | * 16 | * @author Matthew J. Duftler (duftler@us.ibm.com) 17 | */ 18 | public interface ExtensionDeserializer 19 | { 20 | /** 21 | * This method deserializes elements into instances of classes 22 | * which implement the ExtensibilityElement interface. The 23 | * return value should be explicitly cast to the more-specific 24 | * implementing type. 25 | * 26 | * @param parentType a class object indicating where in the WSDL 27 | * document this extensibility element was encountered. For 28 | * example, javax.wsdl.Binding.class would be used to indicate 29 | * this element was encountered as an immediate child of 30 | * a element. 31 | * @param elementType the qname of the extensibility element 32 | * @param el the extensibility element to deserialize 33 | * @param def the definition this extensibility element was 34 | * encountered in 35 | * @param extReg the ExtensionRegistry to use (if needed again) 36 | */ 37 | ExtensibilityElement unmarshall(Class parentType, 38 | QName elementType, 39 | Element el, 40 | Definition def, 41 | ExtensionRegistry extReg) 42 | throws WSDLException; 43 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/ExtensionSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions; 6 | 7 | import java.io.*; 8 | import javax.wsdl.*; 9 | import javax.xml.namespace.*; 10 | 11 | /** 12 | * This interface should be implemented by classes which serialize 13 | * extension-specific instances of ExtensibilityElement into the 14 | * PrintWriter. 15 | * 16 | * @author Matthew J. Duftler (duftler@us.ibm.com) 17 | */ 18 | public interface ExtensionSerializer 19 | { 20 | /** 21 | * This method serializes extension-specific instances of 22 | * ExtensibilityElement into the PrintWriter. 23 | * 24 | * @param parentType a class object indicating where in the WSDL 25 | * definition this extension was encountered. For 26 | * example, javax.wsdl.Binding.class would be used to indicate 27 | * this extensibility element was found in the list of 28 | * extensibility elements belonging to a javax.wsdl.Binding. 29 | * @param elementType the qname of the extensibility element 30 | * @param extension the extensibility element to serialize 31 | * @param def the definition this extensibility element was 32 | * encountered in 33 | * @param extReg the ExtensionRegistry to use (if needed again) 34 | */ 35 | void marshall(Class parentType, 36 | QName elementType, 37 | ExtensibilityElement extension, 38 | PrintWriter pw, 39 | Definition def, 40 | ExtensionRegistry extReg) 41 | throws WSDLException; 42 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/UnknownExtensibilityElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions; 6 | 7 | import org.w3c.dom.*; 8 | import javax.xml.namespace.*; 9 | 10 | /** 11 | * This class is used to wrap arbitrary elements. 12 | * 13 | * @see UnknownExtensionSerializer 14 | * @see UnknownExtensionDeserializer 15 | * 16 | * @author Matthew J. Duftler (duftler@us.ibm.com) 17 | */ 18 | public class UnknownExtensibilityElement implements ExtensibilityElement, 19 | java.io.Serializable 20 | { 21 | protected QName elementType = null; 22 | // Uses the wrapper type so we can tell if it was set or not. 23 | protected Boolean required = null; 24 | protected Element element = null; 25 | 26 | public static final long serialVersionUID = 1; 27 | 28 | /** 29 | * Set the type of this extensibility element. 30 | * 31 | * @param elementType the type 32 | */ 33 | @Override 34 | public void setElementType(QName elementType) 35 | { 36 | this.elementType = elementType; 37 | } 38 | 39 | /** 40 | * Get the type of this extensibility element. 41 | * 42 | * @return the extensibility element's type 43 | */ 44 | public QName getElementType() 45 | { 46 | return elementType; 47 | } 48 | 49 | /** 50 | * Set whether or not the semantics of this extension 51 | * are required. Relates to the wsdl:required attribute. 52 | */ 53 | @Override 54 | public void setRequired(Boolean required) 55 | { 56 | this.required = required; 57 | } 58 | 59 | /** 60 | * Get whether or not the semantics of this extension 61 | * are required. Relates to the wsdl:required attribute. 62 | */ 63 | public Boolean getRequired() 64 | { 65 | return required; 66 | } 67 | 68 | /** 69 | * Set the Element for this extensibility element. 70 | * 71 | * @param element the unknown element that was encountered 72 | */ 73 | public void setElement(Element element) 74 | { 75 | this.element = element; 76 | } 77 | 78 | /** 79 | * Get the Element for this extensibility element. 80 | * 81 | * @return the unknown element that was encountered 82 | */ 83 | public Element getElement() 84 | { 85 | return element; 86 | } 87 | 88 | @Override 89 | public String toString() 90 | { 91 | StringBuilder strBuf = new StringBuilder(); 92 | 93 | strBuf.append("UnknownExtensibilityElement (" + elementType + "):"); 94 | strBuf.append("\nrequired=" + required); 95 | 96 | if (element != null) 97 | { 98 | strBuf.append("\nelement=" + element); 99 | } 100 | 101 | return strBuf.toString(); 102 | } 103 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/UnknownExtensionDeserializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions; 6 | 7 | import org.w3c.dom.*; 8 | import javax.wsdl.*; 9 | import javax.xml.namespace.*; 10 | import com.ibm.wsdl.*; 11 | import com.ibm.wsdl.util.xml.*; 12 | 13 | /** 14 | * This class is used to deserialize arbitrary elements into 15 | * UnknownExtensibilityElement instances. 16 | * 17 | * @see UnknownExtensibilityElement 18 | * @see UnknownExtensionSerializer 19 | * 20 | * @author Matthew J. Duftler (duftler@us.ibm.com) 21 | */ 22 | public class UnknownExtensionDeserializer implements ExtensionDeserializer, 23 | java.io.Serializable 24 | { 25 | public static final long serialVersionUID = 1; 26 | 27 | public ExtensibilityElement unmarshall(Class parentType, 28 | QName elementType, 29 | Element el, 30 | Definition def, 31 | ExtensionRegistry extReg) 32 | throws WSDLException 33 | { 34 | UnknownExtensibilityElement unknownExt = new UnknownExtensibilityElement(); 35 | String requiredStr = DOMUtils.getAttributeNS(el, 36 | Constants.NS_URI_WSDL, 37 | Constants.ATTR_REQUIRED); 38 | 39 | unknownExt.setElementType(elementType); 40 | 41 | if (requiredStr != null) 42 | { 43 | unknownExt.setRequired(Boolean.valueOf(requiredStr)); 44 | } 45 | 46 | unknownExt.setElement(el); 47 | 48 | return unknownExt; 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/UnknownExtensionSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl.extensions; 6 | 7 | import java.io.*; 8 | import javax.wsdl.*; 9 | import javax.xml.namespace.*; 10 | import com.ibm.wsdl.util.xml.*; 11 | 12 | /** 13 | * This class is used to serialize UnknownExtensibilityElement instances 14 | * into the PrintWriter. 15 | * 16 | * @see UnknownExtensibilityElement 17 | * @see UnknownExtensionDeserializer 18 | * 19 | * @author Matthew J. Duftler (duftler@us.ibm.com) 20 | */ 21 | public class UnknownExtensionSerializer implements ExtensionSerializer, 22 | Serializable 23 | { 24 | public static final long serialVersionUID = 1; 25 | 26 | public void marshall(Class parentType, 27 | QName elementType, 28 | ExtensibilityElement extension, 29 | PrintWriter pw, 30 | Definition def, 31 | ExtensionRegistry extReg) 32 | throws WSDLException 33 | { 34 | UnknownExtensibilityElement unknownExt = 35 | (UnknownExtensibilityElement)extension; 36 | 37 | pw.print(" "); 38 | 39 | DOM2Writer.serializeAsXML(unknownExt.getElement(), def.getNamespaces(), pw); 40 | 41 | pw.println(); 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/http/HTTPAddress.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.*; 8 | 9 | /** 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface HTTPAddress extends ExtensibilityElement, java.io.Serializable 13 | { 14 | /** 15 | * Set the location URI for this HTTP address. 16 | * 17 | * @param locationURI the desired location URI 18 | */ 19 | void setLocationURI(String locationURI); 20 | 21 | /** 22 | * Get the location URI for this HTTP address. 23 | */ 24 | String getLocationURI(); 25 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/http/HTTPBinding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.*; 8 | 9 | /** 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface HTTPBinding extends ExtensibilityElement, java.io.Serializable 13 | { 14 | /** 15 | * Set the verb for this HTTP binding. 16 | * 17 | * @param verb the desired verb 18 | */ 19 | void setVerb(String verb); 20 | 21 | /** 22 | * Get the verb for this HTTP binding. 23 | */ 24 | String getVerb(); 25 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/http/HTTPOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.*; 8 | 9 | /** 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface HTTPOperation extends ExtensibilityElement, 13 | java.io.Serializable 14 | { 15 | /** 16 | * Set the location URI for this HTTP operation. 17 | * 18 | * @param locationURI the desired location URI 19 | */ 20 | void setLocationURI(String locationURI); 21 | 22 | /** 23 | * Get the location URI for this HTTP operation. 24 | */ 25 | String getLocationURI(); 26 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/http/HTTPUrlEncoded.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.*; 8 | 9 | /** 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface HTTPUrlEncoded extends ExtensibilityElement, 13 | java.io.Serializable 14 | { 15 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/http/HTTPUrlReplacement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.http; 6 | 7 | import javax.wsdl.extensions.*; 8 | 9 | /** 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface HTTPUrlReplacement extends ExtensibilityElement, 13 | java.io.Serializable 14 | { 15 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/mime/MIMEContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.mime; 6 | 7 | import javax.wsdl.extensions.*; 8 | 9 | /** 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface MIMEContent extends ExtensibilityElement, java.io.Serializable 13 | { 14 | /** 15 | * Set the part for this MIME content. 16 | * 17 | * @param part the desired part 18 | */ 19 | void setPart(String part); 20 | 21 | /** 22 | * Get the part for this MIME content. 23 | */ 24 | String getPart(); 25 | 26 | /** 27 | * Set the type for this MIME content. 28 | * 29 | * @param type the desired type 30 | */ 31 | void setType(String type); 32 | 33 | /** 34 | * Get the type for this MIME content. 35 | */ 36 | String getType(); 37 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/mime/MIMEMimeXml.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.mime; 6 | 7 | import javax.wsdl.extensions.*; 8 | 9 | /** 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface MIMEMimeXml extends ExtensibilityElement, java.io.Serializable 13 | { 14 | /** 15 | * Set the part for this MIME mimeXml. 16 | * 17 | * @param part the desired part 18 | */ 19 | void setPart(String part); 20 | 21 | /** 22 | * Get the part for this MIME mimeXml. 23 | */ 24 | String getPart(); 25 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/mime/MIMEMultipartRelated.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl.extensions.mime; 6 | 7 | import java.util.*; 8 | import javax.wsdl.extensions.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public interface MIMEMultipartRelated extends ExtensibilityElement, 14 | java.io.Serializable 15 | { 16 | /** 17 | * Add a MIME part to this MIME multipart related. 18 | * 19 | * @param mimePart the MIME part to be added 20 | */ 21 | void addMIMEPart(MIMEPart mimePart); 22 | 23 | /** 24 | * Remove a MIME part to this MIME multipart related. 25 | * 26 | * @param mimePart the MIME part to be remove. 27 | * @return the MIME part which was removed. 28 | */ 29 | MIMEPart removeMIMEPart(MIMEPart mimePart); 30 | 31 | /** 32 | * Get all the MIME parts defined here. 33 | */ 34 | List getMIMEParts(); 35 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/mime/MIMEPart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl.extensions.mime; 6 | 7 | import javax.wsdl.extensions.*; 8 | 9 | /** 10 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface MIMEPart extends ElementExtensible, 13 | ExtensibilityElement, 14 | java.io.Serializable 15 | { 16 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/schema/Schema.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.schema; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import javax.wsdl.extensions.ExtensibilityElement; 12 | 13 | import org.w3c.dom.Element; 14 | 15 | /** 16 | * Represents a schema element. 17 | * This is a lightweight schema wrapper that provides access to 18 | * the schema DOM element, but does not parse the schema details. 19 | * The implementor may provide alternative schema parsing if required. 20 | * 21 | * @author Jeremy Hughes 22 | * 23 | */ 24 | public interface Schema extends ExtensibilityElement, Serializable 25 | { 26 | /** 27 | * Get a map of lists containing all the imports defined here. 28 | * The map's keys are the namespaceURIs, and the map's values 29 | * are lists. There is one list for each namespaceURI for which 30 | * imports have been defined. 31 | * 32 | * @return a map of lists of schema imports 33 | */ 34 | Map> getImports(); 35 | 36 | /** 37 | * Create a new schema import 38 | * 39 | * @return the newly created schema import 40 | */ 41 | SchemaImport createImport(); 42 | 43 | /** 44 | * Add an import to this LightWeightSchema 45 | * 46 | * @param importSchema the import to be added 47 | */ 48 | void addImport(SchemaImport importSchema); 49 | 50 | /** 51 | * Get a list containing all of the includes defined here. 52 | * The list elements are schema references. 53 | * 54 | * @return a list of schema references. 55 | */ 56 | List getIncludes(); 57 | 58 | /** 59 | * Create a new schema reference to represent an include. 60 | * 61 | * @return the newly created SchemaReference 62 | */ 63 | SchemaReference createInclude(); 64 | 65 | /** 66 | * Add an include to this LightWeightSchema 67 | * 68 | * @param includeSchema The include to be added, represented as a SchemaReference 69 | */ 70 | void addInclude(SchemaReference includeSchema); 71 | 72 | /** 73 | * Get a list containing all of the redefines defined here. 74 | * The list elements are schema references. 75 | * 76 | * @return a list of schema references. 77 | */ 78 | List getRedefines(); 79 | 80 | /** 81 | * Create a new schema reference to represent a redefine. 82 | * 83 | * @return the newly created SchemaReference 84 | */ 85 | SchemaReference createRedefine(); 86 | 87 | /** 88 | * Add a redefine to this LightWeightSchema 89 | * 90 | * @param redefineSchema The redefine to be added, represented as a SchemaReference 91 | */ 92 | void addRedefine(SchemaReference redefineSchema); 93 | 94 | /** 95 | * Set the DOM Element that represents this schema element. 96 | * 97 | * @param element the DOM element representing this schema 98 | */ 99 | void setElement(Element element); 100 | 101 | /** 102 | * Get the DOM Element that represents this schema element. 103 | * 104 | * @return the DOM element representing this schema 105 | */ 106 | Element getElement(); 107 | 108 | /** 109 | * Set the document base URI of this schema definition. Can be used to 110 | * represent the origin of the schema, and can be exploited 111 | * when resolving relative URIs (e.g. in <import>s). 112 | * 113 | * @param documentBaseURI the document base URI of this schema 114 | */ 115 | void setDocumentBaseURI(String documentBaseURI); 116 | 117 | /** 118 | * Get the document base URI of this schema 119 | * 120 | * @return the document base URI 121 | */ 122 | String getDocumentBaseURI(); 123 | 124 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/schema/SchemaImport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.schema; 6 | 7 | 8 | /** 9 | * Represents an import element within a schema element. 10 | * Similar to an include or redefine, but includes a namespace. 11 | * 12 | * @author Jeremy Hughes 13 | */ 14 | public interface SchemaImport extends SchemaReference 15 | { 16 | /** 17 | * @return Returns the namespace. 18 | */ 19 | String getNamespaceURI(); 20 | 21 | /** 22 | * @param namespace The namespace to set. 23 | */ 24 | void setNamespaceURI(String namespace); 25 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/schema/SchemaReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2004, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.schema; 6 | 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * Represents an include or a redefine element within a schema element. 12 | * 13 | * @author Jeremy Hughes 14 | */ 15 | public interface SchemaReference extends Serializable 16 | { 17 | /** 18 | * Gets the ID attribute of the referenced schema. 19 | * 20 | * @return the id string 21 | */ 22 | String getId(); 23 | 24 | /** 25 | * Sets the ID attribute of the referenced schema. 26 | * 27 | * @param id The id string to set. 28 | */ 29 | void setId(String id); 30 | 31 | /** 32 | * Gets the schemaLocation attribute of the referenced schema. 33 | * 34 | * @return the schemaLocation string. 35 | */ 36 | String getSchemaLocationURI(); 37 | 38 | /** 39 | * Sets the schemaLocation attribute of the referenced schema. 40 | * 41 | * @param schemaLocation The schemaLocation string to set. 42 | */ 43 | void setSchemaLocationURI(String schemaLocation); 44 | 45 | /** 46 | * Gets the referenced schema, represented as a LightWeightSchema. 47 | * 48 | * @return the referenced LightWeightSchema. 49 | */ 50 | Schema getReferencedSchema(); 51 | 52 | /** 53 | * Sets the referenced schema to a LightWeightSchema. 54 | * 55 | * @param referencedSchema The LightWeightSchema to set. 56 | */ 57 | void setReferencedSchema(Schema referencedSchema); 58 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/soap/SOAPAddress.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 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface SOAPAddress 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/soap/SOAPBinding.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 | * @author Matthew J. Duftler (duftler@us.ibm.com) 11 | */ 12 | public interface SOAPBinding 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/soap/SOAPBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.soap; 6 | 7 | import java.util.*; 8 | import javax.wsdl.extensions.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public interface SOAPBody 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 encodingStyles for this SOAP body. 41 | * 42 | * @param encodingStyles the desired encodingStyles 43 | */ 44 | void setEncodingStyles(List encodingStyles); 45 | 46 | /** 47 | * Get the encodingStyles for this SOAP body. 48 | */ 49 | List getEncodingStyles(); 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/soap/SOAPFault.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.soap; 6 | 7 | import java.util.*; 8 | import javax.wsdl.extensions.*; 9 | 10 | /** 11 | * @author Matthew J. Duftler (duftler@us.ibm.com) 12 | */ 13 | public interface SOAPFault extends ExtensibilityElement, java.io.Serializable 14 | { 15 | /** 16 | * Set the name for this SOAP fault. 17 | * 18 | * @param name the desired name 19 | */ 20 | void setName(String name); 21 | 22 | /** 23 | * Get the name for this SOAP fault. 24 | */ 25 | String getName(); 26 | 27 | /** 28 | * Set the use for this SOAP fault. 29 | * 30 | * @param use the desired use 31 | */ 32 | void setUse(String use); 33 | 34 | /** 35 | * Get the use for this SOAP fault. 36 | */ 37 | String getUse(); 38 | 39 | /** 40 | * Set the encodingStyles for this SOAP fault. 41 | * 42 | * @param encodingStyles the desired encodingStyles 43 | */ 44 | void setEncodingStyles(List encodingStyles); 45 | 46 | /** 47 | * Get the encodingStyles for this SOAP fault. 48 | */ 49 | List getEncodingStyles(); 50 | 51 | /** 52 | * Set the namespace URI for this SOAP fault. 53 | * 54 | * @param namespaceURI the desired namespace URI 55 | */ 56 | void setNamespaceURI(String namespaceURI); 57 | 58 | /** 59 | * Get the namespace URI for this SOAP fault. 60 | */ 61 | String getNamespaceURI(); 62 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/soap/SOAPHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2006 3 | */ 4 | 5 | package javax.wsdl.extensions.soap; 6 | 7 | import java.util.*; 8 | import javax.wsdl.extensions.*; 9 | import javax.xml.namespace.*; 10 | 11 | /** 12 | * @author Matthew J. Duftler (duftler@us.ibm.com) 13 | */ 14 | public interface SOAPHeader 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 encodingStyles for this SOAP header. 54 | * 55 | * @param encodingStyles the desired encodingStyles 56 | */ 57 | void setEncodingStyles(List encodingStyles); 58 | 59 | /** 60 | * Get the encodingStyles for this SOAP header. 61 | */ 62 | List getEncodingStyles(); 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 soapHeaderFault the SOAP Header fault to be added. 80 | */ 81 | void addSOAPHeaderFault(SOAPHeaderFault soapHeaderFault); 82 | 83 | /** 84 | * Remove a SOAP header fault. 85 | * 86 | * @param soapHeaderFault the SOAP header fault to be removed. 87 | * @return the SOAP header fault which was removed. 88 | */ 89 | SOAPHeaderFault removeSOAPHeaderFault(SOAPHeaderFault soapHeaderFault); 90 | 91 | /** 92 | * Get a list of all SOAP header faults contained in this SOAP header. 93 | * 94 | * @return a list of all SOAP header faults contained in this SOAP header. 95 | */ 96 | List getSOAPHeaderFaults(); 97 | } -------------------------------------------------------------------------------- /src/main/java/javax/wsdl/extensions/soap/SOAPHeaderFault.java: -------------------------------------------------------------------------------- 1 | /* 2 | * (c) Copyright IBM Corp 2001, 2005 3 | */ 4 | 5 | package javax.wsdl.extensions.soap; 6 | 7 | import java.util.*; 8 | import javax.wsdl.extensions.*; 9 | import javax.xml.namespace.*; 10 | 11 | /** 12 | * @author Matthew J. Duftler (duftler@us.ibm.com) 13 | */ 14 | public interface SOAPHeaderFault extends ExtensibilityElement, 15 | java.io.Serializable 16 | { 17 | /** 18 | * Set the message for this SOAP header fault. 19 | * 20 | * @param message the desired message 21 | */ 22 | void setMessage(QName message); 23 | 24 | /** 25 | * Get the message for this SOAP header fault. 26 | */ 27 | QName getMessage(); 28 | 29 | /** 30 | * Set the part for this SOAP header fault. 31 | * 32 | * @param part the desired part 33 | */ 34 | void setPart(String part); 35 | 36 | /** 37 | * Get the part for this SOAP header fault. 38 | */ 39 | String getPart(); 40 | 41 | /** 42 | * Set the use for this SOAP header fault. 43 | * 44 | * @param use the desired use 45 | */ 46 | void setUse(String use); 47 | 48 | /** 49 | * Get the use for this SOAP header fault. 50 | */ 51 | String getUse(); 52 | 53 | /** 54 | * Set the encodingStyles for this SOAP header fault. 55 | * 56 | * @param encodingStyles the desired encodingStyles 57 | */ 58 | void setEncodingStyles(List encodingStyles); 59 | 60 | /** 61 | * Get the encodingStyles for this SOAP header fault. 62 | */ 63 | List 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 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | --------------------------------------------------------------------------------