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 ja...@apache.org on 2005/07/03 06:55:34 UTC
cvs commit: ws-sandesha/interop/org/apache/sandesha/interop/testclient InteropStub.java
jaliya 2005/07/02 21:55:34
Modified: interop/org/apache/sandesha/interop MicrosoftSyncPing.java
interop/org/apache/sandesha/interop/testclient
InteropStub.java
Log:
Changed the interop stub
Revision Changes Path
1.3 +2 -1 ws-sandesha/interop/org/apache/sandesha/interop/MicrosoftSyncPing.java
Index: MicrosoftSyncPing.java
===================================================================
RCS file: /home/cvs/ws-sandesha/interop/org/apache/sandesha/interop/MicrosoftSyncPing.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MicrosoftSyncPing.java 22 Jun 2005 13:38:11 -0000 1.2
+++ MicrosoftSyncPing.java 3 Jul 2005 04:55:34 -0000 1.3
@@ -65,5 +65,6 @@
return "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\n" +
" <soapenv:Header>\n" + " </soapenv:Header>\n" + " <soapenv:Body>\n" + " <Ping xmlns=\"http://tempuri.org/\">\n" +
" <Text>Ping Message Number " + i + "</Text>\n" + " </Ping>\n" + " </soapenv:Body></soapenv:Envelope>";
- }
+
+ }
}
1.3 +31 -18 ws-sandesha/interop/org/apache/sandesha/interop/testclient/InteropStub.java
Index: InteropStub.java
===================================================================
RCS file: /home/cvs/ws-sandesha/interop/org/apache/sandesha/interop/testclient/InteropStub.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- InteropStub.java 22 Jun 2005 13:38:11 -0000 1.2
+++ InteropStub.java 3 Jul 2005 04:55:34 -0000 1.3
@@ -20,6 +20,8 @@
import org.apache.axis.AxisFault;
import org.apache.axis.Handler;
import org.apache.axis.SimpleChain;
+import org.apache.axis.Message;
+import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.components.logger.LogFactory;
@@ -134,16 +136,11 @@
configureContext(ctx, call, bean);
ctx.initCall(call, target, "urn:wsrm:ping", Constants.ClientProperties.IN_ONLY);
- call.setOperationName(new QName("http://tempuri.org", "Ping"));
-
- call.addParameter("Text", XMLType.XSD_STRING, ParameterMode.IN);
-
for (int i = 1; i <= msgs; i++) {
if (i == msgs) {
ctx.setLastMessage(call);
}
- String msg = "Sandesha Ping Message Number " + i;
- call.invoke(new Object[]{msg});
+ call.invoke(new Message(getPingSOAPEnvelope(i)));
}
//InteropStub.stopClient();
@@ -156,6 +153,28 @@
}
}
+
+ private static String getPingSOAPEnvelope(int i) {
+ return "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\n" +
+ " <soapenv:Header>\n" + " </soapenv:Header>\n" + " <soapenv:Body>\n" + " <Ping xmlns=\"http://tempuri.org/\">\n" +
+ " <Text>Sandesha Ping Message " + i + "</Text>\n" + " </Ping>\n" + " </soapenv:Body></soapenv:Envelope>";
+
+ }
+
+ private static String getEchoSOAPEnvelope(int i,String seq) {
+ return "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">\n" +
+ "<soapenv:Header>\n" +
+ "</soapenv:Header>\n" +
+ "<soapenv:Body>\n" +
+ " <echoString xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
+ " xmlns=\"http://tempuri.org/\">\n" +
+ " <Text>Sandesha Echo Message "+i+"</Text>\n" +
+ " <Sequence>"+seq+"</Sequence>\n" +
+ " </echoString>\n"+
+ "</soapenv:Body></soapenv:Envelope>";
+
+ }
+
public synchronized void runEcho(InteropBean bean) {
String target = bean.getTarget();
@@ -175,26 +194,20 @@
Call call = (Call) service.createCall();
SandeshaContext ctx = new SandeshaContext(true);
- ctx.setSourceURL( bean.getSourceURL());
+ ctx.setSourceURL(bean.getSourceURL());
configureContext(ctx, call, bean);
ctx.initCall(call, target, "urn:wsrm:echoString", Constants.ClientProperties.IN_OUT);
- call.setOperationName(new QName("http://tempuri.org/", "echoString"));
-
- call.addParameter("Text", XMLType.XSD_STRING, ParameterMode.IN);
- call.addParameter("Sequence", XMLType.XSD_STRING, ParameterMode.IN);
- call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
-
for (int i = 1; i <= messages; i++) {
- String msg = "Sandesha Echo String " + i;
-
- if (i == messages) {
+ if (i == messages) {
ctx.setLastMessage(call);
}
- String ret = (String) call.invoke(new Object[]{msg, seq});
- log.info("Got response from server " + ret);
+ SOAPEnvelope env = call.invoke(new Message(getEchoSOAPEnvelope(i,seq)));
+ if(log.isDebugEnabled()){
+ log.debug("Got response from server " + env.toString());
+ }
}
ctx.endSequence();
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org