Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 68 → Rev 69

/xservices/trunk/test/DateService-soapui-project.xml
17,6 → 17,12
*/</wsdl:documentation>
<wsdl:types>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://ws.xservices.brutex.net" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="dateAdd" type="tns:dateAdd"/>
<xs:element name="dateAddResponse" type="tns:dateAddResponse"/>
<xs:element name="dateTimeDiff" type="tns:dateTimeDiff"/>
<xs:element name="dateTimeDiff2" type="tns:dateTimeDiff2"/>
<xs:element name="dateTimeDiff2Response" type="tns:dateTimeDiff2Response"/>
<xs:element name="dateTimeDiffResponse" type="tns:dateTimeDiffResponse"/>
<xs:element name="formatDate" type="tns:formatDate"/>
<xs:element name="formatDateAdvanced" type="tns:formatDateAdvanced"/>
<xs:element name="formatDateAdvancedResponse" type="tns:formatDateAdvancedResponse"/>
31,6 → 37,18
<xs:element name="parseDateAdvanced" type="tns:parseDateAdvanced"/>
<xs:element name="parseDateAdvancedResponse" type="tns:parseDateAdvancedResponse"/>
<xs:element name="parseDateResponse" type="tns:parseDateResponse"/>
<xs:complexType name="dateAdd">
<xs:sequence>
<xs:element name="datetime" type="xs:dateTime"/>
<xs:element name="value" type="xs:integer"/>
<xs:element name="unit" type="tns:dateTimeUnits"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="dateAddResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:dateTime"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getDate">
<xs:sequence>
<xs:element minOccurs="0" name="timezone" type="xs:string"/>
63,6 → 81,18
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="dateTimeDiff2">
<xs:sequence>
<xs:element name="fromDateTime" type="xs:dateTime"/>
<xs:element name="toDateTime" type="xs:dateTime"/>
<xs:element minOccurs="0" name="PARAM_UNIT" type="tns:dateTimeUnits"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="dateTimeDiff2Response">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="formatDateAdvanced">
<xs:sequence>
<xs:element name="datetime" type="xs:dateTime"/>
78,6 → 108,7
<xs:sequence>
<xs:element name="datetime" type="xs:string"/>
<xs:element name="format" type="tns:dateFormatType"/>
<xs:element minOccurs="0" name="timezone" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="parseDateResponse">
89,6 → 120,7
<xs:sequence>
<xs:element name="datetime" type="xs:string"/>
<xs:element name="format" type="xs:string"/>
<xs:element minOccurs="0" name="timezone" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="parseDateAdvancedResponse">
104,6 → 136,26
<xs:element minOccurs="0" name="return" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="dateTimeDiff">
<xs:sequence>
<xs:element name="fromDateTime" type="xs:dateTime"/>
<xs:element name="toDateTime" type="xs:dateTime"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="dateTimeDiffResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="dateTimeUnits">
<xs:restriction base="xs:string">
<xs:enumeration value="milliseconds"/>
<xs:enumeration value="seconds"/>
<xs:enumeration value="minutes"/>
<xs:enumeration value="hours"/>
<xs:enumeration value="days"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="dateFormatType">
<xs:restriction base="xs:string">
<xs:enumeration value="ISO 8601"/>
123,6 → 175,9
<xs:element name="XServicesFault" type="tns:XServicesFault"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="dateAdd">
<wsdl:part element="tns:dateAdd" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="getDate">
<wsdl:part element="tns:getDate" name="parameters"></wsdl:part>
</wsdl:message>
129,11 → 184,14
<wsdl:message name="getTimestamp">
<wsdl:part element="tns:getTimestamp" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="parseDateAdvancedResponse">
<wsdl:part element="tns:parseDateAdvancedResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="formatDateAdvanced">
<wsdl:part element="tns:formatDateAdvanced" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="parseDateAdvancedResponse">
<wsdl:part element="tns:parseDateAdvancedResponse" name="parameters"></wsdl:part>
<wsdl:message name="parseDateResponse">
<wsdl:part element="tns:parseDateResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="getDateResponse">
<wsdl:part element="tns:getDateResponse" name="parameters"></wsdl:part>
141,9 → 199,6
<wsdl:message name="formatDateAdvancedResponse">
<wsdl:part element="tns:formatDateAdvancedResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="parseDateResponse">
<wsdl:part element="tns:parseDateResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="parseDate">
<wsdl:part element="tns:parseDate" name="parameters"></wsdl:part>
</wsdl:message>
150,6 → 205,9
<wsdl:message name="getInTimezoneResponse">
<wsdl:part element="tns:getInTimezoneResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="dateTimeDiff2Response">
<wsdl:part element="tns:dateTimeDiff2Response" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="parseDateAdvanced">
<wsdl:part element="tns:parseDateAdvanced" name="parameters"></wsdl:part>
</wsdl:message>
162,6 → 220,9
<wsdl:message name="formatDateResponse">
<wsdl:part element="tns:formatDateResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="dateTimeDiff">
<wsdl:part element="tns:dateTimeDiff" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="getTimestampResponse">
<wsdl:part element="tns:getTimestampResponse" name="parameters"></wsdl:part>
</wsdl:message>
168,8 → 229,24
<wsdl:message name="getInTimezone">
<wsdl:part element="tns:getInTimezone" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="dateTimeDiff2">
<wsdl:part element="tns:dateTimeDiff2" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="dateTimeDiffResponse">
<wsdl:part element="tns:dateTimeDiffResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="dateAddResponse">
<wsdl:part element="tns:dateAddResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="DateService">
<wsdl:operation name="dateAdd">
<wsdl:documentation>Add or substract a time span from a date.</wsdl:documentation>
<wsdl:input message="tns:dateAdd" name="dateAdd"></wsdl:input>
<wsdl:output message="tns:dateAddResponse" name="dateAddResponse"></wsdl:output>
<wsdl:fault message="tns:XServicesFault" name="XServicesFault"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getDate">
<wsdl:documentation>Get current date and time.</wsdl:documentation>
<wsdl:input message="tns:getDate" name="getDate"></wsdl:input>
<wsdl:output message="tns:getDateResponse" name="getDateResponse"></wsdl:output>
<wsdl:fault message="tns:XServicesFault" name="XServicesFault"></wsdl:fault>
184,6 → 261,12
<wsdl:output message="tns:formatDateResponse" name="formatDateResponse"></wsdl:output>
<wsdl:fault message="tns:XServicesFault" name="XServicesFault"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="dateTimeDiff2">
<wsdl:documentation>Get elapsed time between to dates.</wsdl:documentation>
<wsdl:input message="tns:dateTimeDiff2" name="dateTimeDiff2"></wsdl:input>
<wsdl:output message="tns:dateTimeDiff2Response" name="dateTimeDiff2Response"></wsdl:output>
<wsdl:fault message="tns:XServicesFault" name="XServicesFault"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="formatDateAdvanced">
<wsdl:input message="tns:formatDateAdvanced" name="formatDateAdvanced"></wsdl:input>
<wsdl:output message="tns:formatDateAdvancedResponse" name="formatDateAdvancedResponse"></wsdl:output>
200,12 → 283,30
<wsdl:fault message="tns:XServicesFault" name="XServicesFault"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getTimestamp">
<wsdl:documentation>Get milliseconds since 01.01.1970 (Unix timestap).</wsdl:documentation>
<wsdl:input message="tns:getTimestamp" name="getTimestamp"></wsdl:input>
<wsdl:output message="tns:getTimestampResponse" name="getTimestampResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="dateTimeDiff">
<wsdl:input message="tns:dateTimeDiff" name="dateTimeDiff"></wsdl:input>
<wsdl:output message="tns:dateTimeDiffResponse" name="dateTimeDiffResponse"></wsdl:output>
<wsdl:fault message="tns:XServicesFault" name="XServicesFault"></wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DateServiceSoapBinding" type="tns:DateService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="dateAdd">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="dateAdd">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="dateAddResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="XServicesFault">
<soap:fault name="XServicesFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getDate">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getDate">
242,6 → 343,18
<soap:fault name="XServicesFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="dateTimeDiff2">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="dateTimeDiff2">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="dateTimeDiff2Response">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="XServicesFault">
<soap:fault name="XServicesFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="formatDateAdvanced">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="formatDateAdvanced">
278,6 → 391,18
<soap:fault name="XServicesFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="dateTimeDiff">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="dateTimeDiff">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="dateTimeDiffResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="XServicesFault">
<soap:fault name="XServicesFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getTimestamp">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getTimestamp">
328,20 → 453,45
<format>mmddyyyy-WW</format>
</ws:formatDateAdvanced>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/formatDateAdvanced"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="" name="parseDate" bindingOperationName="parseDate" type="Request-Response" outputName="parseDateResponse" inputName="parseDate" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/XServices/DateService</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/formatDateAdvanced"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="" name="parseDate" bindingOperationName="parseDate" type="Request-Response" outputName="parseDateResponse" inputName="parseDate" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/XServices/DateService</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
<soapenv:Header/>
<soapenv:Body>
<ws:parseDate>
<datetime>30.05..2011</datetime>
<format>dd.mm.yyyy</format>
</ws:parseDate>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/parseDate"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="" name="parseDateAdvanced" bindingOperationName="parseDateAdvanced" type="Request-Response" outputName="parseDateAdvancedResponse" inputName="parseDateAdvanced" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/XServices/DateService</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
<soapenv:Header/>
<soapenv:Body>
<ws:parseDate>
<ws:parseDateAdvanced>
<datetime>?</datetime>
<format>?</format>
</ws:parseDate>
</ws:parseDateAdvanced>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/parseDate"/></con:call></con:operation><con:operation isOneWay="false" action="" name="parseDateAdvanced" bindingOperationName="parseDateAdvanced" type="Request-Response" outputName="parseDateAdvancedResponse" inputName="parseDateAdvanced" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/XServices/DateService</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
</soapenv:Envelope>]]></con:request><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/parseDateAdvanced"/></con:call></con:operation><con:operation isOneWay="false" action="" name="dateTimeDiff" bindingOperationName="dateTimeDiff" type="Request-Response" outputName="dateTimeDiffResponse" inputName="dateTimeDiff" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/XServices/DateService</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
<soapenv:Header/>
<soapenv:Body>
<ws:parseDateAdvanced>
<datetime>?</datetime>
<format>?</format>
</ws:parseDateAdvanced>
<ws:dateTimeDiff>
<fromDateTime>2011-05-24T19:59:29.233+02:00</fromDateTime>
<toDateTime>2011-05-24T19:59:34.233+03:00</toDateTime>
</ws:dateTimeDiff>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/parseDateAdvanced"/></con:call></con:operation></con:interface><con:properties/><con:wssContainer/></con:soapui-project>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/dateTimeDiff"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="" name="dateTimeDiff2" bindingOperationName="dateTimeDiff2" type="Request-Response" outputName="dateTimeDiff2Response" inputName="dateTimeDiff2" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/XServices/DateService</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
<soapenv:Header/>
<soapenv:Body>
<ws:dateTimeDiff2>
<fromDateTime>2012-05-24T19:59:29.233+02:00</fromDateTime>
<toDateTime>2011-06-24T21:01:59.234+02:00</toDateTime>
</ws:dateTimeDiff2>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/dateTimeDiff2"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="" name="dateAdd" bindingOperationName="dateAdd" type="Request-Response" outputName="dateAddResponse" inputName="dateAdd" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/XServices/DateService</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
<soapenv:Header/>
<soapenv:Body>
<ws:dateAdd>
<datetime>2012-05-24T19:59:29.233+02:00</datetime>
<value>365</value>
<unit>hours</unit>
</ws:dateAdd>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/DateService/dateAdd"/><con:wsrmConfig version="1.2"/></con:call></con:operation></con:interface><con:properties/><con:wssContainer/></con:soapui-project>
/xservices/trunk/src/java/net/brutex/xservices/ws/ArchiveService.java
28,28 → 28,30
 
 
/**
*
* Archiving related web service.
*
* @author Brian Rosenberger, bru@brutex.de
* @since 0.4.0
*/
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
public interface ArchiveService {
 
public static final String WS_OPERATION_BZIP2 = "bzip2";
public static final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
public static final String WS_OPERATION_GZIP = "gzip";
public static final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
public static final String WS_OPERATION_UNZIP = "unzip";
public static final String WS_OPERATION_GUNZIP = "gunzip";
public static final String WS_OPERATION_BUNZIP2 = "bunzip2";
public static final String WS_PARAM_SOURCEFILE = "source";
public static final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
public static final String WS_PARAM_SOURCEURL = "srcurl";
public static final String WS_PARAM_SOURCEARCHIVE = "archivesource";
public static final String WS_PARAM_DESTFILE = "destfile";
public static final String WS_PARAM_DESTDIR = "destdir";
public static final String WS_PARAM_ENCODING = "encoding";
public static final String WS_PARAM_OVERWRITE = "overwrite";
public static final String WS_PARAM_COMPRESS = "compresslevel";
final String WS_OPERATION_BZIP2 = "bzip2";
final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
final String WS_OPERATION_GZIP = "gzip";
final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
final String WS_OPERATION_UNZIP = "unzip";
final String WS_OPERATION_GUNZIP = "gunzip";
final String WS_OPERATION_BUNZIP2 = "bunzip2";
final String WS_PARAM_SOURCEFILE = "source";
final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
final String WS_PARAM_SOURCEURL = "srcurl";
final String WS_PARAM_SOURCEARCHIVE = "archivesource";
final String WS_PARAM_DESTFILE = "destfile";
final String WS_PARAM_DESTDIR = "destdir";
final String WS_PARAM_ENCODING = "encoding";
final String WS_PARAM_OVERWRITE = "overwrite";
final String WS_PARAM_COMPRESS = "compresslevel";
 
/**
* @param src
/xservices/trunk/src/java/net/brutex/xservices/ws/ExecuteService.java
25,7 → 25,9
import net.brutex.xservices.util.BrutexNamespaces;
 
/**
* @author brosenberger
* Task execution web service
* @author Brian Rosenberger
* @since 0.1.0
*
*/
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
/xservices/trunk/src/java/net/brutex/xservices/ws/DateService.java
45,21 → 45,21
public interface DateService {
public static final String SERVICE_NAME = "DateService";
public static final String OPERATION_GETDATE = "getDate";
public static final String OPERATION_GETTIMESTAMP = "getTimestamp";
public static final String OPERATION_GETINTIMEZONE = "getInTimezone";
public static final String OPERATION_FORMATDATE = "formatDate";
public static final String OPERATION_FORMATDATEADVANCED = "formatDateAdvanced";
public static final String OPERATION_PARSEDATE = "parseDate";
public static final String OPERATION_PARSEDATEADVANCED = "parseDateAdvanced";
public static final String OPERATION_DATETIMEDIFF = "dateTimeDiff";
public static final String OPERATION_DATETIMEDIFF2 = "dateTimeDiff2";
public static final String OPERATION_DATEADD = "dateAdd";
final String OPERATION_GETDATE = "getDate";
final String OPERATION_GETTIMESTAMP = "getTimestamp";
final String OPERATION_GETINTIMEZONE = "getInTimezone";
final String OPERATION_FORMATDATE = "formatDate";
final String OPERATION_FORMATDATEADVANCED = "formatDateAdvanced";
final String OPERATION_PARSEDATE = "parseDate";
final String OPERATION_PARSEDATEADVANCED = "parseDateAdvanced";
final String OPERATION_DATETIMEDIFF = "dateTimeDiff";
final String OPERATION_DATETIMEDIFF2 = "dateTimeDiff2";
final String OPERATION_DATEADD = "dateAdd";
public static final String PARAM_TIMEZONE = "timezone";
public static final String PARAM_DATETIME = "datetime";
public static final String PARAM_FORMAT = "format";
public static final String PARAM_UNIT = "unit";
final String PARAM_TIMEZONE = "timezone";
final String PARAM_DATETIME = "datetime";
final String PARAM_FORMAT = "format";
final String PARAM_UNIT = "unit";
/**
* Get current date and time.
97,8 → 97,10
@WebParam(name=PARAM_TIMEZONE) @XmlElement(required=true) String timezone) throws XServicesFault;
/**
* @param cal
* @param format
* Formats a date with pre-defined patterns.
*
* @param cal date time to be formatted
* @param format Pattern to be used for date formating
* @return formatted date/time string
* @throws XServicesFault
*/
107,6 → 109,36
@WebParam(name=PARAM_DATETIME) @XmlElement(required=true) GregorianCalendar cal,
@WebParam(name=PARAM_FORMAT) @XmlElement(required=true) DateFormatType format) throws XServicesFault;
/**
* Formats a date with a free form pattern.
* Uses SimpleDateFormat patterns
* The following pattern letters are defined (all other characters from 'A' to 'Z' and from 'a' to 'z' are reserved):
 
Letter Date or Time Component Presentation Examples
G Era designator Text AD
y Year Year 1996; 96
M Month in year Month July; Jul; 07
w Week in year Number 27
W Week in month Number 2
D Day in year Number 189
d Day in month Number 10
F Day of week in month Number 2
E Day in week Text Tuesday; Tue
a Am/pm marker Text PM
H Hour in day (0-23) Number 0
k Hour in day (1-24) Number 24
K Hour in am/pm (0-11) Number 0
h Hour in am/pm (1-12) Number 12
m Minute in hour Number 30
s Second in minute Number 55
S Millisecond Number 978
z Time zone General time zone Pacific Standard Time; PST; GMT-08:00
Z Time zone RFC 822 time zone -0800
* @param cal Date time to be formatted
* @param format Format string
* @return Date time formatted according to format string
* @throws XServicesFault
*/
@WebMethod(operationName=OPERATION_FORMATDATEADVANCED)
public abstract String formatDateAdvanced(
@WebParam(name=PARAM_DATETIME) @XmlElement(required=true) GregorianCalendar cal,
124,6 → 156,13
@WebParam(name=PARAM_FORMAT) @XmlElement(required=true) String format,
@WebParam(name=PARAM_TIMEZONE) String timezone) throws XServicesFault;
/**
* Calculate elapsed time between two dates.
* @param fromCal First date.
* @param toCal Second date.
* @return Elapsed time in milliseconds
* @throws XServicesFault
*/
@WebMethod(operationName=OPERATION_DATETIMEDIFF)
public abstract BigInteger dateTimeDiff(
@WebParam(name="fromDateTime") @XmlElement(required=true) GregorianCalendar fromCal,
147,12 → 186,14
@WebParam(name="PARAM_UNIT") DateTimeUnits unit) throws XServicesFault;
/**
* Add or substract a time span from a date.
* Add or subtract a time span from a date.
*
* @param cal
* @param unit
* @param cal The initial date.
* @param value The amount to add.
* @param unit The unit the amount is defined in.
* @return New date and time.
* @throws XServicesFault
*
*/
@WebMethod(operationName=OPERATION_DATEADD)
@WSDLDocumentation(value="Add or substract a time span from a date.")