You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ch...@apache.org on 2006/10/05 09:56:38 UTC

svn commit: r453129 [2/2] - in /webservices/sandesha/trunk/java/interop: conf/ src/org/apache/sandesha2/interop/ src/org/apache/sandesha2/interop/rm1_1_clients/ src/org/tempuri/

Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_2_2.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_2_2.java?view=diff&rev=453129&r1=453128&r2=453129
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_2_2.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_2_2.java Thu Oct  5 00:56:36 2006
@@ -28,6 +28,7 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.soap.SOAPBody;
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Options;
@@ -40,6 +41,12 @@
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.client.SandeshaClient;
 import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+import org.apache.sandesha2.interop.RMInteropServiceCallbackHandlerImpl;
+import org.apache.sandesha2.interop.RMInteropServiceStub;
+import org.apache.sandesha2.util.SandeshaUtil;
+import org.tempuri.EchoString;
+import org.tempuri.EchoStringRequestBodyType;
 
 public class Scenario_2_2 {
 	
@@ -55,8 +62,8 @@
 	private static String transportToIP = "127.0.0.1";
 	private static String transportToPort = "8070";
 	private static String servicePart = "/axis2/services/RMInteropService";
-	private static String toEPR = "http://" + toIP +  ":" + toPort + servicePart;
-	private static String transportToEPR = "http://" + transportToIP +  ":" + transportToPort + servicePart;
+	private static String toAddress = "http://" + toIP +  ":" + toPort + servicePart;
+	private static String transportToAddress = "http://" + transportToIP +  ":" + transportToPort + servicePart;
 	
 	private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
 	
@@ -79,11 +86,12 @@
 		Properties properties = new Properties();
 		if (in != null) {
 			properties.load(in);
-			toEPR = properties.getProperty("to");
-			transportToEPR = properties.getProperty("transportTo");
+			toAddress = properties.getProperty("to");
+			transportToAddress = properties.getProperty("transportTo");
 		}
 		
-		new Scenario_2_2 ().run();
+//		new Scenario_2_2 ().run();
+		new Scenario_2_2 ().runStubBased ();
 	}
 	
 	private void run () throws Exception {
@@ -102,7 +110,7 @@
 		Options clientOptions = new Options ();
 		
 //		clientOptions.setProperty(Options.COPY_PROPERTIES,new Boolean (true));
-		clientOptions.setTo(new EndpointReference (toEPR));
+		clientOptions.setTo(new EndpointReference (toAddress));
 		
 		String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
 		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
@@ -110,7 +118,7 @@
 		String sequenceKey = "sequence4";
 		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
 		
-		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToAddress);
 		
 //		clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
 		
@@ -197,6 +205,110 @@
 			System.out.println("Error reported for test call back");
 			e.printStackTrace();
 		}
+	}
+	
+	
+	private ConfigurationContext getConfigurationContext () throws AxisFault {
+
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return null;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+		return configContext;
+	}
+	
+	private void setUpOptions (Options clientOptions, String sequenceKey, String acksTo) {
+
+		EndpointReference toEPR = new EndpointReference (toAddress);
+		clientOptions.setTo(toEPR);
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToAddress);
+		clientOptions.setAction("urn:wsrm:EchoString");
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+
+//		clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
+//		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
+//		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+		
+		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		
+		//You must set the following two properties in the request-reply case.
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+		clientOptions.setUseSeparateListener(true);
+				
+	}
+	
+	
+	private void runStubBased () throws Exception {
+		ConfigurationContext configurationContext = getConfigurationContext();
+		
+		RMInteropServiceStub stub = new RMInteropServiceStub (configurationContext, toAddress);
+		ServiceClient stubServiceClient = stub._getServiceClient();
+		
+		String sequenceKey = "sequence4";
+		String acksTo = stubServiceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+		
+		Options options = stubServiceClient.getOptions();
+		setUpOptions(options, sequenceKey, acksTo);
+		
+		EchoString echoString = new EchoString ();
+		echoString.setEchoString (new EchoStringRequestBodyType ());
+		echoString.getEchoString().setSequence(sequenceKey);
+		echoString.getEchoString().setText("echo1");
+		
+		RMInteropServiceCallbackHandlerImpl callback1 = new RMInteropServiceCallbackHandlerImpl ("callback1");
+		stub.startEchoString(echoString, callback1);
+		
+		echoString = new EchoString ();
+		echoString.setEchoString (new EchoStringRequestBodyType ());
+		echoString.getEchoString().setSequence(sequenceKey);
+		echoString.getEchoString().setText("echo2");
+		
+		RMInteropServiceCallbackHandlerImpl callback2 = new RMInteropServiceCallbackHandlerImpl ("callback2");
+		stub.startEchoString(echoString, callback2);
+		
+		echoString = new EchoString ();
+		echoString.setEchoString (new EchoStringRequestBodyType ());
+		echoString.getEchoString().setSequence(sequenceKey);
+		echoString.getEchoString().setText("echo3");
+		
+		RMInteropServiceCallbackHandlerImpl callback3 = new RMInteropServiceCallbackHandlerImpl ("callback3");
+		stub.startEchoString(echoString, callback3);
+		
+		while (!callback3.isCompleted()) {
+			Thread.sleep(2000);
+		}
+		
+		terminateSequence (stubServiceClient);
+		
+	}
+	
+	private void terminateSequence (ServiceClient serviceClient) throws Exception {
+		
+    	SequenceReport sequenceReport = null;		
+		boolean complete = false;
+		while (!complete) {
+			sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3) 
+				complete = true;
+			else {
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+	    		}
+			}
+		} 	
+       
+		Thread.sleep(6000);
+		
+        SandeshaClient.terminateSequence(serviceClient);
+//        serviceClient.finalizeInvoke();
+        		
 	}
 
 	

Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_2_3.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_2_3.java?view=diff&rev=453129&r1=453128&r2=453129
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_2_3.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_2_3.java Thu Oct  5 00:56:36 2006
@@ -28,6 +28,7 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.soap.SOAPBody;
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Options;
@@ -40,7 +41,12 @@
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.client.SandeshaClient;
 import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+import org.apache.sandesha2.interop.RMInteropServiceCallbackHandlerImpl;
+import org.apache.sandesha2.interop.RMInteropServiceStub;
 import org.apache.sandesha2.util.SandeshaUtil;
+import org.tempuri.EchoString;
+import org.tempuri.EchoStringRequestBodyType;
 
 public class Scenario_2_3 {
 	
@@ -84,7 +90,8 @@
 			transportToEPR = properties.getProperty("transportTo");
 		}
 		
-		new Scenario_2_3 ().run();
+//		new Scenario_2_3 ().run();
+		new Scenario_2_3 ().runStubBased();
 	}
 	
 	private void run () throws Exception {
@@ -103,16 +110,7 @@
 		Options clientOptions = new Options ();
 		
 		EndpointReference toEPR = new EndpointReference (toAddress);
-		
-		OMFactory factory = OMAbstractFactory.getOMFactory();
-		OMNamespace namespace = factory.createOMNamespace("urn:wsrm:InteropOptions","rmi");
-		OMElement acceptOfferElem = factory.createOMElement("acceptOffer",namespace);
-		OMElement useOfferElem = factory.createOMElement("useOffer",namespace);
-		acceptOfferElem.setText("false");
-		useOfferElem.setText("false");
-		
-		toEPR.addReferenceParameter(acceptOfferElem);
-		toEPR.addReferenceParameter(useOfferElem);
+		populateToEPRToRejectOffers(toEPR);
 		
 //		clientOptions.setManageSession(true); // without this reference params wont go.
 		serviceClient.setTargetEPR(toEPR);
@@ -213,6 +211,126 @@
 			System.out.println("Error reported for test call back");
 			e.printStackTrace();
 		}
+	}
+	
+	private ConfigurationContext getConfigurationContext () throws AxisFault {
+
+		if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){
+			System.out.println("ERROR: Please set the directory you unzipped Sandesha2 as the first option.");
+			return null;
+		}
+
+		String axis2_xml = AXIS2_CLIENT_PATH + "client_axis2.xml";
+     
+		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
+		return configContext;
+	}
+	
+	private void setUpOptions (Options clientOptions, String sequenceKey, String acksTo) {
+
+		EndpointReference toEPR = new EndpointReference (toAddress);
+		clientOptions.setTo(toEPR);
+		clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
+		clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
+		clientOptions.setAction("urn:wsrm:EchoString");
+		clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
+
+//		clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
+//		clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
+//		clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
+		
+		clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);  //uncomment this to send the messages according to the v1_1 spec.
+		clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());  //Uncomment this to offer a sequenceID for the incoming sequence.
+		
+		//You must set the following two properties in the request-reply case.
+		clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+		clientOptions.setUseSeparateListener(true);
+				
+	}
+	
+	
+	private void runStubBased () throws Exception {
+		ConfigurationContext configurationContext = getConfigurationContext();
+		
+		RMInteropServiceStub stub = new RMInteropServiceStub (configurationContext, toAddress);
+		ServiceClient stubServiceClient = stub._getServiceClient();
+		
+		String sequenceKey = "sequence4";
+		String acksTo = stubServiceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+		
+		Options options = stubServiceClient.getOptions();
+		setUpOptions(options, sequenceKey, acksTo);
+		populateToEPRToRejectOffers(stub._getServiceClient().getOptions().getTo());
+		
+		EchoString echoString = new EchoString ();
+		echoString.setEchoString (new EchoStringRequestBodyType ());
+		echoString.getEchoString().setSequence(sequenceKey);
+		echoString.getEchoString().setText("echo1");
+		
+		RMInteropServiceCallbackHandlerImpl callback1 = new RMInteropServiceCallbackHandlerImpl ("callback1");
+		stub.startEchoString(echoString, callback1);
+		
+		echoString = new EchoString ();
+		echoString.setEchoString (new EchoStringRequestBodyType ());
+		echoString.getEchoString().setSequence(sequenceKey);
+		echoString.getEchoString().setText("echo2");
+		
+		RMInteropServiceCallbackHandlerImpl callback2 = new RMInteropServiceCallbackHandlerImpl ("callback2");
+		stub.startEchoString(echoString, callback2);
+		
+		echoString = new EchoString ();
+		echoString.setEchoString (new EchoStringRequestBodyType ());
+		echoString.getEchoString().setSequence(sequenceKey);
+		echoString.getEchoString().setText("echo3");
+		
+		RMInteropServiceCallbackHandlerImpl callback3 = new RMInteropServiceCallbackHandlerImpl ("callback3");
+		stub.startEchoString(echoString, callback3);
+		
+		while (!callback3.isCompleted()) {
+			Thread.sleep(2000);
+		}
+		
+		terminateSequence (stubServiceClient);
+		
+	}
+	
+	private void terminateSequence (ServiceClient serviceClient) throws Exception {
+		
+    	SequenceReport sequenceReport = null;		
+		boolean complete = false;
+		while (!complete) {
+			sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
+			if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3) 
+				complete = true;
+			else {
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+	    		}
+			}
+		} 	
+       
+		Thread.sleep(6000);
+		
+        SandeshaClient.terminateSequence(serviceClient);
+//        serviceClient.finalizeInvoke();
+        		
+	}
+	
+	
+	private void populateToEPRToRejectOffers (EndpointReference toEPR) {
+		
+		OMFactory factory = OMAbstractFactory.getOMFactory();
+		OMNamespace namespace = factory.createOMNamespace("urn:wsrm:InteropOptions","rmi");
+		OMElement acceptOfferElem = factory.createOMElement("acceptOffer",namespace);
+		OMElement useOfferElem = factory.createOMElement("useOffer",namespace);
+		acceptOfferElem.setText("false");
+		useOfferElem.setText("false");
+		
+		toEPR.addReferenceParameter(acceptOfferElem);
+		toEPR.addReferenceParameter(useOfferElem);
+		
 	}
 
 	

Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_1.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_1.java?view=diff&rev=453129&r1=453128&r2=453129
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_1.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_1.java Thu Oct  5 00:56:36 2006
@@ -37,7 +37,7 @@
 import org.apache.sandesha2.client.SandeshaClientConstants;
 import org.apache.sandesha2.client.SequenceReport;
 import org.apache.sandesha2.interop.RMInteropServiceStub;
-import org.tempuri.PingRequest;
+import org.tempuri.Ping;
 
 import javax.xml.namespace.QName;
 
@@ -134,17 +134,17 @@
         //engage Rampart
         stub._getServiceClient().engageModule(new QName("rampart"));
         
-        PingRequest pingRequest = new PingRequest ();
-        pingRequest.setText("ping1");
-        stub.ping(pingRequest);
-        
-        pingRequest = new PingRequest ();
-        pingRequest.setText("ping2");
-        stub.ping(pingRequest);
-        
-        pingRequest = new PingRequest ();
-        pingRequest.setText("ping3");
-        stub.ping(pingRequest);
+		Ping ping = new Ping ();
+		ping.setText("ping1");
+		stub.Ping (ping);
+		
+		ping = new Ping ();
+		ping.setText("ping2");
+		stub.Ping (ping);
+		
+		ping = new Ping ();
+		ping.setText("ping3");
+		stub.Ping (ping);
         
         terminateSequence(stub._getServiceClient());
         stub._getServiceClient().finalizeInvoke();

Added: webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoString.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoString.java?view=auto&rev=453129
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoString.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoString.java Thu Oct  5 00:56:36 2006
@@ -0,0 +1,283 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.tempuri;
+
+/**
+ * EchoString bean class
+ */
+
+public class EchoString implements org.apache.axis2.databinding.ADBBean {
+
+	public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName(
+			"http://tempuri.org/", "echoString", "ns1");
+
+	/**
+	 * field for EchoString
+	 */
+
+	protected org.tempuri.EchoStringRequestBodyType localEchoString;
+
+	/**
+	 * Auto generated getter method
+	 * 
+	 * @return org.tempuri.EchoStringRequestBodyType
+	 */
+	public org.tempuri.EchoStringRequestBodyType getEchoString() {
+		return localEchoString;
+	}
+
+	/**
+	 * Auto generated setter method
+	 * 
+	 * @param param
+	 *            EchoString
+	 */
+	public void setEchoString(org.tempuri.EchoStringRequestBodyType param) {
+
+		this.localEchoString = param;
+
+	}
+
+	/**
+	 * 
+	 * @param parentQName
+	 * @param factory
+	 * @return org.apache.axiom.om.OMElement
+	 */
+	public org.apache.axiom.om.OMElement getOMElement(
+			final javax.xml.namespace.QName parentQName,
+			final org.apache.axiom.om.OMFactory factory) {
+
+		org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(
+				this, parentQName) {
+
+			public void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
+					throws javax.xml.stream.XMLStreamException {
+
+				// We can safely assume an element has only one type associated
+				// with it
+
+				if (localEchoString == null) {
+					java.lang.String namespace = "http://tempuri.org/";
+
+					if (!namespace.equals("")) {
+						java.lang.String prefix = xmlWriter
+								.getPrefix(namespace);
+
+						if (prefix == null) {
+							prefix = org.apache.axis2.databinding.utils.BeanUtil
+									.getUniquePrefix();
+
+							xmlWriter.writeStartElement(prefix, "echoString",
+									namespace);
+							xmlWriter.writeNamespace(prefix, namespace);
+							xmlWriter.setPrefix(prefix, namespace);
+
+						} else {
+							xmlWriter
+									.writeStartElement(namespace, "echoString");
+						}
+
+					} else {
+						xmlWriter.writeStartElement("echoString");
+					}
+
+					// write the nil attribute
+					writeAttribute("xsi",
+							"http://www.w3.org/2001/XMLSchema-instance", "nil",
+							"true", xmlWriter);
+					xmlWriter.writeEndElement();
+				} else {
+					localEchoString.getOMElement(MY_QNAME, factory).serialize(
+							xmlWriter);
+				}
+
+			}
+
+			/**
+			 * Util method to write an attribute with the ns prefix
+			 */
+			private void writeAttribute(java.lang.String prefix,
+					java.lang.String namespace, java.lang.String attName,
+					java.lang.String attValue,
+					javax.xml.stream.XMLStreamWriter xmlWriter)
+					throws javax.xml.stream.XMLStreamException {
+				if (xmlWriter.getPrefix(namespace) == null) {
+					xmlWriter.writeNamespace(prefix, namespace);
+					xmlWriter.setPrefix(prefix, namespace);
+
+				}
+
+				xmlWriter.writeAttribute(namespace, attName, attValue);
+
+			}
+
+			/**
+			 * Util method to write an attribute without the ns prefix
+			 */
+			private void writeAttribute(java.lang.String namespace,
+					java.lang.String attName, java.lang.String attValue,
+					javax.xml.stream.XMLStreamWriter xmlWriter)
+					throws javax.xml.stream.XMLStreamException {
+				if (namespace.equals("")) {
+					xmlWriter.writeAttribute(attName, attValue);
+				} else {
+					registerPrefix(xmlWriter, namespace);
+					xmlWriter.writeAttribute(namespace, attName, attValue);
+				}
+			}
+
+			/**
+			 * Register a namespace prefix
+			 */
+			private java.lang.String registerPrefix(
+					javax.xml.stream.XMLStreamWriter xmlWriter,
+					java.lang.String namespace)
+					throws javax.xml.stream.XMLStreamException {
+				java.lang.String prefix = xmlWriter.getPrefix(namespace);
+
+				if (prefix == null) {
+					prefix = createPrefix();
+
+					while (xmlWriter.getNamespaceContext().getNamespaceURI(
+							prefix) != null) {
+						prefix = createPrefix();
+					}
+
+					xmlWriter.writeNamespace(prefix, namespace);
+					xmlWriter.setPrefix(prefix, namespace);
+				}
+
+				return prefix;
+			}
+
+			/**
+			 * Create a prefix
+			 */
+			private java.lang.String createPrefix() {
+				return "ns" + (int) Math.random();
+			}
+		};
+
+		// ignore the QName passed in - we send only OUR QName!
+		return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME,
+				factory, dataSource);
+
+	}
+
+	/**
+	 * databinding method to get an XML representation of this object
+	 * 
+	 */
+	public javax.xml.stream.XMLStreamReader getPullParser(
+			javax.xml.namespace.QName qName) {
+
+		// We can safely assume an element has only one type associated with it
+
+		if (localEchoString == null) {
+			return new org.apache.axis2.databinding.utils.reader.NullXMLStreamReader(
+					MY_QNAME);
+		} else {
+			return localEchoString.getPullParser(MY_QNAME);
+		}
+
+	}
+
+	/**
+	 * Factory class that keeps the parse method
+	 */
+	public static class Factory {
+
+		/**
+		 * static method to create the object Precondition: If this object is an
+		 * element, the current or next start element starts this object and any
+		 * intervening reader events are ignorable If this object is not an
+		 * element, it is a complex type and the reader is at the event just
+		 * after the outer start element Postcondition: If this object is an
+		 * element, the reader is positioned at its end element If this object
+		 * is a complex type, the reader is positioned at the end element of its
+		 * outer element
+		 */
+		public static EchoString parse(javax.xml.stream.XMLStreamReader reader)
+				throws java.lang.Exception {
+			EchoString object = new EchoString();
+			int event;
+			try {
+
+				while (!reader.isStartElement() && !reader.isEndElement())
+					reader.next();
+
+				if ("true".equals(reader.getAttributeValue(
+						"http://www.w3.org/2001/XMLSchema-instance", "nil"))) {
+					// Skip the element and report the null value. It cannot
+					// have subelements.
+					while (!reader.isEndElement())
+						reader.next();
+					return null;
+				}
+
+				// Note all attributes that were handled. Used to differ normal
+				// attributes
+				// from anyAttributes.
+				java.util.Vector handledAttributes = new java.util.Vector();
+
+				boolean isReaderMTOMAware = false;
+
+				try {
+					isReaderMTOMAware = java.lang.Boolean.TRUE
+							.equals(reader
+									.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
+				} catch (java.lang.IllegalArgumentException e) {
+					isReaderMTOMAware = false;
+				}
+
+				while (!reader.isEndElement()) {
+					if (reader.isStartElement()) {
+
+						if (reader.isStartElement()
+								&& new javax.xml.namespace.QName(
+										"http://tempuri.org/", "echoString")
+										.equals(reader.getName())) {
+
+							object
+									.setEchoString(org.tempuri.EchoStringRequestBodyType.Factory
+											.parse(reader));
+
+						} // End of if for expected property start element
+
+						else {
+							// A start element we are not expecting indicates an
+							// invalid parameter was passed
+							throw new java.lang.RuntimeException(
+									"Unexpected subelement "
+											+ reader.getLocalName());
+						}
+
+					} else
+						reader.next();
+				} // end of while loop
+
+			} catch (javax.xml.stream.XMLStreamException e) {
+				throw new java.lang.Exception(e);
+			}
+
+			return object;
+		}
+
+	}// end of factory class
+
+}

Modified: webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringRequestBodyType.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringRequestBodyType.java?view=diff&rev=453129&r1=453128&r2=453129
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringRequestBodyType.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringRequestBodyType.java Thu Oct  5 00:56:36 2006
@@ -143,7 +143,7 @@
 				}
 
 				if (localTextTracker) {
-					namespace = "";
+					namespace = "http://tempuri.org/";
 
 					if (!namespace.equals("")) {
 						prefix = xmlWriter.getPrefix(namespace);
@@ -181,7 +181,7 @@
 					xmlWriter.writeEndElement();
 				}
 				if (localSequenceTracker) {
-					namespace = "";
+					namespace = "http://tempuri.org/";
 
 					if (!namespace.equals("")) {
 						prefix = xmlWriter.getPrefix(namespace);
@@ -248,10 +248,12 @@
 					java.lang.String attName, java.lang.String attValue,
 					javax.xml.stream.XMLStreamWriter xmlWriter)
 					throws javax.xml.stream.XMLStreamException {
-
-				registerPrefix(xmlWriter, namespace);
-
-				xmlWriter.writeAttribute(namespace, attName, attValue);
+				if (namespace.equals("")) {
+					xmlWriter.writeAttribute(attName, attValue);
+				} else {
+					registerPrefix(xmlWriter, namespace);
+					xmlWriter.writeAttribute(namespace, attName, attValue);
+				}
 			}
 
 			/**
@@ -302,14 +304,16 @@
 		java.util.ArrayList attribList = new java.util.ArrayList();
 
 		if (localTextTracker) {
-			elementList.add(new javax.xml.namespace.QName("", "Text"));
+			elementList.add(new javax.xml.namespace.QName(
+					"http://tempuri.org/", "Text"));
 
 			elementList.add(localText == null ? null
 					: org.apache.axis2.databinding.utils.ConverterUtil
 							.convertToString(localText));
 		}
 		if (localSequenceTracker) {
-			elementList.add(new javax.xml.namespace.QName("", "Sequence"));
+			elementList.add(new javax.xml.namespace.QName(
+					"http://tempuri.org/", "Sequence"));
 
 			elementList.add(localSequence == null ? null
 					: org.apache.axis2.databinding.utils.ConverterUtil
@@ -393,8 +397,8 @@
 					reader.next();
 
 				if (reader.isStartElement()
-						&& new javax.xml.namespace.QName("", "Text")
-								.equals(reader.getName())) {
+						&& new javax.xml.namespace.QName("http://tempuri.org/",
+								"Text").equals(reader.getName())) {
 
 					if (!"true"
 							.equals(reader
@@ -421,8 +425,8 @@
 					reader.next();
 
 				if (reader.isStartElement()
-						&& new javax.xml.namespace.QName("", "Sequence")
-								.equals(reader.getName())) {
+						&& new javax.xml.namespace.QName("http://tempuri.org/",
+								"Sequence").equals(reader.getName())) {
 
 					if (!"true"
 							.equals(reader

Modified: webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponse.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponse.java?view=diff&rev=453129&r1=453128&r2=453129
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponse.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponse.java Thu Oct  5 00:56:36 2006
@@ -23,7 +23,7 @@
 public class EchoStringResponse implements org.apache.axis2.databinding.ADBBean {
 
 	public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName(
-			"http://tempuri.org/", "EchoStringResponse", "ns1");
+			"http://tempuri.org/", "echoStringResponse", "ns1");
 
 	/**
 	 * field for EchoStringResponse
@@ -31,13 +31,6 @@
 
 	protected org.tempuri.EchoStringResponseBodyType localEchoStringResponse;
 
-	/*
-	 * This tracker boolean wil be used to detect whether the user called the
-	 * set method for this attribute. It will be used to determine whether to
-	 * include this field in the serialized XML
-	 */
-	protected boolean localEchoStringResponseTracker = false;
-
 	/**
 	 * Auto generated getter method
 	 * 
@@ -56,9 +49,6 @@
 	public void setEchoStringResponse(
 			org.tempuri.EchoStringResponseBodyType param) {
 
-		// update the setting tracker
-		localEchoStringResponseTracker = true;
-
 		this.localEchoStringResponse = param;
 
 	}
@@ -79,71 +69,43 @@
 			public void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
 					throws javax.xml.stream.XMLStreamException {
 
-				java.lang.String prefix = parentQName.getPrefix();
-				java.lang.String namespace = parentQName.getNamespaceURI();
+				// We can safely assume an element has only one type associated
+				// with it
+
+				if (localEchoStringResponse == null) {
+					java.lang.String namespace = "http://tempuri.org/";
+
+					if (!namespace.equals("")) {
+						java.lang.String prefix = xmlWriter
+								.getPrefix(namespace);
 
-				if (namespace != null) {
-					java.lang.String writerPrefix = xmlWriter
-							.getPrefix(namespace);
-					if (writerPrefix != null) {
-						xmlWriter.writeStartElement(namespace, parentQName
-								.getLocalPart());
-					} else {
 						if (prefix == null) {
 							prefix = org.apache.axis2.databinding.utils.BeanUtil
 									.getUniquePrefix();
-						}
-
-						xmlWriter.writeStartElement(prefix, parentQName
-								.getLocalPart(), namespace);
-						xmlWriter.writeNamespace(prefix, namespace);
-						xmlWriter.setPrefix(prefix, namespace);
-					}
-				} else {
-					xmlWriter.writeStartElement(parentQName.getLocalPart());
-				}
-
-				if (localEchoStringResponseTracker) {
-					if (localEchoStringResponse == null) {
 
-						java.lang.String namespace2 = "";
-
-						if (!namespace2.equals("")) {
-							java.lang.String prefix2 = xmlWriter
-									.getPrefix(namespace2);
-
-							if (prefix2 == null) {
-								prefix2 = org.apache.axis2.databinding.utils.BeanUtil
-										.getUniquePrefix();
-
-								xmlWriter.writeStartElement(prefix2,
-										"echoStringResponse", namespace2);
-								xmlWriter.writeNamespace(prefix2, namespace2);
-								xmlWriter.setPrefix(prefix2, namespace2);
-
-							} else {
-								xmlWriter.writeStartElement(namespace2,
-										"echoStringResponse");
-							}
+							xmlWriter.writeStartElement(prefix,
+									"echoStringResponse", namespace);
+							xmlWriter.writeNamespace(prefix, namespace);
+							xmlWriter.setPrefix(prefix, namespace);
 
 						} else {
-							xmlWriter.writeStartElement("echoStringResponse");
+							xmlWriter.writeStartElement(namespace,
+									"echoStringResponse");
 						}
 
-						// write the nil attribute
-						writeAttribute("xsi",
-								"http://www.w3.org/2001/XMLSchema-instance",
-								"nil", "true", xmlWriter);
-						xmlWriter.writeEndElement();
 					} else {
-						localEchoStringResponse.getOMElement(
-								new javax.xml.namespace.QName("",
-										"echoStringResponse"), factory)
-								.serialize(xmlWriter);
+						xmlWriter.writeStartElement("echoStringResponse");
 					}
-				}
 
-				xmlWriter.writeEndElement();
+					// write the nil attribute
+					writeAttribute("xsi",
+							"http://www.w3.org/2001/XMLSchema-instance", "nil",
+							"true", xmlWriter);
+					xmlWriter.writeEndElement();
+				} else {
+					localEchoStringResponse.getOMElement(MY_QNAME, factory)
+							.serialize(xmlWriter);
+				}
 
 			}
 
@@ -172,10 +134,12 @@
 					java.lang.String attName, java.lang.String attValue,
 					javax.xml.stream.XMLStreamWriter xmlWriter)
 					throws javax.xml.stream.XMLStreamException {
-
-				registerPrefix(xmlWriter, namespace);
-
-				xmlWriter.writeAttribute(namespace, attName, attValue);
+				if (namespace.equals("")) {
+					xmlWriter.writeAttribute(attName, attValue);
+				} else {
+					registerPrefix(xmlWriter, namespace);
+					xmlWriter.writeAttribute(namespace, attName, attValue);
+				}
 			}
 
 			/**
@@ -223,20 +187,15 @@
 	public javax.xml.stream.XMLStreamReader getPullParser(
 			javax.xml.namespace.QName qName) {
 
-		java.util.ArrayList elementList = new java.util.ArrayList();
-		java.util.ArrayList attribList = new java.util.ArrayList();
+		// We can safely assume an element has only one type associated with it
 
-		if (localEchoStringResponseTracker) {
-			elementList.add(new javax.xml.namespace.QName("",
-					"echoStringResponse"));
-
-			elementList.add(localEchoStringResponse == null ? null
-					: localEchoStringResponse);
+		if (localEchoStringResponse == null) {
+			return new org.apache.axis2.databinding.utils.reader.NullXMLStreamReader(
+					MY_QNAME);
+		} else {
+			return localEchoStringResponse.getPullParser(MY_QNAME);
 		}
 
-		return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(
-				qName, elementList.toArray(), attribList.toArray());
-
 	}
 
 	/**
@@ -264,30 +223,13 @@
 				while (!reader.isStartElement() && !reader.isEndElement())
 					reader.next();
 
-				if (reader.getAttributeValue(
-						"http://www.w3.org/2001/XMLSchema-instance", "type") != null) {
-					java.lang.String fullTypeName = reader
-							.getAttributeValue(
-									"http://www.w3.org/2001/XMLSchema-instance",
-									"type");
-					if (fullTypeName != null) {
-						java.lang.String nsPrefix = fullTypeName.substring(0,
-								fullTypeName.indexOf(":"));
-						nsPrefix = nsPrefix == null ? "" : nsPrefix;
-
-						java.lang.String type = fullTypeName
-								.substring(fullTypeName.indexOf(":") + 1);
-						if (!"EchoStringResponse".equals(type)) {
-							// find namespace for the prefix
-							java.lang.String nsUri = reader
-									.getNamespaceContext().getNamespaceURI(
-											nsPrefix);
-							return (EchoStringResponse) org.tempuri.ExtensionMapper
-									.getTypeObject(nsUri, type, reader);
-						}
-
-					}
-
+				if ("true".equals(reader.getAttributeValue(
+						"http://www.w3.org/2001/XMLSchema-instance", "nil"))) {
+					// Skip the element and report the null value. It cannot
+					// have subelements.
+					while (!reader.isEndElement())
+						reader.next();
+					return null;
 				}
 
 				// Note all attributes that were handled. Used to differ normal
@@ -305,30 +247,32 @@
 					isReaderMTOMAware = false;
 				}
 
-				reader.next();
+				while (!reader.isEndElement()) {
+					if (reader.isStartElement()) {
 
-				while (!reader.isStartElement() && !reader.isEndElement())
-					reader.next();
-
-				if (reader.isStartElement()
-						&& new javax.xml.namespace.QName("",
-								"echoStringResponse").equals(reader.getName())) {
-
-					object
-							.setEchoStringResponse(org.tempuri.EchoStringResponseBodyType.Factory
-									.parse(reader));
-
-					reader.next();
-
-				} // End of if for expected property start element
+						if (reader.isStartElement()
+								&& new javax.xml.namespace.QName(
+										"http://tempuri.org/",
+										"echoStringResponse").equals(reader
+										.getName())) {
+
+							object
+									.setEchoStringResponse(org.tempuri.EchoStringResponseBodyType.Factory
+											.parse(reader));
+
+						} // End of if for expected property start element
+
+						else {
+							// A start element we are not expecting indicates an
+							// invalid parameter was passed
+							throw new java.lang.RuntimeException(
+									"Unexpected subelement "
+											+ reader.getLocalName());
+						}
 
-				while (!reader.isStartElement() && !reader.isEndElement())
-					reader.next();
-				if (reader.isStartElement())
-					// A start element we are not expecting indicates a trailing
-					// invalid property
-					throw new java.lang.RuntimeException(
-							"Unexpected subelement " + reader.getLocalName());
+					} else
+						reader.next();
+				} // end of while loop
 
 			} catch (javax.xml.stream.XMLStreamException e) {
 				throw new java.lang.Exception(e);

Modified: webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponseBodyType.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponseBodyType.java?view=diff&rev=453129&r1=453128&r2=453129
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponseBodyType.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponseBodyType.java Thu Oct  5 00:56:36 2006
@@ -106,7 +106,7 @@
 				}
 
 				if (localEchoStringReturnTracker) {
-					namespace = "";
+					namespace = "http://tempuri.org/";
 
 					if (!namespace.equals("")) {
 						prefix = xmlWriter.getPrefix(namespace);
@@ -174,10 +174,12 @@
 					java.lang.String attName, java.lang.String attValue,
 					javax.xml.stream.XMLStreamWriter xmlWriter)
 					throws javax.xml.stream.XMLStreamException {
-
-				registerPrefix(xmlWriter, namespace);
-
-				xmlWriter.writeAttribute(namespace, attName, attValue);
+				if (namespace.equals("")) {
+					xmlWriter.writeAttribute(attName, attValue);
+				} else {
+					registerPrefix(xmlWriter, namespace);
+					xmlWriter.writeAttribute(namespace, attName, attValue);
+				}
 			}
 
 			/**
@@ -228,8 +230,8 @@
 		java.util.ArrayList attribList = new java.util.ArrayList();
 
 		if (localEchoStringReturnTracker) {
-			elementList.add(new javax.xml.namespace.QName("",
-					"EchoStringReturn"));
+			elementList.add(new javax.xml.namespace.QName(
+					"http://tempuri.org/", "EchoStringReturn"));
 
 			elementList.add(localEchoStringReturn == null ? null
 					: org.apache.axis2.databinding.utils.ConverterUtil
@@ -313,8 +315,8 @@
 					reader.next();
 
 				if (reader.isStartElement()
-						&& new javax.xml.namespace.QName("", "EchoStringReturn")
-								.equals(reader.getName())) {
+						&& new javax.xml.namespace.QName("http://tempuri.org/",
+								"EchoStringReturn").equals(reader.getName())) {
 
 					if (!"true"
 							.equals(reader

Added: webservices/sandesha/trunk/java/interop/src/org/tempuri/Ping.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/tempuri/Ping.java?view=auto&rev=453129
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/Ping.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/Ping.java Thu Oct  5 00:56:36 2006
@@ -0,0 +1,355 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.tempuri;
+
+/**
+ * Ping bean class
+ */
+
+public class Ping implements org.apache.axis2.databinding.ADBBean {
+
+	public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName(
+			"http://tempuri.org/", "Ping", "ns1");
+
+	/**
+	 * field for Text
+	 */
+
+	protected java.lang.String localText;
+
+	/*
+	 * This tracker boolean wil be used to detect whether the user called the
+	 * set method for this attribute. It will be used to determine whether to
+	 * include this field in the serialized XML
+	 */
+	protected boolean localTextTracker = false;
+
+	/**
+	 * Auto generated getter method
+	 * 
+	 * @return java.lang.String
+	 */
+	public java.lang.String getText() {
+		return localText;
+	}
+
+	/**
+	 * Auto generated setter method
+	 * 
+	 * @param param
+	 *            Text
+	 */
+	public void setText(java.lang.String param) {
+
+		// update the setting tracker
+		localTextTracker = true;
+
+		this.localText = param;
+
+	}
+
+	/**
+	 * 
+	 * @param parentQName
+	 * @param factory
+	 * @return org.apache.axiom.om.OMElement
+	 */
+	public org.apache.axiom.om.OMElement getOMElement(
+			final javax.xml.namespace.QName parentQName,
+			final org.apache.axiom.om.OMFactory factory) {
+
+		org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(
+				this, parentQName) {
+
+			public void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
+					throws javax.xml.stream.XMLStreamException {
+
+				java.lang.String prefix = parentQName.getPrefix();
+				java.lang.String namespace = parentQName.getNamespaceURI();
+
+				if (namespace != null) {
+					java.lang.String writerPrefix = xmlWriter
+							.getPrefix(namespace);
+					if (writerPrefix != null) {
+						xmlWriter.writeStartElement(namespace, parentQName
+								.getLocalPart());
+					} else {
+						if (prefix == null) {
+							prefix = org.apache.axis2.databinding.utils.BeanUtil
+									.getUniquePrefix();
+						}
+
+						xmlWriter.writeStartElement(prefix, parentQName
+								.getLocalPart(), namespace);
+						xmlWriter.writeNamespace(prefix, namespace);
+						xmlWriter.setPrefix(prefix, namespace);
+					}
+				} else {
+					xmlWriter.writeStartElement(parentQName.getLocalPart());
+				}
+
+				if (localTextTracker) {
+					namespace = "http://tempuri.org/";
+
+					if (!namespace.equals("")) {
+						prefix = xmlWriter.getPrefix(namespace);
+
+						if (prefix == null) {
+							prefix = org.apache.axis2.databinding.utils.BeanUtil
+									.getUniquePrefix();
+
+							xmlWriter.writeStartElement(prefix, "Text",
+									namespace);
+							xmlWriter.writeNamespace(prefix, namespace);
+							xmlWriter.setPrefix(prefix, namespace);
+
+						} else {
+							xmlWriter.writeStartElement(namespace, "Text");
+						}
+
+					} else {
+						xmlWriter.writeStartElement("Text");
+					}
+
+					if (localText == null) {
+						// write the nil attribute
+						writeAttribute("xsi",
+								"http://www.w3.org/2001/XMLSchema-instance",
+								"nil", "true", xmlWriter);
+					} else {
+
+						xmlWriter
+								.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil
+										.convertToString(localText));
+
+					}
+
+					xmlWriter.writeEndElement();
+				}
+
+				xmlWriter.writeEndElement();
+
+			}
+
+			/**
+			 * Util method to write an attribute with the ns prefix
+			 */
+			private void writeAttribute(java.lang.String prefix,
+					java.lang.String namespace, java.lang.String attName,
+					java.lang.String attValue,
+					javax.xml.stream.XMLStreamWriter xmlWriter)
+					throws javax.xml.stream.XMLStreamException {
+				if (xmlWriter.getPrefix(namespace) == null) {
+					xmlWriter.writeNamespace(prefix, namespace);
+					xmlWriter.setPrefix(prefix, namespace);
+
+				}
+
+				xmlWriter.writeAttribute(namespace, attName, attValue);
+
+			}
+
+			/**
+			 * Util method to write an attribute without the ns prefix
+			 */
+			private void writeAttribute(java.lang.String namespace,
+					java.lang.String attName, java.lang.String attValue,
+					javax.xml.stream.XMLStreamWriter xmlWriter)
+					throws javax.xml.stream.XMLStreamException {
+				if (namespace.equals("")) {
+					xmlWriter.writeAttribute(attName, attValue);
+				} else {
+					registerPrefix(xmlWriter, namespace);
+					xmlWriter.writeAttribute(namespace, attName, attValue);
+				}
+			}
+
+			/**
+			 * Register a namespace prefix
+			 */
+			private java.lang.String registerPrefix(
+					javax.xml.stream.XMLStreamWriter xmlWriter,
+					java.lang.String namespace)
+					throws javax.xml.stream.XMLStreamException {
+				java.lang.String prefix = xmlWriter.getPrefix(namespace);
+
+				if (prefix == null) {
+					prefix = createPrefix();
+
+					while (xmlWriter.getNamespaceContext().getNamespaceURI(
+							prefix) != null) {
+						prefix = createPrefix();
+					}
+
+					xmlWriter.writeNamespace(prefix, namespace);
+					xmlWriter.setPrefix(prefix, namespace);
+				}
+
+				return prefix;
+			}
+
+			/**
+			 * Create a prefix
+			 */
+			private java.lang.String createPrefix() {
+				return "ns" + (int) Math.random();
+			}
+		};
+
+		// ignore the QName passed in - we send only OUR QName!
+		return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME,
+				factory, dataSource);
+
+	}
+
+	/**
+	 * databinding method to get an XML representation of this object
+	 * 
+	 */
+	public javax.xml.stream.XMLStreamReader getPullParser(
+			javax.xml.namespace.QName qName) {
+
+		java.util.ArrayList elementList = new java.util.ArrayList();
+		java.util.ArrayList attribList = new java.util.ArrayList();
+
+		if (localTextTracker) {
+			elementList.add(new javax.xml.namespace.QName(
+					"http://tempuri.org/", "Text"));
+
+			elementList.add(localText == null ? null
+					: org.apache.axis2.databinding.utils.ConverterUtil
+							.convertToString(localText));
+		}
+
+		return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(
+				qName, elementList.toArray(), attribList.toArray());
+
+	}
+
+	/**
+	 * Factory class that keeps the parse method
+	 */
+	public static class Factory {
+
+		/**
+		 * static method to create the object Precondition: If this object is an
+		 * element, the current or next start element starts this object and any
+		 * intervening reader events are ignorable If this object is not an
+		 * element, it is a complex type and the reader is at the event just
+		 * after the outer start element Postcondition: If this object is an
+		 * element, the reader is positioned at its end element If this object
+		 * is a complex type, the reader is positioned at the end element of its
+		 * outer element
+		 */
+		public static Ping parse(javax.xml.stream.XMLStreamReader reader)
+				throws java.lang.Exception {
+			Ping object = new Ping();
+			int event;
+			try {
+
+				while (!reader.isStartElement() && !reader.isEndElement())
+					reader.next();
+
+				if (reader.getAttributeValue(
+						"http://www.w3.org/2001/XMLSchema-instance", "type") != null) {
+					java.lang.String fullTypeName = reader
+							.getAttributeValue(
+									"http://www.w3.org/2001/XMLSchema-instance",
+									"type");
+					if (fullTypeName != null) {
+						java.lang.String nsPrefix = fullTypeName.substring(0,
+								fullTypeName.indexOf(":"));
+						nsPrefix = nsPrefix == null ? "" : nsPrefix;
+
+						java.lang.String type = fullTypeName
+								.substring(fullTypeName.indexOf(":") + 1);
+						if (!"Ping".equals(type)) {
+							// find namespace for the prefix
+							java.lang.String nsUri = reader
+									.getNamespaceContext().getNamespaceURI(
+											nsPrefix);
+							return (Ping) org.tempuri.ExtensionMapper
+									.getTypeObject(nsUri, type, reader);
+						}
+
+					}
+
+				}
+
+				// Note all attributes that were handled. Used to differ normal
+				// attributes
+				// from anyAttributes.
+				java.util.Vector handledAttributes = new java.util.Vector();
+
+				boolean isReaderMTOMAware = false;
+
+				try {
+					isReaderMTOMAware = java.lang.Boolean.TRUE
+							.equals(reader
+									.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
+				} catch (java.lang.IllegalArgumentException e) {
+					isReaderMTOMAware = false;
+				}
+
+				reader.next();
+
+				while (!reader.isStartElement() && !reader.isEndElement())
+					reader.next();
+
+				if (reader.isStartElement()
+						&& new javax.xml.namespace.QName("http://tempuri.org/",
+								"Text").equals(reader.getName())) {
+
+					if (!"true"
+							.equals(reader
+									.getAttributeValue(
+											"http://www.w3.org/2001/XMLSchema-instance",
+											"nil"))) {
+
+						java.lang.String content = reader.getElementText();
+
+						object
+								.setText(org.apache.axis2.databinding.utils.ConverterUtil
+										.convertToString(content));
+
+					} else {
+						reader.getElementText(); // throw away text nodes if
+													// any.
+					}
+
+					reader.next();
+
+				} // End of if for expected property start element
+
+				while (!reader.isStartElement() && !reader.isEndElement())
+					reader.next();
+				if (reader.isStartElement())
+					// A start element we are not expecting indicates a trailing
+					// invalid property
+					throw new java.lang.RuntimeException(
+							"Unexpected subelement " + reader.getLocalName());
+
+			} catch (javax.xml.stream.XMLStreamException e) {
+				throw new java.lang.Exception(e);
+			}
+
+			return object;
+		}
+
+	}// end of factory class
+
+}



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