You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by as...@apache.org on 2005/08/11 11:18:47 UTC
svn commit: r231418 - in
/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws:
src/org/apache/axis/jaxrpc/client/ src/org/apache/axis/jaxrpc/handler/
src/org/apache/axis/jaxrpc/handler/soap/ src/org/apache/axis/jaxrpc/server/
test/org/ap...
Author: ashutosh
Date: Thu Aug 11 02:18:19 2005
New Revision: 231418
URL: http://svn.apache.org/viewcvs?rev=231418&view=rev
Log: (empty)
Modified:
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/BindingProviderImpl.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/DispatchImpl.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/ServiceImpl.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/Axis2Handler.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/server/JAXRPCInOutMessageReceiver.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/ClientWithLoggingHandler.java
webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/LoggingHandler.java
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/BindingProviderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/BindingProviderImpl.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/BindingProviderImpl.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/BindingProviderImpl.java Thu Aug 11 02:18:19 2005
@@ -40,7 +40,11 @@
protected Map<QName, List> portHandlerChain;
protected Phase jaxRpcPhase;
- ServiceContext sContext;
+
+ //Only one of sContext or clientHome needs to be set, if clientHome is set
+ // it takes the priority
+ protected ServiceContext sContext;
+ protected String clientHome;
public BindingProviderImpl(){
//default constructor
@@ -71,6 +75,14 @@
// For now just returning ServiceHandlerChain. Later may decide
// on what basis should take handlers from bindingHandlerChain and portHandlerChain
return serviceHandlerChain;
+ }
+
+ public void setClientHome(String clientHome){
+ this.clientHome = clientHome;
+ }
+
+ public String getClientHome(){
+ return clientHome;
}
}
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/CallImpl.java Thu Aug 11 02:18:19 2005
@@ -436,16 +436,14 @@
inputParams.clear();
operationName = opName;
- OperationDescription od = new OperationDescription(opName);
if(jaxRpcPhase != null){
- //od.setRemainingPhasesInFlow(jaxRpcPhase.getHandlers());
- //od.setPhasesOutFlow(jaxRpcPhase.getHandlers());
+ OperationDescription od = new OperationDescription(opName);
java.util.ArrayList phaseList = new java.util.ArrayList();
phaseList.add(jaxRpcPhase);
od.setRemainingPhasesInFlow(phaseList);
od.setPhasesOutFlow(phaseList);
+ sContext.getServiceConfig().addOperation(od);
}
- sContext.getServiceConfig().addOperation(od);
}
/**
@@ -638,8 +636,17 @@
//TODO axis2Call object should actually be gotten somehow from underlying Axis2 engine
// may have to change the following line
- org.apache.axis2.clientapi.Call axis2Call = new org.apache.axis2.clientapi.Call(sContext);
- axis2Call.setTo(new EndpointReference(AddressingConstants.WSA_TO,targetEndpointAddress));
+ org.apache.axis2.clientapi.Call axis2Call = null;
+ if(clientHome != null){
+ axis2Call = new org.apache.axis2.clientapi.Call(clientHome);
+ axis2Call.engageModule(new QName("logging"));
+ }
+ else if(sContext != null){
+ axis2Call = new org.apache.axis2.clientapi.Call(sContext);
+ }else{
+ axis2Call = new org.apache.axis2.clientapi.Call();
+ }
+ axis2Call.setTo(new EndpointReference(targetEndpointAddress));
OMElement response = axis2Call.invokeBlocking(operationName.getLocalPart(),methodElement);
//Now the job of extracting the return value out of the OMElement and
@@ -749,7 +756,7 @@
//TODO axis2Call object should actually be gotten somehow from underlying Axis2 engine
// may have to change the following line
org.apache.axis2.clientapi.Call axis2Call = new org.apache.axis2.clientapi.Call();
- axis2Call.setTo(new EndpointReference(AddressingConstants.WSA_TO,targetEndpointAddress));
+ axis2Call.setTo(new EndpointReference(targetEndpointAddress));
//a callback object that does nothing. We know we don't have anything
//on response cycle for this fire-n-forget kind of invokeOneWay method.
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/DispatchImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/DispatchImpl.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/DispatchImpl.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/DispatchImpl.java Thu Aug 11 02:18:19 2005
@@ -66,7 +66,7 @@
//use this inputElement to invoke the underlying Axis2 call's
//invokeBlocking(...) method.
org.apache.axis2.clientapi.Call axis2Call = new org.apache.axis2.clientapi.Call();
- axis2Call.setTo(new EndpointReference(AddressingConstants.WSA_TO,targetEndpointAddress));
+ axis2Call.setTo(new EndpointReference(targetEndpointAddress));
response = axis2Call.invokeBlocking(operationName.getLocalPart(),inputElement);
//TODO actually the response message better be transformed to a Source object
//and returned.
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/ServiceImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/ServiceImpl.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/ServiceImpl.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/client/ServiceImpl.java Thu Aug 11 02:18:19 2005
@@ -57,7 +57,7 @@
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.engine.AxisConfigurationImpl;
import org.apache.axis2.engine.AxisEngine;
-import org.apache.axis2.engine.AxisFault;
+import org.apache.axis2.AxisFault;
import org.apache.axis2.engine.Phase;
import org.apache.axis2.phaseresolver.PhaseResolver;
@@ -158,7 +158,8 @@
//INFORMATION TO AXIS2 INFORMATION(SPECIFICALLY HANDLER INFO)
try{
((CallImpl)call).jaxRpcPhase = createAxis2Phase((CallImpl)call);
- ((CallImpl)call).sContext = getAxis2Service();
+ if(((CallImpl)call).jaxRpcPhase != null)
+ ((CallImpl)call).sContext = getAxis2Service();
} catch (Exception e){
e.printStackTrace();
}
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/Axis2Handler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/Axis2Handler.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/Axis2Handler.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/Axis2Handler.java Thu Aug 11 02:18:19 2005
@@ -2,7 +2,7 @@
import org.apache.axis.jaxrpc.handler.soap.SOAPMessageContextImpl;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.engine.AxisFault;
+import org.apache.axis2.AxisFault;
import org.apache.axis2.handlers.AbstractHandler;
public class Axis2Handler extends AbstractHandler {
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/handler/soap/SOAPMessageContextImpl.java Thu Aug 11 02:18:19 2005
@@ -41,6 +41,8 @@
axisMC.setEnvelope(((org.apache.axis2.saaj.SOAPEnvelopeImpl)(message.getSOAPPart().getEnvelope())).getOMEnvelope());
} catch(javax.xml.soap.SOAPException e){
throw new JAXRPCException(e);
+ } catch(org.apache.axis2.AxisFault af){
+ throw new JAXRPCException(af);
}
}
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/server/JAXRPCInOutMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/server/JAXRPCInOutMessageReceiver.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/server/JAXRPCInOutMessageReceiver.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/src/org/apache/axis/jaxrpc/server/JAXRPCInOutMessageReceiver.java Thu Aug 11 02:18:19 2005
@@ -10,7 +10,7 @@
import org.apache.axis2.om.impl.llom.OMTextImpl;
import org.apache.axis2.soap.SOAPEnvelope;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.engine.AxisFault;
+import org.apache.axis2.AxisFault;
import org.apache.axis2.engine.MessageReceiver;
/**
* @author sunja07
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/client/CallTesting.java Thu Aug 11 02:18:19 2005
@@ -6,14 +6,19 @@
import java.io.BufferedOutputStream;
import java.io.OutputStream;
import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.ParameterMode;
+import javax.xml.rpc.handler.HandlerInfo;
+import javax.xml.rpc.handler.HandlerRegistry;
//import javax.xml.rpc.ServiceFactory;
import org.apache.axis.jaxrpc.client.ServiceImpl;
+import org.apache.axis.jaxrpc.handler.soap.LoggingHandler;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.impl.OMOutputImpl;
@@ -33,9 +38,18 @@
try {
Service s = new ServiceImpl();
+
+ HandlerRegistry registry = s.getHandlerRegistry();
+ List<HandlerInfo> handlerList = new ArrayList<HandlerInfo>();
+ HandlerInfo hInfo = new HandlerInfo();
+ hInfo.setHandlerClass(LoggingHandler.class);
+ handlerList.add(hInfo);
+ registry.setHandlerChain(handlerList);
+
Call call = s.createCall();
+ ((BindingProviderImpl)call).setClientHome("C:\\Apache\\Axis 2 scratch\\ashu_jaya_venkat\\jaxws\\test\\org\\apache\\axis\\jaxrpc\\handler\\soap\\dd");
call.setOperationName(new QName("http://testingURL.org/","EchoString"));
- call.setTargetEndpointAddress("http://localhost:9090/axis/services/Echo");
+ call.setTargetEndpointAddress("http://localhost:8080/axis/services/Echo");
call.addParameter("param1", new QName("http://www.w3.org/2001/XMLSchema","any"), java.lang.Object.class, ParameterMode.IN);
call.setReturnType(new QName("http://www.w3.org/2001/XMLSchema","any"), Object.class);
Object[] inParams = new Object[]{"hello World!"};
@@ -50,7 +64,7 @@
} catch (Exception e){}
} catch (Exception e) {
- System.out.println(e.getMessage());
+ e.printStackTrace();
fail(e.getMessage());
}
}
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/ClientWithLoggingHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/ClientWithLoggingHandler.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/ClientWithLoggingHandler.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/ClientWithLoggingHandler.java Thu Aug 11 02:18:19 2005
@@ -1,26 +1,31 @@
package org.apache.axis.jaxrpc.handler.soap;
-import junit.framework.TestCase;
+//import java.net.URL;
-import javax.xml.namespace.QName;
import java.io.BufferedOutputStream;
import java.io.OutputStream;
-import java.net.URL;
+import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
-import javax.xml.rpc.ServiceFactory;
-import javax.xml.rpc.Service;
+import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
+import javax.xml.rpc.Service;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.HandlerRegistry;
+//import javax.xml.rpc.ServiceFactory;
+import org.apache.axis.jaxrpc.client.BindingProviderImpl;
import org.apache.axis.jaxrpc.client.ServiceImpl;
+import org.apache.axis.jaxrpc.handler.soap.LoggingHandler;
+
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.impl.OMOutputImpl;
+import junit.framework.TestCase;
+
public class ClientWithLoggingHandler extends TestCase {
public static void main(String[] args) {
@@ -29,9 +34,10 @@
public ClientWithLoggingHandler(String name) {
super(name);
}
-
- public void testDII() {
+
+ public void testInvoke1() {
try {
+
Service s = new ServiceImpl();
HandlerRegistry registry = s.getHandlerRegistry();
@@ -42,12 +48,14 @@
registry.setHandlerChain(handlerList);
Call call = s.createCall();
+ ((BindingProviderImpl)call).setClientHome("C:\\Apache\\Axis 2 scratch\\ashu_jaya_venkat\\jaxws\\test\\org\\apache\\axis\\jaxrpc\\handler\\soap\\dd");
call.setOperationName(new QName("http://testingURL.org/","EchoString"));
call.setTargetEndpointAddress("http://localhost:8080/axis/services/Echo");
call.addParameter("param1", new QName("http://www.w3.org/2001/XMLSchema","any"), java.lang.Object.class, ParameterMode.IN);
call.setReturnType(new QName("http://www.w3.org/2001/XMLSchema","any"), Object.class);
Object[] inParams = new Object[]{"hello World!"};
OMElement response = (OMElement)call.invoke(inParams);
+
try {
OutputStream fos = new BufferedOutputStream(System.out);
OMOutputImpl otpt = new OMOutputImpl(fos, false);
@@ -61,6 +69,4 @@
fail(e.getMessage());
}
}
-
-
}
Modified: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/LoggingHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/LoggingHandler.java?rev=231418&r1=231417&r2=231418&view=diff
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/LoggingHandler.java (original)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/jaxws/test/org/apache/axis/jaxrpc/handler/soap/LoggingHandler.java Thu Aug 11 02:18:19 2005
@@ -61,9 +61,9 @@
context.getProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
if (outboundProperty.booleanValue()) {
- out.println("\nOutbound message:");
+ out.println("\nLOG MESSAGE:::Outbound message:");
} else {
- out.println("\nInbound message:");
+ out.println("\nLOG MESSAGE:::Inbound message:");
}
SOAPMessage message = context.getMessage();