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/11 13:57:22 UTC
svn commit: r462782 - in /webservices/sandesha/trunk/java: ./ interop/conf/
interop/src/org/apache/sandesha2/interop/
interop/src/org/apache/sandesha2/interop/rm1_1_clients/
interop/src/org/apache/sandesha2/interop/securerm/ interop/src/org/tempuri/
Author: chamikara
Date: Wed Oct 11 04:57:20 2006
New Revision: 462782
URL: http://svn.apache.org/viewvc?view=rev&rev=462782
Log:
Updated interop services and clients.
Added:
webservices/sandesha/trunk/java/interop/conf/SecRMInteropService.wsdl
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_3_1.java
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_2.java
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/securerm/
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/securerm/SecRMServiceImpl.java
Modified:
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceCallbackHandler.java
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOnly.java
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOut.java
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeleton.java
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeletonImpl.java
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceStub.java
webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_1.java
webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoString.java
webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringRequestBodyType.java
webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponse.java
webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponseBodyType.java
webservices/sandesha/trunk/java/interop/src/org/tempuri/ExtensionMapper.java
webservices/sandesha/trunk/java/interop/src/org/tempuri/Ping.java
webservices/sandesha/trunk/java/maven.xml
Added: webservices/sandesha/trunk/java/interop/conf/SecRMInteropService.wsdl
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/conf/SecRMInteropService.wsdl?view=auto&rev=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/conf/SecRMInteropService.wsdl (added)
+++ webservices/sandesha/trunk/java/interop/conf/SecRMInteropService.wsdl Wed Oct 11 04:57:20 2006
@@ -0,0 +1,138 @@
+<wsdl:definitions xmlns:tns="http://tempuri.org/"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://tempuri.org/">
+
+ <wsdl:types>
+
+ <xsd:schema targetNamespace="http://tempuri.org/"
+ attributeFormDefault="unqualified"
+ elementFormDefault="qualified" >
+
+ <xsd:element name="Ping">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="Text" minOccurs="0"
+ type="xsd:string" nillable="true" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="EchoStringRequest.BodyType">
+ <xsd:sequence>
+ <xsd:element name="Text" minOccurs="0"
+ type="xsd:string" nillable="true" />
+ <xsd:element name="Sequence" minOccurs="0"
+ type="xsd:string" nillable="true" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="echoString" type="tns:EchoStringRequest.BodyType" nillable="true" />
+
+ <xsd:complexType name="EchoStringResponse.BodyType">
+ <xsd:sequence>
+ <xsd:element name="EchoStringReturn" minOccurs="0"
+ type="xsd:string" nillable="true" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="echoStringResponse" type="tns:EchoStringResponse.BodyType" nillable="true"/>
+
+ </xsd:schema>
+
+ </wsdl:types>
+
+
+ <wsdl:message name="EchoStringRequest">
+ <wsdl:part name="part1" element="tns:echoString" />
+ </wsdl:message>
+
+ <wsdl:message name="EchoStringResponse">
+ <wsdl:part name="part1" element="tns:echoStringResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="PingRequest">
+ <wsdl:part name="part1" element="tns:Ping" />
+ </wsdl:message>
+
+ <wsdl:portType name="RMInteropServicePortType">
+
+ <wsdl:operation name="EchoString">
+ <wsdl:input message="tns:EchoStringRequest"
+ wsaw:Action="urn:wsrm:EchoString" />
+ <wsdl:output message="tns:EchoStringResponse"
+ wsaw:Action="urn:wsrm:EchoStringResponse" />
+ </wsdl:operation>
+
+ <wsdl:operation name="Ping">
+ <wsdl:input message="tns:PingRequest"
+ wsaw:Action="urn:wsrm:Ping" />
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="RMInteropServiceSOAP11Binding"
+ type="tns:RMInteropServicePortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+ <wsdl:operation name="EchoString">
+ <soap:operation soapAction="urn:wsrm:EchoString"
+ style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Ping">
+ <soap:operation soapAction="urn:wsrm:Ping" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:binding name="RMInteropServiceSOAP12Binding"
+ type="tns:RMInteropServicePortType">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+
+ <wsdl:operation name="EchoString">
+ <soap12:operation soapAction="urn:wsrm:EchoString"
+ style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="Ping">
+ <soap12:operation soapAction="urn:wsrm:Ping"
+ style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="SecRMInteropService">
+ <wsdl:port name="RMInteropServiceSOAP11port_http"
+ binding="tns:RMInteropServiceSOAP11Binding">
+ <soap:address location="http://www.example.org/" />
+ </wsdl:port>
+ <wsdl:port name="RMInteropServiceSOAP12port_http"
+ binding="tns:RMInteropServiceSOAP12Binding">
+ <soap12:address location="http://www.example.org/" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
\ No newline at end of file
Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceCallbackHandler.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceCallbackHandler.java?view=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceCallbackHandler.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceCallbackHandler.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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.apache.sandesha2.interop;
@@ -56,7 +56,7 @@
* auto generated Axis2 call back method for EchoString method
*
*/
- public void receiveResultEchoString(org.tempuri.EchoStringResponse param22) {
+ public void receiveResultEchoString(org.tempuri.EchoStringResponse param28) {
}
/**
Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOnly.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOnly.java?view=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOnly.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOnly.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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.apache.sandesha2.interop;
Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOut.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOut.java?view=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOut.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceMessageReceiverInOut.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,18 @@
+
/*
* 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
- *
+ *
+ * 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.
+ * 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.apache.sandesha2.interop;
Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeleton.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeleton.java?view=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeleton.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeleton.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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.apache.sandesha2.interop;
Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeletonImpl.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeletonImpl.java?view=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeletonImpl.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceSkeletonImpl.java Wed Oct 11 04:57:20 2006
@@ -51,36 +51,4 @@
System.out.println("Ping got text '" + text + "'");
}
- // public EchoStringResponse echoString(EchoStringRequest echoStringRequest)
- // {
- // String sequence = echoStringRequest.getEchoString().getSequence();
- // String text = echoStringRequest.getEchoString().getText();
- //
- // System.out.println("EchoString got text '" + text + "', for the sequence
- // '" + sequence + "'.") ;
- //
- // String oldText = (String) sequenceTextMap.get(sequence);
- // String newText = oldText==null?text:oldText+text;
- // sequenceTextMap.put(sequence, newText);
- //
- // EchoStringResponse echoStringResponse = new EchoStringResponse ();
- // echoStringResponse.getEchoStringResponse().setEchoStringReturn(newText);
- //
- // return echoStringResponse;
- // }
- //
- // public EchoStringResponse EchoString(EchoStringRequest echoStringRequest)
- // {
- // return echoString(echoStringRequest);
- // }
- //
- // public void ping(PingRequest pingRequest) {
- // String text = pingRequest.getText();
- // System.out.println("Ping got text '" + text + "'");
- // }
- //
- // public void Ping(PingRequest pingRequest) {
- // ping(pingRequest);
- // }
-
}
Modified: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceStub.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceStub.java?view=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceStub.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/RMInteropServiceStub.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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.apache.sandesha2.interop;
@@ -44,21 +44,17 @@
__operation = new org.apache.axis2.description.OutInAxisOperation();
__operation.setName(new javax.xml.namespace.QName("", "EchoString"));
+ _service.addOperation(__operation);
_operations[0] = __operation;
- _service.addOperation(__operation);
- __operation.applyPolicy(new org.apache.neethi.Policy());
-
__operation = new org.apache.axis2.description.OutOnlyAxisOperation();
__operation.setName(new javax.xml.namespace.QName("", "Ping"));
+ _service.addOperation(__operation);
_operations[1] = __operation;
- _service.addOperation(__operation);
- __operation.applyPolicy(new org.apache.neethi.Policy());
-
}
// populates the faults
@@ -78,6 +74,8 @@
_serviceClient = new org.apache.axis2.client.ServiceClient(
configurationContext, _service);
+ _service.applyPolicy();
+
configurationContext = _serviceClient.getServiceContext()
.getConfigurationContext();
@@ -108,12 +106,12 @@
* Auto generated method signature
*
* @see org.apache.sandesha2.interop.RMInteropService#EchoString
- * @param param24
+ * @param param30
*
*/
public org.tempuri.EchoStringResponse EchoString(
- org.tempuri.EchoString param24) throws java.rmi.RemoteException
+ org.tempuri.EchoString param30) throws java.rmi.RemoteException
{
try {
@@ -129,7 +127,7 @@
// Style is Doc.
env = toEnvelope(getFactory(_operationClient.getOptions()
- .getSoapVersionURI()), param24,
+ .getSoapVersionURI()), param30,
optimizeContent(new javax.xml.namespace.QName("",
"EchoString")));
@@ -220,12 +218,12 @@
* Auto generated method signature for Asynchronous Invocations
*
* @see org.apache.sandesha2.interop.RMInteropService#startEchoString
- * @param param24
+ * @param param30
*
*/
public void startEchoString(
- org.tempuri.EchoString param24,
+ org.tempuri.EchoString param30,
final org.apache.sandesha2.interop.RMInteropServiceCallbackHandler callback)
throws java.rmi.RemoteException {
@@ -242,7 +240,7 @@
env = toEnvelope(
getFactory(_operationClient.getOptions().getSoapVersionURI()),
- param24,
+ param30,
optimizeContent(new javax.xml.namespace.QName("", "EchoString")));
// adding SOAP headers
@@ -285,9 +283,11 @@
}
- public void Ping(org.tempuri.Ping param26
+ public void Ping(org.tempuri.Ping param32
- ) throws java.rmi.RemoteException {
+ ) throws java.rmi.RemoteException
+
+ {
org.apache.axis2.client.OperationClient _operationClient = _serviceClient
.createClient(_operations[1].getName());
@@ -299,7 +299,7 @@
// Style is Doc.
env = toEnvelope(getFactory(_operationClient.getOptions()
- .getSoapVersionURI()), param26,
+ .getSoapVersionURI()), param32,
optimizeContent(new javax.xml.namespace.QName("", "Ping")));
// adding SOAP headers
@@ -312,6 +312,7 @@
_operationClient.addMessageContext(_messageContext);
_operationClient.execute(true);
+
return;
}
Added: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_3_1.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_3_1.java?view=auto&rev=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_3_1.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_3_1.java Wed Oct 11 04:57:20 2006
@@ -0,0 +1,291 @@
+/*
+ * 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.apache.sandesha2.interop.rm1_1_clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+
+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.SOAPBody;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.axis2.description.OutInAxisOperation;
+import org.apache.sandesha2.Sandesha2Constants;
+import org.apache.sandesha2.SandeshaException;
+import org.apache.sandesha2.client.SandeshaClient;
+import org.apache.sandesha2.client.SandeshaClientConstants;
+import org.apache.sandesha2.client.SequenceReport;
+import org.apache.sandesha2.interop.RMInteropServiceCallbackHandler;
+import org.apache.sandesha2.interop.RMInteropServiceCallbackHandlerImpl;
+import org.apache.sandesha2.interop.RMInteropServiceStub;
+import org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
+import org.apache.sandesha2.storage.inmemory.InMemorySenderBeanMgr;
+import org.apache.sandesha2.util.SandeshaUtil;
+import org.tempuri.EchoString;
+import org.tempuri.EchoStringRequestBodyType;
+
+public class Scenario_3_1 {
+
+ private final static String applicationNamespaceName = "http://tempuri.org/";
+ private final static String echoString = "echoString";
+ private final static String Text = "Text";
+ private final static String Sequence = "Sequence";
+ private final static String echoStringResponse = "echoStringResponse";
+ private final static String EchoStringReturn = "EchoStringReturn";
+
+ private static String toIP = "127.0.0.1";
+ private static String toPort = "8080";
+ private static String transportToIP = "127.0.0.1";
+ private static String transportToPort = "8070";
+ private static String servicePart = "/axis2/services/RMInteropService";
+ private static String toAddress = "http://" + toIP + ":" + toPort + servicePart;
+ private static String transportToEPR = "http://" + transportToIP + ":" + transportToPort + servicePart;
+
+ private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+
+ private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator; //this will be available after a maven build
+
+ public static void main(String[] args) throws Exception,IOException {
+
+
+ String axisClientRepo = null;
+ if (args!=null && args.length>0)
+ axisClientRepo = args[0];
+
+ if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+ AXIS2_CLIENT_PATH = axisClientRepo;
+ SANDESHA2_HOME = "";
+ }
+
+ InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+ Properties properties = new Properties();
+ if (in != null) {
+ properties.load(in);
+
+ toAddress = properties.getProperty("to");
+ transportToEPR = properties.getProperty("transportTo");
+ }
+
+// new Scenario_2_1 ().run();
+
+
+ new Scenario_3_1 ().runStubBased ();
+ }
+
+ private void run () throws Exception {
+
+ ConfigurationContext configurationContext = getConfigurationContext();
+ ServiceClient serviceClient = new ServiceClient (configurationContext,null);
+
+ Options clientOptions = new Options ();
+
+ String sequenceKey = "sequence4";
+ String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+
+ setUpOptions(clientOptions, sequenceKey,acksTo);
+
+ 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("true");
+ useOfferElem.setText("true");
+// toEPR.addReferenceParameter(acceptOfferElem);
+// toEPR.addReferenceParameter(useOfferElem);
+// clientOptions.setManageSession(true); // without this reference params wont go.
+
+ EndpointReference toEPR = new EndpointReference (toAddress);
+ serviceClient.setTargetEPR(toEPR);
+
+ serviceClient.setOptions(clientOptions);
+
+ Callback callback1 = new TestCallback ("Callback 1");
+ serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);
+
+ Callback callback2 = new TestCallback ("Callback 2");
+ serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo2",sequenceKey),callback2);
+
+ Callback callback3 = new TestCallback ("Callback 3");
+ serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo3",sequenceKey),callback3);
+
+ while (!callback3.isComplete()) {
+ Thread.sleep(1000);
+ }
+
+ Thread.sleep(5000);
+
+ SandeshaClient.terminateSequence(serviceClient);
+
+ Thread.sleep(10000);
+
+ }
+
+ private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+ OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+ OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+ OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+
+ textElem.setText(text);
+ sequenceElem.setText(sequenceKey);
+ echoStringElement.addChild(textElem);
+ echoStringElement.addChild(sequenceElem);
+
+ return echoStringElement;
+ }
+
+ class TestCallback extends Callback {
+
+ String name = null;
+
+ public TestCallback (String name) {
+ this.name = name;
+ }
+
+ public void onComplete(AsyncResult result) {
+ //System.out.println("On Complete Called for " + text);
+ SOAPBody body = result.getResponseEnvelope().getBody();
+
+ OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
+ if (echoStringResponseElem==null) {
+ System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
+ return;
+ }
+
+ OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+ if (echoStringReturnElem==null) {
+ System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+ return;
+ }
+
+ String resultStr = echoStringReturnElem.getText();
+ System.out.println("Callback '" + name + "' got result:" + resultStr);
+ }
+
+ public void onError (Exception e) {
+ // TODO Auto-generated method stub
+ 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(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);
+
+ clientOptions.setProperty(OutInAxisOperation.USE_CUSTOM_LISTNER,new Boolean (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");
+
+ options.setReplyTo(new EndpointReference (AddressingConstants.Final.WSA_ANONYMOUS_URL));
+
+ 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);
+ }
+
+ Thread.sleep(5000);
+
+ SandeshaClient.terminateSequence(stubServiceClient);
+
+ Thread.sleep(20000);
+
+ }
+}
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=462782&r1=462781&r2=462782
==============================================================================
--- 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 Wed Oct 11 04:57:20 2006
@@ -115,9 +115,26 @@
serviceClient.fireAndForget(getPingOMBlock("ping2"));
serviceClient.fireAndForget(getPingOMBlock("ping3"));
+ 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(3000);
+
terminateSequence(serviceClient);
- Thread.sleep(5000);
+ Thread.sleep(3000);
serviceClient.getOptions().setProperty(SandeshaClientConstants.UNRELIABLE_MESSAGE, Constants.VALUE_TRUE);
serviceClient.getOptions().setProperty(RampartMessageData.CANCEL_REQUEST, Constants.VALUE_TRUE);
Added: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_2.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_2.java?view=auto&rev=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_2.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/rm1_1_clients/Scenario_4_2.java Wed Oct 11 04:57:20 2006
@@ -0,0 +1,287 @@
+package org.apache.sandesha2.interop.rm1_1_clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+
+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.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.client.async.AsyncResult;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
+import org.apache.axis2.description.OutInAxisOperation;
+import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyEngine;
+import org.apache.rampart.RampartMessageData;
+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.interop.rm1_1_clients.Scenario_2_1.TestCallback;
+import org.apache.sandesha2.util.SandeshaUtil;
+import org.tempuri.EchoString;
+import org.tempuri.EchoStringRequestBodyType;
+
+public class Scenario_4_2 {
+
+ private final static String applicationNamespaceName = "http://tempuri.org/";
+ private final static String echoString = "echoString";
+ private final static String Text = "Text";
+ private final static String Sequence = "Sequence";
+ private final static String echoStringResponse = "echoStringResponse";
+ private final static String EchoStringReturn = "EchoStringReturn";
+
+ private static String toIP = "127.0.0.1";
+ private static String toPort = "8080";
+ private static String transportToIP = "127.0.0.1";
+ private static String transportToPort = "8070";
+ private static String servicePart = "/axis2/services/RMInteropService";
+ private static String toAddress = "http://" + toIP + ":" + toPort + servicePart;
+ private static String transportToEPR = "http://" + transportToIP + ":" + transportToPort + servicePart;
+
+ private static String SANDESHA2_HOME = "<SANDESHA2_HOME>"; //Change this to ur path.
+
+ private static String AXIS2_CLIENT_PATH = SANDESHA2_HOME + File.separator + "target" + File.separator +"repos" + File.separator + "client" + File.separator; //this will be available after a maven build
+
+ private final static String CLIENT_POLICY_PATH = "interop/conf/sec-client-policy.xml";
+
+ public static void main(String[] args) throws Exception,IOException {
+
+
+ String axisClientRepo = null;
+ if (args!=null && args.length>0)
+ axisClientRepo = args[0];
+
+ if (axisClientRepo!=null && !"".equals(axisClientRepo)) {
+ AXIS2_CLIENT_PATH = axisClientRepo;
+ SANDESHA2_HOME = "";
+ }
+
+ InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("sandesha2_interop.properties");
+
+ Properties properties = new Properties();
+ if (in != null) {
+ properties.load(in);
+
+ toAddress = properties.getProperty("to");
+ transportToEPR = properties.getProperty("transportTo");
+ }
+
+ new Scenario_4_2 ().run();
+// new Scenario_3_1 ().runStubBased ();
+ }
+
+ private void run () throws Exception {
+
+ ConfigurationContext configurationContext = getConfigurationContext();
+ ServiceClient serviceClient = new ServiceClient (configurationContext,null);
+
+ Options clientOptions = new Options ();
+
+ serviceClient.engageModule(new QName("rampart"));
+
+ String sequenceKey = "sequence4";
+ String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
+
+ setUpOptions(clientOptions, sequenceKey,acksTo);
+
+ 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("true");
+ useOfferElem.setText("true");
+// toEPR.addReferenceParameter(acceptOfferElem);
+// toEPR.addReferenceParameter(useOfferElem);
+// clientOptions.setManageSession(true); // without this reference params wont go.
+
+ clientOptions.setReplyTo(new EndpointReference (AddressingConstants.Final.WSA_ANONYMOUS_URL));
+
+ EndpointReference toEPR = new EndpointReference (toAddress);
+ serviceClient.setTargetEPR(toEPR);
+
+ serviceClient.setOptions(clientOptions);
+
+ Callback callback1 = new TestCallback ("Callback 1");
+ serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);
+
+// Callback callback2 = new TestCallback ("Callback 2");
+// serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo2",sequenceKey),callback2);
+//
+// Callback callback3 = new TestCallback ("Callback 3");
+// serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo3",sequenceKey),callback3);
+
+ while (!callback1.isComplete()) {
+ Thread.sleep(1000);
+ }
+
+ Thread.sleep(3000);
+
+ SandeshaClient.terminateSequence(serviceClient);
+
+ Thread.sleep(10000);
+
+ }
+
+ private static OMElement getEchoOMBlock(String text, String sequenceKey) {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName,"ns1");
+ OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
+ OMElement textElem = fac.createOMElement(Text,applicationNamespace);
+ OMElement sequenceElem = fac.createOMElement(Sequence,applicationNamespace);
+
+ textElem.setText(text);
+ sequenceElem.setText(sequenceKey);
+ echoStringElement.addChild(textElem);
+ echoStringElement.addChild(sequenceElem);
+
+ return echoStringElement;
+ }
+
+ class TestCallback extends Callback {
+
+ String name = null;
+
+ public TestCallback (String name) {
+ this.name = name;
+ }
+
+ public void onComplete(AsyncResult result) {
+ //System.out.println("On Complete Called for " + text);
+ SOAPBody body = result.getResponseEnvelope().getBody();
+
+ OMElement echoStringResponseElem = body.getFirstChildWithName(new QName (applicationNamespaceName,echoStringResponse));
+ if (echoStringResponseElem==null) {
+ System.out.println("Error: SOAPBody does not have a 'echoStringResponse' child");
+ return;
+ }
+
+ OMElement echoStringReturnElem = echoStringResponseElem.getFirstChildWithName(new QName (applicationNamespaceName,EchoStringReturn));
+ if (echoStringReturnElem==null) {
+ System.out.println("Error: 'echoStringResponse' element does not have a 'EchoStringReturn' child");
+ return;
+ }
+
+ String resultStr = echoStringReturnElem.getText();
+ System.out.println("Callback '" + name + "' got result:" + resultStr);
+ }
+
+ public void onError (Exception e) {
+ // TODO Auto-generated method stub
+ 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) throws Exception {
+
+ 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(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);
+
+ clientOptions.setProperty(OutInAxisOperation.USE_CUSTOM_LISTNER,new Boolean (true));
+
+ clientOptions.setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy(CLIENT_POLICY_PATH));
+ }
+
+
+ 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");
+
+ options.setReplyTo(new EndpointReference (AddressingConstants.Final.WSA_ANONYMOUS_URL));
+
+ 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);
+ }
+
+ Thread.sleep(5000);
+
+ SandeshaClient.terminateSequence(stubServiceClient);
+
+ Thread.sleep(10000);
+
+ }
+
+ private static Policy loadPolicy(String xmlPath) throws Exception {
+ StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
+ return PolicyEngine.getPolicy(builder.getDocumentElement());
+ }
+}
Added: webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/securerm/SecRMServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/securerm/SecRMServiceImpl.java?view=auto&rev=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/securerm/SecRMServiceImpl.java (added)
+++ webservices/sandesha/trunk/java/interop/src/org/apache/sandesha2/interop/securerm/SecRMServiceImpl.java Wed Oct 11 04:57:20 2006
@@ -0,0 +1,79 @@
+/*
+ * 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.apache.sandesha2.interop.securerm;
+
+import java.util.HashMap;
+import javax.xml.namespace.QName;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+
+public class SecRMServiceImpl {
+
+ HashMap sequenceTextMap = new HashMap();
+ String namespaceValue = "http://tempuri.org/";
+ String Ping = "Ping";
+ String Text = "Text";
+ String echoString = "echoString";
+ String Sequence = "Sequence";
+ String echoStringResponse = "echoStringResponse";
+ String EchoStringReturn = "EchoStringReturn";
+
+ public OMElement EchoString(OMElement echoStringElement) throws Exception {
+ if (echoStringElement==null)
+ throw new Exception ("Payload is null");
+
+ OMElement textElement = echoStringElement.getFirstChildWithName(new QName (namespaceValue,Text));
+ OMElement sequenceElement = echoStringElement.getFirstChildWithName(new QName (namespaceValue,Sequence));
+
+ if (textElement==null)
+ throw new Exception ("'Text' element is null");
+
+ if (sequenceElement==null)
+ throw new Exception ("'Sequence' element is null");
+
+ String text = textElement.getText();
+ String sequence = sequenceElement.getText();
+
+ System.out.println("'EchoString' got text '" + text + "' for the sequence '" + sequence + "'.");
+
+ String oldReturnValue = (String) sequenceTextMap.get(sequence);
+ String newReturnValue = oldReturnValue==null?text:oldReturnValue+text;
+
+ sequenceTextMap.put(sequence, newReturnValue);
+
+ OMFactory factory = echoStringElement.getOMFactory();
+ OMNamespace namespace = factory.createOMNamespace(namespaceValue, "ns1");
+ OMElement echoStringResponseElement = factory.createOMElement(echoStringResponse,namespace);
+ OMElement echoStringReturnElement = factory.createOMElement(EchoStringReturn, namespace);
+ echoStringReturnElement.setText(newReturnValue);
+ echoStringResponseElement.addChild(echoStringReturnElement);
+
+ return echoStringResponseElement;
+ }
+
+ public void Ping(OMElement pingElement) throws Exception {
+ if (pingElement==null)
+ throw new Exception ("Payload is null");
+
+ OMElement textElement = pingElement.getFirstChildWithName(new QName (namespaceValue,Text));
+ String text = textElement.getText();
+
+ System.out.println("'Ping' got text '" + text + "'.");
+ }
+
+}
Modified: 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=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoString.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoString.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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;
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=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringRequestBodyType.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringRequestBodyType.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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;
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=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponse.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponse.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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;
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=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponseBodyType.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/EchoStringResponseBodyType.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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;
Modified: webservices/sandesha/trunk/java/interop/src/org/tempuri/ExtensionMapper.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/interop/src/org/tempuri/ExtensionMapper.java?view=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/ExtensionMapper.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/ExtensionMapper.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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;
Modified: 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=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/interop/src/org/tempuri/Ping.java (original)
+++ webservices/sandesha/trunk/java/interop/src/org/tempuri/Ping.java Wed Oct 11 04:57:20 2006
@@ -1,17 +1,17 @@
/*
* 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
- *
+ *
+ * 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.
+ * 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;
Modified: webservices/sandesha/trunk/java/maven.xml
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/maven.xml?view=diff&rev=462782&r1=462781&r2=462782
==============================================================================
--- webservices/sandesha/trunk/java/maven.xml (original)
+++ webservices/sandesha/trunk/java/maven.xml Wed Oct 11 04:57:20 2006
@@ -304,7 +304,8 @@
<ant:copy file="${build.interop.dir}/${interop.service.aar.name}" toDir="${build.repo.dir}/server/services" overwrite="true"/>
<ant:copy file="${dir.interop}/conf/sec-services.xml" toFile="${dir.interop.service.temp}/META-INF/services.xml" overwrite="true"/>
- <ant:copy file="${dir.interop}/conf/store.jks" toFile="${dir.interop.service.temp}/META-INF/store.jks" overwrite="true"/>
+ <ant:copy file="${dir.interop}/conf/SecRMInteropService.wsdl" toFile="${dir.interop.service.temp}/META-INF/RMInteropService.wsdl" overwrite="true"/>
+ <ant:copy file="${dir.interop}/conf/store.jks" toFile="${dir.interop.service.temp}/store.jks" overwrite="true"/>
<ant:jar jarfile="${build.interop.dir}/${interop.sec.service.aar.name}" basedir="${dir.interop.service.temp}" overwrite="true"/>
<ant:copy file="${build.interop.dir}/${interop.sec.service.aar.name}" toDir="${build.repo.dir}/server/services" overwrite="true"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org