JavaBlog.fr / Java.lu DEVELOPMENT,Documentum,Java,Tools Documentum : Java proxies generation for DFS web services

Documentum : Java proxies generation for DFS web services

Hello,

Juste a post concerning the generation of proxies client for DFS web service project due to ANT script and utilities classes.
Several steps:

  • Create a project TESTWsClientGenerator
  • Add the JAR emc-dfs-rt-remote.jar and emc-dfs-rt.jar (from DocumentumCoreProject\dfs6.7\emc-dfs-sdk-6.7\lib\java) in the BuildPath of your project
  • Get in your workplace the CXF librairies : C:\Workspaces\HUO\ECMExternalLibraries\org\apache\cfx-3.0.3 http://cxf.apache.org/cxf-303-release-notes.html
  • Create a source folder wsgenerator
  • Create the package com.emc.documentum.fs.datamodel.core.content
  • Create the below utilities classes BinaryContent and DataHandlerContent in this com.emc.documentum.fs.datamodel.core.content:
    01package com.emc.documentum.fs.datamodel.core.content;
    02 
    03import java.io.Serializable;
    04import javax.xml.bind.annotation.XmlAccessType;
    05import javax.xml.bind.annotation.XmlAccessorType;
    06import javax.xml.bind.annotation.XmlElement;
    07import javax.xml.bind.annotation.XmlType;
    08 
    09 
    10/**
    11 * <p>Java class for BinaryContent complex type.
    12 *
    13 * <p>The following schema fragment specifies the expected content contained within this class.
    14 *
    15 * <pre>
    16 * &lt;complexType name="BinaryContent">
    17 *   &lt;complexContent>
    18 *     &lt;extension base="{http://content.core.datamodel.fs.documentum.emc.com/}Content">
    19 *       &lt;sequence>
    20 *         &lt;element name="Value" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
    21 *       &lt;/sequence>
    22 *     &lt;/extension>
    23 *   &lt;/complexContent>
    24 * &lt;/complexType>
    25 * </pre>
    26 *
    27 *
    28 */
    29@XmlAccessorType(XmlAccessType.FIELD)
    30@XmlType(name = "BinaryContent", propOrder = {
    31    "value"
    32})
    33public class BinaryContent
    34    extends Content
    35    implements Serializable
    36{
    37 
    38    private final static long serialVersionUID = 1397139757393L;
    39    @XmlElement(name = "Value", required = true)
    40    protected byte[] value;
    41 
    42    /**
    43     * Gets the value of the value property.
    44     *
    45     * @return
    46     *     possible object is
    47     *     byte[]
    48     */
    49    public byte[] getValue() {
    50        return value;
    51    }
    52 
    53    /**
    54     * Sets the value of the value property.
    55     *
    56     * @param value
    57     *     allowed object is
    58     *     byte[]
    59     */
    60    public void setValue(byte[] value) {
    61        this.value = value;
    62    }
    63 
    64}

     

    01package com.emc.documentum.fs.datamodel.core.content;
    02 
    03import java.io.Serializable;
    04import javax.activation.DataHandler;
    05import javax.xml.bind.annotation.XmlAccessType;
    06import javax.xml.bind.annotation.XmlAccessorType;
    07import javax.xml.bind.annotation.XmlElement;
    08import javax.xml.bind.annotation.XmlMimeType;
    09import javax.xml.bind.annotation.XmlType;
    10 
    11 
    12/**
    13 * <p>Java class for DataHandlerContent complex type.
    14 *
    15 * <p>The following schema fragment specifies the expected content contained within this class.
    16 *
    17 * <pre>
    18 * &lt;complexType name="DataHandlerContent">
    19 *   &lt;complexContent>
    20 *     &lt;extension base="{http://content.core.datamodel.fs.documentum.emc.com/}Content">
    21 *       &lt;sequence>
    22 *         &lt;element name="Value" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
    23 *       &lt;/sequence>
    24 *     &lt;/extension>
    25 *   &lt;/complexContent>
    26 * &lt;/complexType>
    27 * </pre>
    28 *
    29 *
    30 */
    31@XmlAccessorType(XmlAccessType.FIELD)
    32@XmlType(name = "DataHandlerContent", propOrder = {
    33    "value"
    34})
    35public class DataHandlerContent
    36    extends Content
    37    implements Serializable
    38{
    39 
    40    private final static long serialVersionUID = 1397139757393L;
    41    @XmlElement(name = "Value", required = true)
    42    @XmlMimeType("*/*")
    43    protected DataHandler value;
    44 
    45    /**
    46     * Gets the value of the value property.
    47     *
    48     * @return
    49     *     possible object is
    50     *     {@link DataHandler }
    51     *    
    52     */
    53    public DataHandler getValue() {
    54        return value;
    55    }
    56 
    57    /**
    58     * Sets the value of the value property.
    59     *
    60     * @param value
    61     *     allowed object is
    62     *     {@link DataHandler }
    63     *    
    64     */
    65    public void setValue(DataHandler value) {
    66        this.value = value;
    67    }
    68 
    69}
  • Create the package com.emc.documentum.fs.utils
  • Create the below utilities classes ContentUtil and ServiceProxyUtils in this com.emc.documentum.fs.utils:
    001package com.emc.documentum.fs.utils;
    002 
    003import java.io.BufferedInputStream;
    004import java.io.ByteArrayInputStream;
    005import java.io.File;
    006import java.io.FileInputStream;
    007import java.io.FileNotFoundException;
    008import java.io.IOException;
    009import java.io.InputStream;
    010import java.io.OutputStream;
    011import java.net.MalformedURLException;
    012import java.net.Proxy;
    013import java.net.URL;
    014import java.net.URLConnection;
    015import java.text.MessageFormat;
    016 
    017import javax.activation.DataHandler;
    018import javax.activation.DataSource;
    019 
    020import com.emc.documentum.fs.datamodel.core.content.BinaryContent;
    021import com.emc.documentum.fs.datamodel.core.content.Content;
    022import com.emc.documentum.fs.datamodel.core.content.DataHandlerContent;
    023import com.emc.documentum.fs.datamodel.core.content.UrlContent;
    024 
    025public class ContentUtil {
    026 
    027    private static class InputStreamDataSource implements DataSource {
    028        private final InputStream inputStream;
    029        private final String type;
    030 
    031        public InputStreamDataSource(InputStream inputStream) throws IOException {
    032            this(inputStream, URLConnection.guessContentTypeFromStream(inputStream));
    033        }
    034 
    035        public InputStreamDataSource(InputStream inputStream, String type) {
    036            this.inputStream = inputStream;
    037            this.type = type;
    038        }
    039 
    040        @Override
    041        public String getContentType() {
    042            if (this.type == null) {
    043                return "application/octet-stream";
    044            }
    045            return this.type;
    046        }
    047 
    048        @Override
    049        public InputStream getInputStream() throws IOException {
    050            return inputStream;
    051        }
    052 
    053        @Override
    054        public String getName() {
    055            return InputStreamDataSource.class.getSimpleName();
    056        }
    057 
    058        @Override
    059        public OutputStream getOutputStream() throws IOException {
    060            throw new IOException("Not Supported");
    061        }
    062    }
    063 
    064    private static DataHandlerContent getDataHandlerContent(DataSource dataSource, String format) {
    065        DataHandlerContent dataHandlerContent = new DataHandlerContent();
    066        dataHandlerContent.setFormat(format);
    067        dataHandlerContent.setValue(new DataHandler(dataSource));
    068        return dataHandlerContent;
    069    }
    070 
    071    public static DataHandlerContent getDataHandlerContent(File file, String format) throws FileNotFoundException, IOException {
    072        return getDataHandlerContent(new InputStreamDataSource(new FileInputStream(file), URLConnection.guessContentTypeFromName(file.getAbsolutePath())), format);
    073    }
    074 
    075    public static DataHandlerContent getDataHandlerContent(InputStream inputStream, String format) throws IOException {
    076        return getDataHandlerContent(new InputStreamDataSource(inputStream), format);
    077    }
    078 
    079    public static InputStream getInputStream(Content content) throws MalformedURLException, IOException {
    080        if (content == null) {
    081            throw new IllegalArgumentException("content cannot be null");
    082        }
    083        if (content instanceof UrlContent) {
    084            UrlContent urlContent = (UrlContent) content;
    085            URL url = new URL(urlContent.getUrl());
    086            URLConnection urlConnection = url.openConnection(Proxy.NO_PROXY);
    087            InputStream inputStream = urlConnection.getInputStream();
    088            BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
    089            return bufferedInputStream;
    090        } else if (content instanceof BinaryContent) {
    091            BinaryContent binaryContent = (BinaryContent) content;
    092            byte[] data = binaryContent.getValue();
    093            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(data);
    094            return byteArrayInputStream;
    095        } else if (content instanceof DataHandlerContent) {
    096            DataHandlerContent dataHandlerContent = (DataHandlerContent) content;
    097            DataHandler dataHandler = dataHandlerContent.getValue();
    098            InputStream inputStream = dataHandler.getInputStream();
    099            return inputStream;
    100        }
    101        throw new RuntimeException(MessageFormat.format("{0} content is not supported", content));
    102    }
    103}

     

    001package com.emc.documentum.fs.utils;
    002 
    003import java.lang.reflect.Constructor;
    004import java.lang.reflect.InvocationTargetException;
    005import java.text.MessageFormat;
    006import java.util.logging.Level;
    007import java.util.logging.Logger;
    008 
    009import javax.xml.bind.JAXBException;
    010import javax.xml.namespace.QName;
    011import javax.xml.parsers.DocumentBuilderFactory;
    012import javax.xml.parsers.ParserConfigurationException;
    013import javax.xml.soap.SOAPElement;
    014import javax.xml.soap.SOAPException;
    015 
    016import org.w3c.dom.Document;
    017import org.w3c.dom.Element;
    018 
    019public class ServiceProxyUtils {
    020 
    021    private static final Logger logger = Logger.getLogger(ServiceProxyUtils.class.getName());
    022 
    023    public static Element getSecurityHeaderForRegisteredToken(String token) throws ParserConfigurationException {
    024        Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
    025        Element wsseSecurity = document.createElementNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "wsse:Security");
    026        Element wsseToken = (Element) wsseSecurity.appendChild(document.createElementNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "wsse:BinarySecurityToken"));
    027        wsseToken.setAttribute("QualificationValueType", "http://schemas.emc.com/documentum#ResourceAccessToken");
    028        wsseToken.setAttributeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "wsu:Id", "RAD");
    029        wsseToken.setTextContent(token);
    030        return wsseSecurity;
    031    }
    032 
    033    public static Element getSecurityHeaderForKerberosToken(String token) throws ParserConfigurationException {
    034        Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
    035        Element securityElement = (Element) document.createElementNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "ns3:Security");
    036        securityElement.setAttribute("xmlns:ns1", "http://www.w3.org/2003/05/soap-envelope");
    037        securityElement.setAttribute("xmlns:ns2", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
    038        Element wsseToken = (Element) securityElement.appendChild(document.createElement("ns3:BinarySecurityToken"));
    039        wsseToken.setAttribute("ValueType", "http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#Kerberosv5_AP_REQ");
    040        wsseToken.setAttribute("EncodingType", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary");
    041        wsseToken.setTextContent(token);
    042        return securityElement;
    043    }
    044 
    045    public static Element getSecurityHeaderForJAXBObject(Object object) throws JAXBException, ParserConfigurationException {
    046        javax.xml.bind.JAXBContext j = javax.xml.bind.JAXBContext.newInstance(object.getClass());
    047        org.w3c.dom.Document document = javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
    048        j.createMarshaller().marshal(object, document);
    049        return document.getDocumentElement();
    050    }
    051 
    052    public static void addBasicSecurity(javax.xml.ws.Service service, final String userName, final String password) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
    053        service.setHandlerResolver(new javax.xml.ws.handler.HandlerResolver() {
    054            @SuppressWarnings("rawtypes")
    055            @Override
    056            public java.util.List<javax.xml.ws.handler.Handler> getHandlerChain(javax.xml.ws.handler.PortInfo portInfo) {
    057                java.util.List<javax.xml.ws.handler.Handler> handlerList = new java.util.ArrayList<javax.xml.ws.handler.Handler>();
    058                handlerList.add(new javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws.handler.soap.SOAPMessageContext>() {
    059                    public void close(javax.xml.ws.handler.MessageContext context) {
    060                    }
    061 
    062                    public java.util.Set<javax.xml.namespace.QName> getHeaders() {
    063                        return new java.util.TreeSet<javax.xml.namespace.QName>();
    064                    }
    065 
    066                    public boolean handleFault(javax.xml.ws.handler.soap.SOAPMessageContext context) {
    067                        return true;
    068                    }
    069 
    070                    public boolean handleMessage(javax.xml.ws.handler.soap.SOAPMessageContext context) {
    071                        Boolean outboundProperty = (Boolean) context.get(javax.xml.ws.handler.MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    072                        if (outboundProperty.booleanValue()) {
    073                            try {
    074                                javax.xml.soap.SOAPEnvelope envelope = context.getMessage().getSOAPPart().getEnvelope();
    075                                javax.xml.soap.SOAPHeader header = envelope.addHeader();
    076                                SOAPElement serviceContextElement = javax.xml.soap.SOAPFactory.newInstance().createElement(new QName("http://context.core.datamodel.fs.documentum.emc.com/", "ServiceContext"));
    077                                SOAPElement basicIdentityElement = serviceContextElement.addChildElement(javax.xml.soap.SOAPFactory.newInstance().createElement("Identities"));
    078                                basicIdentityElement.setAttribute("xsi:type", "BasicIdentity");
    079                                basicIdentityElement.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
    080                                basicIdentityElement.setAttribute("userName", userName);
    081                                basicIdentityElement.setAttribute("password", password);
    082                                header.addChildElement(serviceContextElement);
    083                            } catch (Exception e) {
    084                                throw new RuntimeException("SOAPException in handler => unable to add security layer in header", e);
    085                            }
    086                        } else {
    087                            // inbound => Nothing to do
    088                        }
    089                        return true;
    090                    }
    091                });
    092                return handlerList;
    093            }
    094        });
    095    }
    096 
    097    public static <T extends javax.xml.ws.Service> T getService(Class<T> clazz, java.net.URL wsdlLocation) throws NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    098        return getService(clazz, wsdlLocation, null);
    099    }
    100 
    101    public static <T extends javax.xml.ws.Service> T getService(Class<T> clazz, java.net.URL wsdlLocation, final org.w3c.dom.Element wsseSecurity) throws NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    102        javax.xml.ws.WebServiceClient webServiceClient = clazz.getAnnotation(javax.xml.ws.WebServiceClient.class);
    103        return getService(clazz, wsdlLocation, new javax.xml.namespace.QName(webServiceClient.targetNamespace(), webServiceClient.name()), wsseSecurity);
    104    }
    105 
    106    public static <T extends javax.xml.ws.Service> T getService(Class<T> clazz, java.net.URL wsdlLocation, javax.xml.namespace.QName serviceName, final org.w3c.dom.Element wsseSecurity) throws NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    107        Constructor<T> constructor = clazz.getConstructor(java.net.URL.class, javax.xml.namespace.QName.class);
    108        T result = constructor.newInstance(wsdlLocation, serviceName);
    109        if (wsseSecurity != null) {
    110            result.setHandlerResolver(new javax.xml.ws.handler.HandlerResolver() {
    111                @SuppressWarnings("rawtypes")
    112                @Override
    113                public java.util.List<javax.xml.ws.handler.Handler> getHandlerChain(javax.xml.ws.handler.PortInfo portInfo) {
    114                    java.util.List<javax.xml.ws.handler.Handler> handlerList = new java.util.ArrayList<javax.xml.ws.handler.Handler>();
    115                    handlerList.add(new javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws.handler.soap.SOAPMessageContext>() {
    116                        public void close(javax.xml.ws.handler.MessageContext context) {
    117                        }
    118 
    119                        public java.util.Set<javax.xml.namespace.QName> getHeaders() {
    120                            return new java.util.TreeSet<javax.xml.namespace.QName>();
    121                        }
    122 
    123                        public boolean handleFault(javax.xml.ws.handler.soap.SOAPMessageContext context) {
    124                            return true;
    125                        }
    126 
    127                        public boolean handleMessage(javax.xml.ws.handler.soap.SOAPMessageContext context) {
    128                            Boolean outboundProperty = (Boolean) context.get(javax.xml.ws.handler.MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    129                            if (outboundProperty.booleanValue()) {
    130                                try {
    131                                    javax.xml.soap.SOAPEnvelope envelope = context.getMessage().getSOAPPart().getEnvelope();
    132                                    javax.xml.soap.SOAPHeader header = envelope.addHeader();
    133                                    header.addChildElement(javax.xml.soap.SOAPFactory.newInstance().createElement(wsseSecurity));
    134                                } catch (SOAPException e) {
    135                                    logger.log(Level.SEVERE, MessageFormat.format("SOAPException in handler => unable to add security layer {0} in header", wsseSecurity), e);
    136                                }
    137                            } else {
    138                                // inbound => Nothing to do
    139                            }
    140                            return true;
    141                        }
    142                    });
    143                    return handlerList;
    144                }
    145            });
    146        }
    147        return result;
    148    }
    149 
    150    private ServiceProxyUtils() {
    151        super();
    152    }
    153}
  • Create a file build.properties:
    1application.version=1
    2build.vendor=JavaBlog.fr - Java.lu
  • Create a file simple-binding.xjb:
    1<?xml version="1.0" encoding="UTF-8"?>
    2<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    3    jaxb:version="2.0" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    4    jaxb:extensionBindingPrefixes="xjc">
    5    <jaxb:globalBindings>
    6        <xjc:simple />
    7        <xjc:serializable uid="1397139757393" />
    8    </jaxb:globalBindings>
    9</jaxb:bindings>
  • Create a file wsdllist.txt:
  • Create an ANT script build.xml. Modify the folder of CXF home in script cxf.home:
    1<property name="cxf.home" location="C:\Workspaces\HUO\ECMExternalLibraries\org\apache\cfx-3.0.3" />
    001<?xml version="1.0" encoding="UTF-8"?>
    002<project name="TESTWsClientGenerator" default="dist" basedir=".">
    003    <property file="build.properties" />
    004    <property name="build" value="build" />
    005    <property name="src" value="src" />
    006    <property name="build.src" value="${build}\${src}" />
    007    <property name="build.classes" value="${build}\classes" />
    008    <property name="build.lib" value="lib" />
    009    <property name="build.dist" location="${build}/dist" />
    010    <property name="build.ClientAcceptanceProxy.jar" location="${build.dist}/${ant.project.name}.jar" />
    011 
    012    <property name="cxf.home" location="C:\Workspaces\HUO\ECMExternalLibraries\org\apache\cfx-3.0.3" />
    013 
    014    <target name="dist" depends="create_proxy, build">
    015        <jar basedir="${build.classes}" destfile="${build.ClientAcceptanceProxy.jar}" manifest="${build}/MANIFEST.MF" />
    016    </target>
    017 
    018    <target name="build" depends="javac" />
    019 
    020    <target name="init">
    021        <delete dir="${build}" failonerror="false" />
    022        <mkdir dir="${build}" />
    023        <mkdir dir="${build.lib}" />
    024        <mkdir dir="${build.src}" />
    025    </target>
    026 
    027    <target name="javac" depends="javaclasspath" description="compile the source">
    028        <delete dir="${build.classes}" />
    029        <mkdir dir="${build.classes}" />
    030 
    031        <!-- compile -->
    032        <javac destdir="${build.classes}" debug="true" srcdir="${build.src}" source="1.5" target="1.5" encoding="8859_1">
    033            <classpath refid="classpath.compile" />
    034        </javac>
    035 
    036        <!-- copy all resources to the classes directory -->
    037        <copy todir="${build.classes}">
    038            <fileset dir="${build.src}">
    039                <include name="**/*" />
    040                <exclude name="**/*.java" />
    041            </fileset>
    042        </copy>
    043 
    044        <tstamp>
    045            <format property="build.time" pattern="dd/MM/yyyy HH:mm:ss" />
    046        </tstamp>
    047 
    048        <buildnumber file="${ant.project.name}.buildnumber" />
    049        <property name="build.version" value="${application.version}.${build.number}" />
    050 
    051        <manifest file="${build}/MANIFEST.MF">
    052            <attribute name="Created-By" value="${user.name}" />
    053            <attribute name="Product-Name" value="${ant.project.name}" />
    054            <attribute name="Product-Version" value="${application.version}" />
    055            <attribute name="Build-Version" value="${build.version}" />
    056            <attribute name="Build-Date" value="${build.time}" />
    057            <attribute name="Vendor-Name" value="${build.vendor}" />
    058        </manifest>
    059 
    060    </target>
    061 
    062    <target name="javaclasspath" description="Configure classpath">
    063        <!-- define classpath -->
    064        <path id="classpath.compile">
    065            <fileset dir="${build.lib}">
    066                <include name="**/*.jar" />
    067            </fileset>
    068        </path>
    069    </target>
    070 
    071    <path id="cxf.classpath">
    072        <fileset dir="${cxf.home}/lib">
    073            <include name="*.jar" />
    074        </fileset>
    075    </path>
    076 
    077    <target name="prepare">
    078        <mkdir dir="${build}" />
    079        <mkdir dir="${build.src}" />
    080        <mkdir dir="${build.classes}" />
    081        <mkdir dir="${build.dist}" />
    082    </target>
    083 
    084    <target name="clean">
    085        <delete dir="${build}" includeemptydirs="true" />
    086    </target>
    087 
    088    <target name="create_proxy" depends="init,prepare">
    089        <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
    090            <arg value="-autoNameResolution" />
    091            <arg value="-verbose" />
    092            <arg value="-fe" />
    093            <arg value="jaxws21" />
    094            <arg value="-d" />
    095            <arg value="${build.src}" />
    096            <arg value="-b" />
    097            <arg value="simple-binding.xjb" />
    098            <arg value="-wsdlList" />
    099            <arg value="wsdllist.txt" />
    100 
    101            <classpath>
    102                <path refid="cxf.classpath" />
    103            </classpath>
    104        </java>
    105 
    106        <mkdir dir="${build.src}/com/emc/documentum/fs/utils" />
    107        <copy todir="${build.src}/com/emc/documentum/fs/utils">
    108            <fileset dir="${basedir}">
    109                <include name="*.java" />
    110            </fileset>
    111        </copy>
    112 
    113        <delete dir="${basedir}/src" includeemptydirs="true" />
    114        <copy todir="${basedir}/src">
    115            <fileset dir="${build}/src">
    116                <include name="**/*.java" />
    117            </fileset>
    118        </copy>
    119    </target>
    120</project>
  • Execute the ANT script – Warning: Use the JDK version JavaSE-1.7 – :
    01Buildfile: C:\Workspaces\HUO\TESTWsClientGenerator\build.xml
    02init:
    03   [delete] Deleting directory C:\Workspaces\HUO\TESTWsClientGenerator\build
    04    [mkdir] Created dir: C:\Workspaces\HUO\TESTWsClientGenerator\build
    05    [mkdir] Created dir: C:\Workspaces\HUO\TESTWsClientGenerator\build\src
    06prepare:
    07    [mkdir] Created dir: C:\Workspaces\HUO\TESTWsClientGenerator\build\classes
    08    [mkdir] Created dir: C:\Workspaces\HUO\TESTWsClientGenerator\build\dist
    09create_proxy:
    10      Loading FrontEnd jaxws21 ...
    11      Loading DataBinding jaxb ...
    12      wsdl2java -autoNameResolution -verbose -fe jaxws21 -d build\src -b simple-binding.xjb -wsdlList wsdllist.txt
    13      wsdl2java - Apache CXF 3.0.3
    14    [mkdir] Created dir: C:\Workspaces\HUO\TESTWsClientGenerator\build\src\com\emc\documentum\fs\utils
    15   [delete] Deleting directory C:\Workspaces\HUO\TESTWsClientGenerator\src
    16     [copy] Copying 139 files to C:\Workspaces\HUO\TESTWsClientGenerator\src
    17javaclasspath:
    18javac:
    19   [delete] Deleting directory C:\Workspaces\HUO\TESTWsClientGenerator\build\classes
    20    [mkdir] Created dir: C:\Workspaces\HUO\TESTWsClientGenerator\build\classes
    21    [javac] Compiling 139 source files to C:\Workspaces\HUO\TESTWsClientGenerator\build\classes
    22    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
    23    [javac] 1 warning
    24     [copy] Copied 1 empty directory to 1 empty directory under C:\Workspaces\HUO\TESTWsClientGenerator\build\classes
    25build:
    26dist:
    27      [jar] Building jar: C:\Workspaces\HUO\TESTWsClientGenerator\build\dist\TESTWsClientGenerator.jar
    28BUILD SUCCESSFUL
    29Total time: 12 seconds
  • Result : The folder src contains the proxies classes in order to request the DFS web services. A file TESTWsClientGenerator.buildnumber is generated with the build number:
    1#Build Number for ANT. Do not edit!
    2#Thu Oct 05 11:55:44 CEST 2017
    3build.number=2

    Warning : The BinaryContent and DataHandlerContent classes are double. so, it is possible to remove the package wsgenerator\com\emc\documentum\fs\datamodel\core\content. You could execute again the ANT script.

That’s all!

Huseyin OZVEREN

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post