You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by th...@apache.org on 2006/11/09 10:37:21 UTC

svn commit: r472829 - in /webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments: README.txt build.xml src/sample/soapwithattachments/client/SWAClient.java

Author: thilina
Date: Thu Nov  9 01:37:20 2006
New Revision: 472829

URL: http://svn.apache.org/viewvc?view=rev&rev=472829
Log:
Readme for the SwA sample


Modified:
    webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/README.txt
    webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml
    webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java

Modified: webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/README.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/README.txt?view=diff&rev=472829&r1=472828&r2=472829
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/README.txt (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/README.txt Thu Nov  9 01:37:20 2006
@@ -1,23 +1,53 @@
 Sample for SOAP with Attachments
 ================================
 
-Overview:
----------
+Introduction
+============
+This sample demonstrates the capabilities and power of SOAP with Attachment support and the
+Attachment API of AXIS2. More information about Axis2 attachment implementation can be found at 
+http://ws.apache.org/axis2/1_1/mtom-guide.html. 
+
+This sample includes a service and a client which can be used to upload a file to the server using 
+SOAP message containing a SOAP with Attachment type binary attachment. The service is written and 
+deployed using the RCPMessageReceiver and a POJO(Plain Old Java Object). The POJO service class uses 
+the Attachment API of the MessageContext to retrieve the received attachment.The client program is 
+written using the OperationClient API of Axis2 together with the Attachment API of MessageContext.
+
+
+Objectives
+==========
+
+    * Writing a POJO (Plain Old Java Object) based service to access attachments.
+    * Implement a Axis2 OperationClient based Web Service client to invoke the service with SOAP 
+    with Attachment type attachments.
+    * Invoke the deployed service.
 
-This sample demonstrates the capabilities and power of Soap with Attachment support and the
-Attachment API of AXIS2. In this sample the user can upload a file to the service. The service is
-written and deployed as a simple POJO and it uses the Attachment API to retrieve the received
-attachment. Client is written using Operation Client API of Axis2.
 
 Running the Sample:
--------------------
-1. Use ant generate.service or ant command in the AXIS2_DIST/sample/mtom/ to build the service.
-2. Generated service gets copied to the AXIS2_DIST/repository/services automatically.
-Run the AXIS2_DIST/bin/axis2server.{sh.bat} to start the standalone axis2 server. (Alternatively you
- can drop the sample to the services directory of a Axis2 server
-running in a servlet container)
-4. Use ant run.client -Dfile "file to be send" -Ddest "destination file name" > to
-build and run the client.
+===================
+The files belonging to this sample are contained in the samples/soapwithattachments folder of the 
+extracted Axis2 binary distribution, which will be called here after as SWA_SAMPLE_DIR. The 
+location of the extracted binary distribution will be refered as AXIS2_DIST. There is a 
+"build.xml" Ant script in the SWA_SAMPLE_DIR that contains build targets for building the service 
+archive and running the client application - all described in steps below. 
+
+1. Generate the service
+Use "ant generate.service" command in the SWA_SAMPLE_DIR to build the service. Generated service 
+will automatically gets copied in to the AXIS2_DIST/repository/services directory. Source file 
+ralating to this service can be found at 
+SWA_SAMPLE_DIR/src/sample/soapwithattachments/service/AttachmentService.java. The services.xml used
+when building this service can be found at SWA_SAMPLE_DIR/resources directory. 
+
+2. Deploy the service
+Run the AXIS2_DIST/bin/axis2server.{sh.bat} script to start the standalone axis2 server. This server 
+will deploy all the srvices available at AXIS2_DIST/repository/services directoryt. Alternatively you
+can drop the sample-swa.aar service archive to the services directory of a running Axis2 servlet)
+
+3. Running the client
+Use "ant run.client -Dfile <file to be send> -Ddest <destination file name>" command in the 
+SWA_SAMPLE_DIR to build and run the client. Source file ralating to the client can be found at 
+SWA_SAMPLE_DIR/src/sample/soapwithattachments/client/SWAClient.java.
+
 
 Please contact axis-user list (axis-user@ws.apache.org) if you have any trouble running the sample.
 

Modified: webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml?view=diff&rev=472829&r1=472828&r2=472829
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml Thu Nov  9 01:37:20 2006
@@ -26,7 +26,7 @@
 	<target name="compile">
 		<mkdir dir="${client.classes.dir}" />
 		<!-- Compile client -->
-		<javac srcdir="src" destdir="${client.classes.dir}">
+		<javac debug="on"  srcdir="src" destdir="${client.classes.dir}">
 			<classpath refid="axis.classpath" />
 		</javac>
 	</target>

Modified: webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java?view=diff&rev=472829&r1=472828&r2=472829
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java Thu Nov  9 01:37:20 2006
@@ -120,9 +120,9 @@
 		OMNamespace omNs = fac.createOMNamespace(
 				"http://service.soapwithattachments.sample/xsd", "swa");
 		OMElement uploadFile = fac.createOMElement("uploadFile", omNs);
-		OMElement nameEle = fac.createOMElement("param0", omNs);
+		OMElement nameEle = fac.createOMElement("name", omNs);
 		nameEle.setText(destinationFile);
-		OMElement idEle = fac.createOMElement("param1", omNs);
+		OMElement idEle = fac.createOMElement("attchmentID", omNs);
 		idEle.setText(attachmentID);
 		uploadFile.addChild(nameEle);
 		uploadFile.addChild(idEle);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org