/xservices/trunk/test/FileRest-soapui-project.xml |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:mime-type |
-text/plain |
\ No newline at end of property |
/xservices/trunk/test/FileService-soapui-project.xml |
---|
34,8 → 34,6 |
<xs:element name="downloadFileResponse" type="tns:downloadFileResponse"/> |
<xs:element name="echoToFile" type="tns:echoToFile"/> |
<xs:element name="echoToFileResponse" type="tns:echoToFileResponse"/> |
<xs:element name="encodeFile" type="tns:encodeFile"/> |
<xs:element name="encodeFileResponse" type="tns:encodeFileResponse"/> |
<xs:element name="loadResource" type="tns:loadResource"/> |
<xs:element name="loadResourceFromArchive" type="tns:loadResourceFromArchive"/> |
<xs:element name="loadResourceFromArchiveResponse" type="tns:loadResourceFromArchiveResponse"/> |
71,16 → 69,6 |
<xs:element minOccurs="0" name="filename" type="xs:string"/> |
</xs:sequence> |
</xs:complexType> |
<xs:complexType name="encodeFile"> |
<xs:sequence> |
<xs:element minOccurs="0" name="file" type="tns:FileResourceType"/> |
</xs:sequence> |
</xs:complexType> |
<xs:complexType name="encodeFileResponse"> |
<xs:sequence> |
<xs:element minOccurs="0" name="return" type="xs:base64Binary"/> |
</xs:sequence> |
</xs:complexType> |
<xs:complexType name="replaceInFileRegEx"> |
<xs:sequence> |
<xs:element minOccurs="0" name="file" type="tns:FileResourceType"/> |
373,9 → 361,6 |
<wsdl:message name="basename"> |
<wsdl:part element="tns:basename" name="parameters"></wsdl:part> |
</wsdl:message> |
<wsdl:message name="encodeFile"> |
<wsdl:part element="tns:encodeFile" name="parameters"></wsdl:part> |
</wsdl:message> |
<wsdl:message name="uploadFile"> |
<wsdl:part element="tns:uploadFile" name="parameters"></wsdl:part> |
</wsdl:message> |
400,9 → 385,6 |
<wsdl:message name="replaceInFileRegExResponse"> |
<wsdl:part element="tns:replaceInFileRegExResponse" name="parameters"></wsdl:part> |
</wsdl:message> |
<wsdl:message name="encodeFileResponse"> |
<wsdl:part element="tns:encodeFileResponse" name="parameters"></wsdl:part> |
</wsdl:message> |
<wsdl:message name="replaceInFileResponse"> |
<wsdl:part element="tns:replaceInFileResponse" name="parameters"></wsdl:part> |
</wsdl:message> |
409,12 → 391,12 |
<wsdl:message name="copyFileResponse"> |
<wsdl:part element="tns:copyFileResponse" name="parameters"></wsdl:part> |
</wsdl:message> |
<wsdl:message name="echoToFile"> |
<wsdl:part element="tns:echoToFile" name="parameters"></wsdl:part> |
</wsdl:message> |
<wsdl:message name="basenameResponse"> |
<wsdl:part element="tns:basenameResponse" name="parameters"></wsdl:part> |
</wsdl:message> |
<wsdl:message name="echoToFile"> |
<wsdl:part element="tns:echoToFile" name="parameters"></wsdl:part> |
</wsdl:message> |
<wsdl:message name="copyFile"> |
<wsdl:part element="tns:copyFile" name="parameters"></wsdl:part> |
</wsdl:message> |
425,12 → 407,6 |
<wsdl:output message="tns:downloadFileResponse" name="downloadFileResponse"></wsdl:output> |
<wsdl:fault message="tns:XServicesFault" name="XServicesFault"></wsdl:fault> |
</wsdl:operation> |
<wsdl:operation name="encodeFile"> |
<wsdl:documentation>Encodes a file.</wsdl:documentation> |
<wsdl:input message="tns:encodeFile" name="encodeFile"></wsdl:input> |
<wsdl:output message="tns:encodeFileResponse" name="encodeFileResponse"></wsdl:output> |
<wsdl:fault message="tns:XServicesFault" name="XServicesFault"></wsdl:fault> |
</wsdl:operation> |
<wsdl:operation name="replaceInFileRegEx"> |
<wsdl:documentation>Replaces every <regex pattern> with a string in an ascii file</wsdl:documentation> |
<wsdl:input message="tns:replaceInFileRegEx" name="replaceInFileRegEx"></wsdl:input> |
517,18 → 493,6 |
<soap:fault name="XServicesFault" use="literal"/> |
</wsdl:fault> |
</wsdl:operation> |
<wsdl:operation name="encodeFile"> |
<soap:operation soapAction="" style="document"/> |
<wsdl:input name="encodeFile"> |
<soap:body use="literal"/> |
</wsdl:input> |
<wsdl:output name="encodeFileResponse"> |
<soap:body use="literal"/> |
</wsdl:output> |
<wsdl:fault name="XServicesFault"> |
<soap:fault name="XServicesFault" use="literal"/> |
</wsdl:fault> |
</wsdl:operation> |
<wsdl:operation name="changeMode"> |
<soap:operation soapAction="" style="document"/> |
<wsdl:input name="changeMode"> |
827,7 → 791,7 |
<ws:downloadFile> |
<file> |
<type>FILE</type> |
<uri>c:/temp/test.docx</uri> |
<uri>c:\temp\test.docx</uri> |
</file> |
</ws:downloadFile> |
</soapenv:Body> |
836,10 → 800,10 |
<soapenv:Body> |
<ws:echoToFile> |
<message>Here is some text with german umlauts (äöü).</message> |
<!-- File _must_ exist in advance --> |
<file>c:/temp/somefile.txt</file> |
<!--Optional:--> |
<encoding>utf-8</encoding> |
<append>hallo</append> |
<append>false</append> |
</ws:echoToFile> |
</soapenv:Body> |
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/FileService/echoToFile"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="" name="loadResource" bindingOperationName="loadResource" type="Request-Response" outputName="loadResourceResponse" inputName="loadResource" 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/FileService</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net"> |
923,15 → 887,4 |
</file> |
</ws:uploadFile> |
</soapenv:Body> |
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/FileService/uploadFile"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="" name="encodeFile" bindingOperationName="encodeFile" type="Request-Response" outputName="encodeFileResponse" inputName="encodeFile" 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"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/XServices/FileService</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:encodeFile> |
<!--Optional:--> |
<file> |
<type>FILE</type> |
<uri>c:\temp\test.docx</uri> |
</file> |
</ws:encodeFile> |
</soapenv:Body> |
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://ws.xservices.brutex.net/FileService/encodeFile"/><con:wsrmConfig version="1.2"/></con:call></con:operation></con:interface><con:properties/><con:wssContainer/><con:sensitiveInformation/></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/FileService/uploadFile"/><con:wsrmConfig version="1.2"/></con:call></con:operation></con:interface><con:properties/><con:wssContainer/><con:sensitiveInformation/></con:soapui-project> |
/xservices/trunk/test/FileServiceMTOM-soapui-project.xml |
---|
1,5 → 1,5 |
<?xml version="1.0" encoding="UTF-8"?> |
<con:soapui-project name="FileServiceMTOM" resourceRoot="" soapui-version="4.0.1" abortOnError="false" runType="SEQUENTIAL" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:WsdlInterface" wsaVersion="NONE" name="FileServiceSoapBinding" type="wsdl" bindingName="{http://ws.xservices.brutex.net}FileServiceSoapBinding" soapVersion="1_1" anonymous="optional" definition="http://localhost:8080/XServices/FileServiceMTOM?wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache type="TEXT" rootPart="http://localhost:8080/XServices/FileServiceMTOM?wsdl"><con:part><con:url>http://localhost:8080/XServices/FileServiceMTOM?wsdl</con:url><con:content><![CDATA[<wsdl:definitions name="FileService" targetNamespace="http://ws.xservices.brutex.net" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.xservices.brutex.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
<con:soapui-project name="FileServiceMTOM" resourceRoot="" soapui-version="3.6.1" abortOnError="false" runType="SEQUENTIAL" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:WsdlInterface" wsaVersion="NONE" name="FileServiceSoapBinding" type="wsdl" bindingName="{http://ws.xservices.brutex.net}FileServiceSoapBinding" soapVersion="1_1" anonymous="optional" definition="http://localhost:8080/XServices/FileServiceMTOM?wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache type="TEXT" rootPart="http://localhost:8080/XServices/FileServiceMTOM?wsdl"><con:part><con:url>http://localhost:8080/XServices/FileServiceMTOM?wsdl</con:url><con:content><![CDATA[<wsdl:definitions name="FileService" targetNamespace="http://ws.xservices.brutex.net" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.xservices.brutex.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
<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="antProperty" type="tns:antProperty"/> |
/xservices/trunk/doc/FileServices/downloadFile.xml |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:mime-type |
-text/plain |
\ No newline at end of property |
/xservices/trunk/doc/FileServices/encodeFile.xml |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:mime-type |
-text/plain |
\ No newline at end of property |
/xservices/trunk/doc/BruteXServices_User_Guide.dbk |
---|
3789,73 → 3789,7 |
<title>FileServices</title> |
<para>The FileServces bundles various file operations. Its WSDL is located at |
http://server:port/XServices/FileService?wsdl</para> |
<section version="5.0" xml:base="FileServices/downloadFile.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"> |
<title>downloadFile</title> |
<para>Downloads a file as base64 encoded. |
Sample request: |
<screen><![CDATA[ |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net"> |
<soapenv:Header/> |
<soapenv:Body> |
<!-- downloads a file from the XServices server as base64 encoded --> |
<ws:downloadFile> |
<file> |
<type>FILE</type> |
<uri>c:\temp\test.docx</uri> |
</file> |
</ws:downloadFile> |
</soapenv:Body> |
</soapenv:Envelope> |
]]></screen> |
Sample response: |
<programlisting language="xml"><![CDATA[ |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> |
<soap:Body> |
<ns2:downloadFileResponse xmlns:ns2="http://ws.xservices.brutex.net"> |
<return> |
<content>ADQBNA[... snipp ...]wAApzcAAAAA</content> |
<filename>test.docx</filename> |
</return> |
</ns2:downloadFileResponse> |
</soap:Body> |
</soap:Envelope>]]></programlisting> |
</para> |
<para>Encoding files as base64 is very memory consuming!</para> |
</section> |
<section version="5.0" xml:base="FileServices/encodeFile.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"> |
<title>encodeFile</title> |
<para>Encodes a file as base64. |
Sample request: |
<screen><![CDATA[ |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net"> |
<soapenv:Header/> |
<soapenv:Body> |
<ws:encodeFile> |
<file> |
<type>FILE</type> |
<uri>c:\temp\test.docx</uri> |
</file> |
</ws:encodeFile> |
</soapenv:Body> |
</soapenv:Envelope> |
]]></screen> |
Sample response: |
<programlisting language="xml"><![CDATA[ |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> |
<soap:Body> |
<ns2:encodeFileResponse xmlns:ns2="http://ws.xservices.brutex.net"> |
<return> |
<content>ADQBNA[... snipp ...]wAApzcAAAAA</content> |
<filename>test.docx</filename> |
</return> |
</ns2:encodeFileResponse> |
</soap:Body> |
</soap:Envelope>]]></programlisting> |
</para> |
<para>DEPRECATED: Encoding files as base64 is very memory consuming!</para> |
</section> |
</section> |
<section id="mailservices" version="5.0" xml:base="MailServices.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"> |
<title>MailServices</title> |
<para>The MailService contains mail send and receive operations. Its WSDL is located at |
3945,45 → 3879,6 |
</para> |
</section> |
</section> |
<section id="stringservices" version="5.0" xml:base="StringServices.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"> |
<title>StringServices</title> |
<para>The StringService bundles various operations. Its WSDL is located at |
http://server:port/XServices/StringService?wsdl</para> |
<section version="5.0" xml:base="StringServices/replaceRegEx.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"> |
<title>replaceRegEx</title> |
<para>Search and Replace using regular expression. |
Sample request: |
<screen><![CDATA[ |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" |
xmlns:ws="http://ws.xservices.brutex.net"> |
<soapenv:Header/> |
<soapenv:Body> |
<ws:replaceRegEx> |
<string>Hallo Welt</string> |
<search>W.*</search> |
<replace>Brian</replace> |
<regexflags>ig</regexflags> |
</ws:replaceRegEx> |
</soapenv:Body> |
</soapenv:Envelope> |
]]></screen> |
Sample response: |
<programlisting language="xml"><![CDATA[ |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> |
<soap:Body> |
<ns2:replaceRegExResponse xmlns:ns2="http://ws.xservices.brutex.net"> |
<return> |
<string>Hallo Brian</string> |
<count>1</count> |
</return> |
</ns2:replaceRegExResponse> |
</soap:Body> |
</soap:Envelope>]]></programlisting> |
</para> |
<para>Allowed regexflags are case-insensitive (i) and global search (g).</para> |
</section> |
</section> |
</chapter> |
<chapter id="xmltypes"> |
/xservices/trunk/doc/FileServices.xml |
---|
5,7 → 5,4 |
<title>FileServices</title> |
<para>The FileServces bundles various file operations. Its WSDL is located at |
http://server:port/XServices/FileService?wsdl</para> |
<xi:include href="FileServices/downloadFile.xml" /> |
<xi:include href="FileServices/encodeFile.xml" /> |
</section> |
/xservices/trunk/src/java/cache.ccf |
---|
File deleted |
\ No newline at end of file |
/xservices/trunk/src/java/net/brutex/xservices/types/FileInfoType.java |
---|
File deleted |
Property changes: |
Deleted: svn:mime-type |
-text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/types/FileInfoListType.java |
---|
File deleted |
Property changes: |
Deleted: svn:mime-type |
-text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/ws/rs/FileInfo.java |
---|
File deleted |
Property changes: |
Deleted: svn:mime-type |
-text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/ws/rs/FileInfoImpl.java |
---|
File deleted |
Property changes: |
Deleted: svn:mime-type |
-text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/ws/rs/FileListType.java |
---|
File deleted |
Property changes: |
Deleted: svn:mime-type |
-text/plain |
\ No newline at end of property |
/xservices/trunk/src/java/net/brutex/xservices/ws/impl/FileServiceImpl.java |
---|
15,7 → 15,6 |
*/ |
package net.brutex.xservices.ws.impl; |
import java.io.ByteArrayOutputStream; |
import java.io.File; |
import java.io.FileNotFoundException; |
import java.io.FileOutputStream; |
157,26 → 156,6 |
} |
} |
public byte[] encodeFile(FileResource res) throws XServicesFault { |
InputStream is = null; |
try { |
is = res.getAntResource(null).getInputStream(); |
ByteArrayOutputStream buffer = new ByteArrayOutputStream(); |
int nRead; |
byte[] data = new byte[4096]; |
while ((nRead = is.read(data, 0, data.length)) != -1) { |
buffer.write(data, 0, nRead); |
} |
buffer.flush(); |
return buffer.toByteArray(); |
} catch (IOException e) { |
throw new XServicesFault(e); |
} |
} |
/* |
* (non-Javadoc) |
* |
/xservices/trunk/src/java/net/brutex/xservices/ws/FileService.java |
---|
51,7 → 51,6 |
final String OPERATION_BASENAME ="basename"; |
final String OPERATION_DOWNLOADFILE ="downloadFile"; |
final String OPERATION_ENCODEFILE= "encodeFile"; |
final String OPERATION_UPLOADFILE ="uploadFile"; |
final String OPERATION_COPY ="copy"; |
final String OPERATION_COPYFILE ="copyFile"; |
91,16 → 90,6 |
@WebParam(name = FileResource.XML_NAME) FileResource res) throws XServicesFault; |
/** |
* @param res |
* @return Encodes a file |
* @throws XServicesFault |
*/ |
@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_ENCODEFILE) |
@WebMethod(operationName = OPERATION_ENCODEFILE) |
public abstract byte[] encodeFile( |
@WebParam(name = FileResource.XML_NAME) FileResource res) throws XServicesFault; |
/** |
* @param file |
* @return The file name of the file that has been uploaded. |
* @throws XServicesFault |
/xservices/trunk/src/java/net/brutex/xservices/util/XServicesDocumentation.java |
---|
48,8 → 48,6 |
"as inline base64 encoded block. Keep in mind that unless you are using MTOM, a lot of " + |
"java heap memory is used."; |
public static final String SERVICE_OPERATION_ENCODEFILE = "Encodes a file."; |
public static final String SERVICE_OPERATION_UPLOADFILE = "Send a file from client to web service server using either " + |
"MTOM attachment or base64 inline attachment."; |
/xservices/trunk/src/java/net/brutex/xservices/agent/AgentServlet.java |
---|
0,0 → 1,39 |
package net.brutex.xservices.agent; |
import java.io.IOException; |
import javax.servlet.GenericServlet; |
import javax.servlet.ServletConfig; |
import javax.servlet.ServletException; |
import javax.servlet.ServletRequest; |
import javax.servlet.ServletResponse; |
/** |
* Servlet implementation class AgentServlet |
*/ |
public class AgentServlet extends GenericServlet { |
private static final long serialVersionUID = 1L; |
/** |
* @see GenericServlet#GenericServlet() |
*/ |
public AgentServlet() { |
super(); |
// TODO Auto-generated constructor stub |
} |
/** |
* @see Servlet#init(ServletConfig) |
*/ |
public void init(ServletConfig config) throws ServletException { |
// TODO Auto-generated method stub |
} |
/** |
* @see Servlet#service(ServletRequest request, ServletResponse response) |
*/ |
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { |
// TODO Auto-generated method stub |
System.out.println("Yep. I am here."); |
} |
} |
Property changes: |
Added: svn:mime-type |
+text/plain |
\ No newline at end of property |
/xservices/trunk/web/WEB-INF/cxf-beans.xml |
---|
71,12 → 71,4 |
<entry key="attachment-memory-threshold" value="2000" /> |
</jaxws:properties> |
</jaxws:endpoint> |
<jaxrs:server id="FileInfo" address="/fileinfo"> |
<jaxrs:serviceBeans> |
<ref bean="FileInfoBean" /> |
</jaxrs:serviceBeans> |
</jaxrs:server> |
<bean id="FileInfoBean" class="net.brutex.xservices.ws.rs.FileInfoImpl" /> |
</beans> |
/xservices/trunk/web/WEB-INF/web.xml |
---|
52,4 → 52,19 |
<welcome-file-list> |
<welcome-file>index.html</welcome-file> |
</welcome-file-list> |
<servlet> |
<description></description> |
<display-name>AgentServlet</display-name> |
<servlet-name>AgentServlet</servlet-name> |
<servlet-class>net.brutex.xservices.agent.AgentServlet</servlet-class> |
<init-param> |
<description>Port to listen on</description> |
<param-name>port</param-name> |
<param-value>1313</param-value> |
</init-param> |
</servlet> |
<servlet-mapping> |
<servlet-name>AgentServlet</servlet-name> |
<url-pattern>/AgentServlet</url-pattern> |
</servlet-mapping> |
</web-app> |