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 ch...@apache.org on 2007/05/21 02:06:05 UTC
svn commit: r539982 - in
/webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing:
Client.java PublisherService.java
Author: chamikara
Date: Sun May 20 17:06:03 2007
New Revision: 539982
URL: http://svn.apache.org/viewvc?view=rev&rev=539982
Log:
Updates to the eventing sample
Modified:
webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/Client.java
webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/PublisherService.java
Modified: webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/Client.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/Client.java?view=diff&rev=539982&r1=539981&r2=539982
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/Client.java (original)
+++ webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/Client.java Sun May 20 17:06:03 2007
@@ -200,7 +200,7 @@
// throw new AxisFault ("Please specify the client repository as a program argument.Use '-h' for help.");
}
- ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO,AXIS2_XML);
+ ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO,null);
serviceClient = new ServiceClient (configContext,null); //TODO give a repo
options = new Options ();
Modified: webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/PublisherService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/PublisherService.java?view=diff&rev=539982&r1=539981&r2=539982
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/PublisherService.java (original)
+++ webservices/axis2/trunk/java/modules/samples/eventing/src/sample/eventing/PublisherService.java Sun May 20 17:06:03 2007
@@ -16,13 +16,13 @@
package sample.eventing;
+import java.net.URI;
import java.util.Random;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ServiceContext;
import org.apache.savan.publication.client.PublicationClient;
@@ -64,31 +64,30 @@
if (store==null)
throw new Exception ("Cant find the Savan subscriber store");
- SOAPEnvelope envelope = getNextPublicationEnvelope ();
- PublicationClient.sendPublication(envelope,serviceContext.getConfigurationContext(),store);
+ OMElement data = getNextPublicationData ();
+
+ PublicationClient publicationClient = new PublicationClient (serviceContext.getConfigurationContext());
+ publicationClient.sendPublication(data,serviceContext.getAxisService(),null);
}
-
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
- public SOAPEnvelope getNextPublicationEnvelope () {
- SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+ public OMElement getNextPublicationData () {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace namespace = factory.createOMNamespace(publicationNamespaceValue,"ns1");
OMElement publicationElement = factory.createOMElement(Publication,namespace);
int value = r.nextInt();
publicationElement.setText(Integer.toString(value));
- OMElement publishMethod = factory.createOMElement("publish",namespace);
- publishMethod.addChild(publicationElement);
+ OMElement data = factory.createOMElement("publish",namespace);
+ data.addChild(publicationElement);
- SOAPEnvelope envelope = factory.getDefaultEnvelope();
- envelope.getBody().addChild(publishMethod);
- return envelope;
+ return data;
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org