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 sc...@apache.org on 2006/12/05 19:28:57 UTC
svn commit: r482732 [1/2] - in /webservices/axis2/trunk/java/modules/jaxws:
src/org/apache/axis2/jaxws/client/proxy/
src/org/apache/axis2/jaxws/description/
src/org/apache/axis2/jaxws/description/impl/
src/org/apache/axis2/jaxws/marshaller/ src/org/apa...
Author: scheu
Date: Tue Dec 5 10:28:55 2006
New Revision: 482732
URL: http://svn.apache.org/viewvc?view=rev&rev=482732
Log:
AXIS2-1825
Contributor: Mike Rheinheimer
Make the Marshaller stateless. 6 JAX-WS
tests currently fail with this change...these are disabled.
Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/ProxyAsyncListener.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/OperationDescription.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/MethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitWrappedMethodMarshallerImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/RPCLitMethodMarshallerImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyTests.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/SOAP12ProxyTests.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddressBookTests.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java Tue Dec 5 10:28:55 2006
@@ -90,9 +90,7 @@
//Reference to ServiceDelegate instance that was used to create the Proxy
protected ServiceDescription serviceDesc = null;
- protected OperationDescription operationDesc = null;
- protected MethodMarshaller methodMarshaller = null;
- private Class seiClazz = null;
+ private Class seiClazz = null;
private Method method = null;
public JAXWSProxyHandler(ServiceDelegate delegate, Class seiClazz, EndpointDescription epDesc) {
@@ -140,8 +138,8 @@
}
}
else {
- operationDesc = endpointDesc.getEndpointInterfaceDescription().getOperation(method);
- if(isMethodExcluded()){
+ OperationDescription operationDesc = endpointDesc.getEndpointInterfaceDescription().getOperation(method);
+ if(isMethodExcluded(operationDesc)){
throw ExceptionFactory.makeWebServiceException("Invalid Method Call, Method "+method.getName() + " has been excluded using @webMethod annotation");
}
return InvokeSEIMethod(method, args);
@@ -158,7 +156,10 @@
log.debug("Attempting to Invoke SEI Method "+ method.getName());
}
- initialize();
+ //initialize();
+
+ OperationDescription operationDesc = endpointDesc.getEndpointInterfaceDescription().getOperation(method);
+
InvocationContext requestIC = InvocationContextFactory.createInvocationContext(null);
MessageContext requestContext = createRequest(method, args);
//Enable MTOM on the Message if the property was
@@ -207,7 +208,7 @@
if(asyncHandler == null){
throw ExceptionFactory.makeWebServiceException("AynchHandler null for Async callback, Invalid AsyncHandler callback Object");
}
- AsyncResponse listener = createProxyListener(args);
+ AsyncResponse listener = createProxyListener(args, operationDesc);
requestIC.setAsyncResponseListener(listener);
requestIC.setExecutor(serviceDelegate.getExecutor());
@@ -227,7 +228,7 @@
if(log.isDebugEnabled()){
log.debug("Async Polling");
}
- AsyncResponse listener = createProxyListener(args);
+ AsyncResponse listener = createProxyListener(args, operationDesc);
requestIC.setAsyncResponseListener(listener);
requestIC.setExecutor(serviceDelegate.getExecutor());
@@ -252,14 +253,14 @@
}
MessageContext responseContext = responseIC.getResponseMessageContext();
- Object responseObj = createResponse(method, args, responseContext);
+ Object responseObj = createResponse(method, args, responseContext, operationDesc);
return responseObj;
}
return null;
}
- private AsyncResponse createProxyListener(Object[] args){
- ProxyAsyncListener listener = new ProxyAsyncListener();
+ private AsyncResponse createProxyListener(Object[] args, OperationDescription operationDesc){
+ ProxyAsyncListener listener = new ProxyAsyncListener(operationDesc);
listener.setHandler(this);
listener.setInputArgs(args);
return listener;
@@ -280,7 +281,10 @@
if (log.isDebugEnabled()) {
log.debug("Converting objects to Message");
}
- Message message = methodMarshaller.marshalRequest(args);
+
+ OperationDescription operationDesc = endpointDesc.getEndpointInterfaceDescription().getOperation(method);
+
+ Message message = operationDesc.getMarshaller(true).marshalRequest(args, operationDesc);
if (log.isDebugEnabled()) {
log.debug("Objects converted to Message");
@@ -300,13 +304,14 @@
* @param responseContext
* @return
*/
- protected Object createResponse(Method method, Object[] args, MessageContext responseContext)throws Throwable{
+ protected Object createResponse(Method method, Object[] args, MessageContext responseContext, OperationDescription operationDesc)throws Throwable{
Message responseMsg = responseContext.getMessage();
+
if (log.isDebugEnabled()) {
log.debug("Converting Message to Response Object");
}
if (responseMsg.isFault()) {
- Object object = methodMarshaller.demarshalFaultResponse(responseMsg);
+ Object object = operationDesc.getMarshaller(false).demarshalFaultResponse(responseMsg, operationDesc);
if (log.isDebugEnabled()) {
log.debug("Message Converted to response Throwable. Throwing back to client.");
}
@@ -316,7 +321,7 @@
// use the factory, it'll throw the right thing:
throw ExceptionFactory.makeWebServiceException(responseContext.getLocalException());
}
- Object object = methodMarshaller.demarshalResponse(responseMsg, args);
+ Object object = operationDesc.getMarshaller(false).demarshalResponse(responseMsg, args, operationDesc);
if (log.isDebugEnabled()) {
log.debug("Message Converted to response Object");
}
@@ -335,12 +340,13 @@
}
return false;
}
-
+
+
private boolean isPublic(Method method){
return Modifier.isPublic(method.getModifiers());
}
- private boolean isMethodExcluded(){
+ private boolean isMethodExcluded(OperationDescription operationDesc){
return operationDesc.isExcluded();
}
@@ -350,65 +356,5 @@
public void setSeiClazz(Class seiClazz) {
this.seiClazz = seiClazz;
- }
-
- private void initialize(){
- SOAPBinding.Style style = operationDesc.getSoapBindingStyle();
- Protocol p = null;
- try {
- EndpointDescription epDesc = getEndpointDescription();
- String bindingID = epDesc.getClientBindingID();
- p = Protocol.getProtocolForBinding(bindingID);
- } catch (MessageException e) {
- e.printStackTrace();
- }
-
- MethodMarshallerFactory cf = (MethodMarshallerFactory) FactoryRegistry.getFactory(MethodMarshallerFactory.class);
- if(style == SOAPBinding.Style.DOCUMENT){
- methodMarshaller = createDocLitMethodMarshaller(cf, p);
- }
- if(style == SOAPBinding.Style.RPC){
- methodMarshaller = createRPCLitMethodMarshaller(cf, p);
- }
- }
-
- private MethodMarshaller createDocLitMethodMarshaller(MethodMarshallerFactory cf, Protocol p){
- ParameterStyle parameterStyle = null;
- if(isDocLitBare()){
- parameterStyle = SOAPBinding.ParameterStyle.BARE;
- }
- if(isDocLitWrapped()){
- parameterStyle = SOAPBinding.ParameterStyle.WRAPPED;
- }
-
- return cf.createMethodMarshaller(SOAPBinding.Style.DOCUMENT, parameterStyle,
- serviceDesc, endpointDesc, operationDesc, p, true);
- }
-
- private MethodMarshaller createRPCLitMethodMarshaller(MethodMarshallerFactory cf, Protocol p){
- return cf.createMethodMarshaller(SOAPBinding.Style.RPC, SOAPBinding.ParameterStyle.WRAPPED,
- serviceDesc, endpointDesc, operationDesc, p, true);
- }
-
- protected boolean isDocLitBare(){
- SOAPBinding.ParameterStyle methodParamStyle = operationDesc.getSoapBindingParameterStyle();
- if(methodParamStyle!=null){
- return methodParamStyle == SOAPBinding.ParameterStyle.BARE;
- }
- else{
- SOAPBinding.ParameterStyle SEIParamStyle = endpointDesc.getEndpointInterfaceDescription().getSoapBindingParameterStyle();
- return SEIParamStyle == SOAPBinding.ParameterStyle.BARE;
- }
- }
-
- protected boolean isDocLitWrapped(){
- SOAPBinding.ParameterStyle methodParamStyle = operationDesc.getSoapBindingParameterStyle();
- if(methodParamStyle!=null){
- return methodParamStyle == SOAPBinding.ParameterStyle.WRAPPED;
- }
- else{
- SOAPBinding.ParameterStyle SEIParamStyle = endpointDesc.getEndpointInterfaceDescription().getSoapBindingParameterStyle();
- return SEIParamStyle == SOAPBinding.ParameterStyle.WRAPPED;
- }
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/ProxyAsyncListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/ProxyAsyncListener.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/ProxyAsyncListener.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/ProxyAsyncListener.java Tue Dec 5 10:28:55 2006
@@ -19,6 +19,7 @@
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.client.async.AsyncResponse;
import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.description.OperationDescription;
/**
@@ -31,8 +32,11 @@
JAXWSProxyHandler handler = null;
Object[] inputArgs = null;
- public ProxyAsyncListener() {
+ OperationDescription operationDesc = null;
+
+ public ProxyAsyncListener(OperationDescription opDesc) {
super();
+ operationDesc = opDesc;
}
public JAXWSProxyHandler getHandler() {
@@ -52,7 +56,7 @@
//I will delegate the request to create respose to proxyHandler
//since it has all the logic written to create response for Sync
//and oneWay.
- return handler.createResponse(null,inputArgs, mc);
+ return handler.createResponse(null,inputArgs, mc, operationDesc);
}
catch (Throwable e) {
throw ExceptionFactory.makeWebServiceException(e);
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/OperationDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/OperationDescription.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/OperationDescription.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/OperationDescription.java Tue Dec 5 10:28:55 2006
@@ -19,9 +19,12 @@
import java.lang.reflect.Method;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.jws.soap.SOAPBinding.Style;
import javax.xml.namespace.QName;
import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
/**
* An OperationDescripton corresponds to a method on an SEI. That SEI could be explicit
* (i.e. WebService.endpointInterface=sei.class) or implicit (i.e. public methods on the service implementation
@@ -107,6 +110,8 @@
public String getResponseWrapperLocalName();
public String[] getParamNames();
+
+ public MethodMarshaller getMarshaller(boolean isClient);
// TODO: These should return Enums defined on this interface, not from the Annotation
public javax.jws.soap.SOAPBinding.ParameterStyle getSoapBindingParameterStyle();
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Tue Dec 5 10:28:55 2006
@@ -32,6 +32,7 @@
import javax.jws.WebResult;
import javax.jws.WebParam.Mode;
import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.xml.namespace.QName;
import javax.xml.ws.AsyncHandler;
import javax.xml.ws.RequestWrapper;
@@ -55,6 +56,9 @@
import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
import org.apache.axis2.jaxws.description.builder.OneWayAnnot;
import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
+import org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory;
+import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.apache.axis2.wsdl.WSDLConstants;
/**
@@ -80,6 +84,10 @@
private MethodDescriptionComposite methodComposite;
private ParameterDescription[] parameterDescriptions;
private FaultDescription[] faultDescriptions;
+
+ // cache the marshallers in use for this operation:
+ private MethodMarshaller clientMarshaller = null;
+ private MethodMarshaller serverMarshaller = null;
// ===========================================
// ANNOTATION related information
@@ -794,6 +802,74 @@
// REVIEW: WSDL/Anno merge
return getAnnoWebParamNames();
}
+
+ public MethodMarshaller getMarshaller(boolean isClient) {
+
+ MethodMarshaller marshaller = null;
+ if (isClient) {
+ if (clientMarshaller != null) {
+ marshaller = clientMarshaller;
+ } else {
+ if (this.getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT) {
+ clientMarshaller = createDocLitMethodMarshaller(isClient);
+ } else if (this.getSoapBindingStyle() == SOAPBinding.Style.RPC) {
+ clientMarshaller = createRPCLitMethodMarshaller(isClient);
+ }
+ marshaller = clientMarshaller;
+ }
+ } else { // SERVER
+ if (serverMarshaller != null) {
+ marshaller = serverMarshaller;
+ } else {
+ if (this.getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT) {
+ serverMarshaller = createDocLitMethodMarshaller(isClient);
+ } else if (this.getSoapBindingStyle() == SOAPBinding.Style.RPC) {
+ serverMarshaller = createRPCLitMethodMarshaller(isClient);
+ }
+ marshaller = serverMarshaller;
+ }
+ }
+ return marshaller;
+ }
+
+ private MethodMarshaller createDocLitMethodMarshaller(boolean isClient){
+ ParameterStyle parameterStyle = null;
+ if(isDocLitBare()){
+ parameterStyle = SOAPBinding.ParameterStyle.BARE;
+ }
+ if(isDocLitWrapped()){
+ parameterStyle = SOAPBinding.ParameterStyle.WRAPPED;
+ }
+ return MethodMarshallerFactory.createMethodMarshaller(SOAPBinding.Style.DOCUMENT, parameterStyle, isClient);
+ }
+
+ private MethodMarshaller createRPCLitMethodMarshaller(boolean isClient){
+ return MethodMarshallerFactory.createMethodMarshaller(SOAPBinding.Style.RPC, SOAPBinding.ParameterStyle.WRAPPED, isClient);
+ }
+
+ protected boolean isDocLitBare(){
+ SOAPBinding.ParameterStyle methodParamStyle = this.getSoapBindingParameterStyle();
+ if(methodParamStyle!=null){
+ return methodParamStyle == SOAPBinding.ParameterStyle.BARE;
+ }
+ else{
+ SOAPBinding.ParameterStyle SEIParamStyle = this.getEndpointInterfaceDescription().getSoapBindingParameterStyle();
+ return SEIParamStyle == SOAPBinding.ParameterStyle.BARE;
+ }
+ }
+
+ protected boolean isDocLitWrapped(){
+ SOAPBinding.ParameterStyle methodParamStyle = this.getSoapBindingParameterStyle();
+ if(methodParamStyle!=null){
+ return methodParamStyle == SOAPBinding.ParameterStyle.WRAPPED;
+ }
+ else{
+ SOAPBinding.ParameterStyle SEIParamStyle = this.getEndpointInterfaceDescription().getSoapBindingParameterStyle();
+ return SEIParamStyle == SOAPBinding.ParameterStyle.WRAPPED;
+ }
+ }
+
+
public String[] getAnnoWebParamNames() {
if (webParamNames == null) {
ArrayList<String> buildNames = new ArrayList<String>();
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/MethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/MethodMarshaller.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/MethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/MethodMarshaller.java Tue Dec 5 10:28:55 2006
@@ -20,8 +20,10 @@
import javax.xml.ws.WebServiceException;
+import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.message.Message;
+
/**
* This class marshals and unmarshals method invocations.
*
@@ -55,7 +57,7 @@
* @param signatureArgs
* @return Message
*/
- public Message marshalRequest(Object[] signatureArgs) throws WebServiceException;
+ public Message marshalRequest(Object[] signatureArgs, OperationDescription opDesc) throws WebServiceException;
/**
* This method converts the SIGNATURE_ARGS and RETURN object into a Message.
@@ -65,7 +67,7 @@
* @param signatureArgs
* @return Message
*/
- public Message marshalResponse(Object returnObject, Object[] signatureArgs)throws WebServiceException;
+ public Message marshalResponse(Object returnObject, Object[] signatureArgs, OperationDescription opDesc)throws WebServiceException;
/**
@@ -75,7 +77,7 @@
* @param message
* @return signature args
*/
- public Object[] demarshalRequest(Message message)throws WebServiceException;
+ public Object[] demarshalRequest(Message message, OperationDescription opDesc)throws WebServiceException;
/**
* This method gets the objects from the Message and sets them onto the SIGNATURE_ARGS
@@ -86,7 +88,7 @@
* @param signatureAgs (same array of args that were used for marshalRequest. The out/inout holders are populated with new values)
* @return returnObject
*/
- public Object demarshalResponse(Message message, Object[] signatureArgs) throws WebServiceException;
+ public Object demarshalResponse(Message message, Object[] signatureArgs, OperationDescription opDesc) throws WebServiceException;
/**
* This method converts a Message (containing a fault) into a JAX-WS Service or WebServiceException.
@@ -95,7 +97,7 @@
* @param Message
* @return Throwable
*/
- public Throwable demarshalFaultResponse(Message message) throws WebServiceException;
+ public Throwable demarshalFaultResponse(Message message, OperationDescription opDesc) throws WebServiceException;
/**
* This method creates a Message from a Throwbale input parameter.
@@ -103,7 +105,7 @@
* @param jaxbObject
* @return
*/
- public Message marshalFaultResponse(Throwable throwable) throws WebServiceException;
+ public Message marshalFaultResponse(Throwable throwable, OperationDescription opDesc) throws WebServiceException;
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java Tue Dec 5 10:28:55 2006
@@ -63,28 +63,24 @@
*/
public static MethodMarshaller createMethodMarshaller(SOAPBinding.Style style,
SOAPBinding.ParameterStyle paramStyle,
- ServiceDescription serviceDesc,
- EndpointDescription endpointDesc,
- OperationDescription operationDesc,
- Protocol protocol,
boolean isClient){ // This flag is for testing only !
if (style == SOAPBinding.Style.RPC) {
if (ALT_RPCLIT_CLIENT && isClient || ALT_RPCLIT_SERVER && !isClient ) {
- return new RPCLitMethodMarshaller(serviceDesc, endpointDesc, operationDesc, protocol);
+ return new RPCLitMethodMarshaller();
} else {
- return new RPCLitMethodMarshallerImpl(serviceDesc, endpointDesc, operationDesc, protocol);
+ return new RPCLitMethodMarshallerImpl();
}
} else if (paramStyle == SOAPBinding.ParameterStyle.WRAPPED){
if (ALT_DOCLIT_WRAPPED_CLIENT && isClient || ALT_DOCLIT_WRAPPED_SERVER && !isClient) {
- return new DocLitWrappedMethodMarshaller(serviceDesc, endpointDesc, operationDesc, protocol);
+ return new DocLitWrappedMethodMarshaller();
} else {
- return new DocLitWrappedMethodMarshallerImpl(serviceDesc, endpointDesc, operationDesc, protocol);
+ return new DocLitWrappedMethodMarshallerImpl();
}
} else if (paramStyle == SOAPBinding.ParameterStyle.BARE){
if (ALT_DOCLIT_BARE_CLIENT && isClient || ALT_DOCLIT_BARE_SERVER && !isClient) {
- return new DocLitBareMethodMarshaller(serviceDesc, endpointDesc, operationDesc, protocol);
+ return new DocLitBareMethodMarshaller();
} else {
- return new DocLitBareMethodMarshallerImpl(serviceDesc, endpointDesc, operationDesc, protocol);
+ return new DocLitBareMethodMarshallerImpl();
}
}
return null;
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitBareMethodMarshallerImpl.java Tue Dec 5 10:28:55 2006
@@ -27,15 +27,12 @@
import javax.xml.ws.WebServiceException;
import org.apache.axis2.jaxws.ExceptionFactory;
-import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.ParameterDescription;
-import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.marshaller.MethodParameter;
import org.apache.axis2.jaxws.message.Message;
import org.apache.axis2.jaxws.message.MessageException;
-import org.apache.axis2.jaxws.message.Protocol;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -49,19 +46,18 @@
* @param endpointDesc
* @param operationDesc
*/
- public DocLitBareMethodMarshallerImpl(ServiceDescription serviceDesc,
- EndpointDescription endpointDesc, OperationDescription operationDesc, Protocol protocol) {
- super(serviceDesc, endpointDesc, operationDesc, protocol);
+ public DocLitBareMethodMarshallerImpl() {
+ super();
}
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.convertor.impl.MessageConvertorImpl#toJAXBObject(org.apache.axis2.jaxws.message.Message)
*/
@Override
- public Object demarshalResponse(Message message, Object[] inputArgs) throws WebServiceException {
+ public Object demarshalResponse(Message message, Object[] inputArgs, OperationDescription operationDesc) throws WebServiceException {
try {
- Class returnType = getReturnType();
+ Class returnType = getReturnType(operationDesc);
ArrayList<Object> holderArgs = null;
ArrayList<MethodParameter> mps = null;
@@ -69,7 +65,7 @@
holderArgs = new ArrayList<Object>();
mps = new ArrayList<MethodParameter>();
- mps = extractHolderParameters(inputArgs);
+ mps = extractHolderParameters(inputArgs, operationDesc);
holdermps = new ArrayList<MethodParameter>(mps);
@@ -91,11 +87,11 @@
}
else if(holdermps.size() == 0 && !returnType.getName().equals("void")){
// No holders but a return type example --> public ReturnType someMethod()
- bo = createBusinessObject(createContextPackageSet(), message);
+ bo = createBusinessObject(createContextPackageSet(operationDesc), message);
}
else if(holdermps.size()>0 && returnType.getName().equals("void")){
// Holders found and no return type example --> public void someMethod(Holder<AHolder>)
- assignHolderValues(holdermps, holderArgs, message);
+ assignHolderValues(holdermps, holderArgs, message, operationDesc);
}
else{
// Holders found and return type example --> public ReturnType someMethod(Holder<AHolder>)
@@ -103,8 +99,8 @@
// type and input param as holder.
// WSGen and WsImport Generate Holders with return type as one of the Holder JAXBObject
// property, if wsdl schema forces a holder and a return type.
- assignHolderValues(holdermps, holderArgs, message);
- bo = createBusinessObject(createContextPackageSet(), message);
+ assignHolderValues(holdermps, holderArgs, message, operationDesc);
+ bo = createBusinessObject(createContextPackageSet(operationDesc), message);
}
if (bo instanceof JAXBElement) {
@@ -118,7 +114,7 @@
}
}
- private ArrayList<MethodParameter> createParameterForSEIMethod(Message message)throws IllegalAccessException, InstantiationException, ClassNotFoundException, MessageException, XMLStreamException, JAXBException{
+ private ArrayList<MethodParameter> createParameterForSEIMethod(Message message, OperationDescription operationDesc)throws IllegalAccessException, InstantiationException, ClassNotFoundException, MessageException, XMLStreamException, JAXBException{
ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
if(message == null){
return null;
@@ -135,7 +131,7 @@
Object bo = null;
// Create a set of context packages that will be needed to demarshal
// the jaxb object. For now just consider the actualType
- Set<String> contextPackages = createContextPackageSet();
+ Set<String> contextPackages = createContextPackageSet(operationDesc);
// Create the business object
if(isHeader){
@@ -161,7 +157,7 @@
}
paramValues.add(arg);
}
- mps = createParameters(paramDescs, paramValues);
+ mps = createParameters(paramDescs, paramValues, operationDesc);
return mps;
}
@@ -170,27 +166,26 @@
* @see org.apache.axis2.jaxws.convertor.impl.MessageConvertorImpl#toObjects(org.apache.axis2.jaxws.message.Message)
*/
@Override
- public Object[] demarshalRequest(Message message) throws WebServiceException {
+ public Object[] demarshalRequest(Message message, OperationDescription operationDesc) throws WebServiceException {
try {
if (log.isDebugEnabled()) {
log.debug("Attempting to demarshal a document/literal request.");
}
- ArrayList<Class> inputParams = getInputTypes();
+ ArrayList<Class> inputParams = getInputTypes(operationDesc);
// If the method has no input parameters, then we're done.
if(inputParams.size() == 0){
return null;
}
- ArrayList<MethodParameter> mps = createParameterForSEIMethod(message);
+ ArrayList<MethodParameter> mps = createParameterForSEIMethod(message, operationDesc);
ArrayList<Object> objectList = new ArrayList<Object>();
if (log.isDebugEnabled()) {
log.debug("reading input method parameters");
}
for(MethodParameter mp:mps){
- ParameterDescription pd = mp.getParameterDescription();
objectList.add(mp.getValue());
}
return objectList.toArray();
@@ -205,19 +200,19 @@
* @see org.apache.axis2.jaxws.convertor.impl.MessageConvertorImpl#fromJAXBObject(java.lang.Object)
*/
@Override
- public Message marshalResponse(Object returnObject, Object[] holderObjects) throws WebServiceException {
+ public Message marshalResponse(Object returnObject, Object[] holderObjects, OperationDescription operationDesc) throws WebServiceException {
try {
// Response wrapper is basically the return type. So the return object
// is a JAXB object. If there is a holder objects then that is the
// responsewrapper.
- Class wrapperClazz = getReturnType();
+ Class wrapperClazz = getReturnType(operationDesc);
String wrapperClazzName = operationDesc.getResultName();
if (wrapperClazzName == null || wrapperClazzName.trim().length() == 0) {
wrapperClazzName = wrapperClazz.getName();
}
String wrapperTNS = operationDesc.getResultTargetNamespace();
- ArrayList<MethodParameter> holdersNreturnObject = extractHolderParameters(holderObjects);
+ ArrayList<MethodParameter> holdersNreturnObject = extractHolderParameters(holderObjects, operationDesc);
Message message = null;
@@ -225,17 +220,17 @@
if(holdersNreturnObject.size() == 0 && wrapperClazz.getName().equals("void")){
//No holders and return type void example --> public void someMethod() I will return empty ResponseWrapper in message body for this case.
//doNothing as there is nothing to wrap
- message = createEmptyMessage();
+ message = createEmptyMessage(operationDesc);
}
else if(holdersNreturnObject.size() == 0 && !wrapperClazz.getName().equals("void")){
//No holders but a return type example --> public ReturnType someMethod()
MethodParameter mp = new MethodParameter(wrapperClazzName,wrapperTNS, wrapperClazz, returnObject);
holdersNreturnObject.add(mp);
- message = createMessage(holdersNreturnObject);
+ message = createMessage(holdersNreturnObject, operationDesc);
}
else if(holdersNreturnObject.size()>0 && wrapperClazz.getName().equals("void")){
//Holders found and no return type example --> public void someMethod(Holder<AHolder>)
- message = createMessage(holdersNreturnObject);
+ message = createMessage(holdersNreturnObject, operationDesc);
}
else{
//Holders found and return type example --> public ReturnType someMethod(Holder<AHolder>)
@@ -243,7 +238,7 @@
//WSGen and WsImport Generate Holders with return type as one of the Holder JAXBObject property, if wsdl schema forces a holder and a return type.
MethodParameter mp = new MethodParameter(wrapperClazzName,wrapperTNS, wrapperClazz, returnObject);
holdersNreturnObject.add(mp);
- message = createMessage(holdersNreturnObject);
+ message = createMessage(holdersNreturnObject, operationDesc);
}
@@ -259,13 +254,13 @@
* @see org.apache.axis2.jaxws.convertor.impl.MessageConvertorImpl#fromObjects(java.lang.Object[])
*/
@Override
- public Message marshalRequest(Object[] objects) throws WebServiceException {
+ public Message marshalRequest(Object[] objects, OperationDescription operationDesc) throws WebServiceException {
try {
if (log.isDebugEnabled()) {
log.debug("Attempting to marshal document/literal request");
}
- ArrayList<MethodParameter> mps = createRequestWrapperParameters(objects);
+ ArrayList<MethodParameter> mps = createRequestWrapperParameters(objects, operationDesc);
//WSDL wrapped and running wsImport with non-wrap binding or wsdl un-Wrapped and running wsImport with no binding, EITHER WAYS
//there can be only 0 or 1 Body parts as per WS-I.
@@ -289,11 +284,11 @@
Message message = null;
if (mps.size() !=0) {
- message = createMessage(mps);
+ message = createMessage(mps, operationDesc);
}
//no message part case or no input parameter
if (mps.size() == 0) {
- message = createEmptyMessage();
+ message = createEmptyMessage(operationDesc);
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitWrappedMethodMarshallerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitWrappedMethodMarshallerImpl.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitWrappedMethodMarshallerImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/DocLitWrappedMethodMarshallerImpl.java Tue Dec 5 10:28:55 2006
@@ -22,18 +22,14 @@
import java.util.Map;
import java.util.WeakHashMap;
-import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.ws.WebServiceException;
import org.apache.axis2.jaxws.ExceptionFactory;
-import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.OperationDescriptionJava;
import org.apache.axis2.jaxws.description.ParameterDescription;
-import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.marshaller.MethodParameter;
import org.apache.axis2.jaxws.message.Block;
@@ -58,37 +54,26 @@
* @param endpointDesc
* @param operationDesc
*/
- public DocLitWrappedMethodMarshallerImpl(ServiceDescription serviceDesc,
- EndpointDescription endpointDesc, OperationDescription operationDesc, Protocol protocol) {
- super(serviceDesc, endpointDesc, operationDesc, protocol);
+ public DocLitWrappedMethodMarshallerImpl() {
+ super();
}
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.convertor.impl.MessageConvertorImpl#toJAXBObject(org.apache.axis2.jaxws.message.Message)
*/
@Override
- public Object demarshalResponse(Message message, Object[] inputArgs) throws WebServiceException {
+ public Object demarshalResponse(Message message, Object[] inputArgs, OperationDescription operationDesc) throws WebServiceException {
try {
if (log.isDebugEnabled()) {
log.debug("Attempting to demarshal a document/literal wrapped response");
}
- String className = operationDesc.getResponseWrapperClassName();
Object businessObject = null;
-
- //TODO Move this to Operation Description.
- Class wrapperClazz = null;
- if (className == null || (className != null && className.length() == 0)) {
- wrapperClazz = getReturnType();
- }
- else {
- wrapperClazz = loadClass(className);
- }
String resultName = operationDesc.getResultName();
- businessObject = createBusinessObject(createContextPackageSet(), message);
- assignHolderValues(businessObject, inputArgs, false);
+ businessObject = createBusinessObject(createContextPackageSet(operationDesc), message);
+ assignHolderValues(businessObject, inputArgs, false, operationDesc);
// REVIEW: Is the the appropriate logic, to be checking for the existence of the annotation
// as the decision point for getting into the property logic? Note that even if the annotation
@@ -112,20 +97,17 @@
* @see org.apache.axis2.jaxws.convertor.impl.MessageConvertorImpl#toObjects(org.apache.axis2.jaxws.message.Message)
*/
@Override
- public Object[] demarshalRequest(Message message) throws WebServiceException {
+ public Object[] demarshalRequest(Message message, OperationDescription operationDesc) throws WebServiceException {
try {
- String className = operationDesc.getRequestWrapperClassName();
-
ArrayList<MethodParameter> mps;
- Class requestWrapperClazz = loadClass(className);
- Object jaxbObject = createBusinessObject(createContextPackageSet(), message);
+ Object jaxbObject = createBusinessObject(createContextPackageSet(operationDesc), message);
if (log.isDebugEnabled()) {
log.debug("reading input method parameters");
}
- mps = createParameterForSEIMethod(jaxbObject);
+ mps = createParameterForSEIMethod(jaxbObject, operationDesc);
if (log.isDebugEnabled()) {
@@ -153,7 +135,7 @@
* @see org.apache.axis2.jaxws.convertor.impl.MessageConvertorImpl#fromJAXBObject(java.lang.Object)
*/
@Override
- public Message marshalResponse(Object returnObject, Object[] holderObjects) throws WebServiceException {
+ public Message marshalResponse(Object returnObject, Object[] holderObjects, OperationDescription operationDesc) throws WebServiceException {
try {
// Get the necessary information from the OperationDesc
@@ -161,14 +143,13 @@
String wrapperClazzName = operationDesc.getResponseWrapperClassName();
String wrapperLocalName = operationDesc.getResponseWrapperLocalName();
String wrapperTNS = operationDesc.getResponseWrapperTargetNamespace();
- String webResult = operationDesc.getResultName();
//TODO Move this to Operation Description.
if (wrapperClazzName == null || (wrapperClazzName != null && wrapperClazzName.length() == 0)) {
if (log.isDebugEnabled()) {
log.debug("No ResponseWrapper annotation found, using return type of method as response object");
}
- wrapperClazz = getReturnType();
+ wrapperClazz = getReturnType(operationDesc);
wrapperClazzName = wrapperClazz.getName();
}
else {
@@ -197,11 +178,11 @@
}
if(objectList.size() == 0 && !wrapperClazz.getName().equals("void")){
//No holders but a return type example --> public ReturnType someMethod()
- mps = createResponseWrapperParameter(returnObject);
+ mps = createResponseWrapperParameter(returnObject, operationDesc);
}
else{
//Holders found and return type or no return type. example --> public ReturnType someMethod(Holder<String>) or public void someMethod(Holder<String>)
- mps = createResponseWrapperParameter(returnObject, objectList.toArray());
+ mps = createResponseWrapperParameter(returnObject, objectList.toArray(), operationDesc);
}
Object wrapper = wrap(wrapperClazz, mps);
@@ -212,7 +193,7 @@
wrapper = XMLRootElementUtil.getElementEnabledObject(wrapperTNS,
wrapperLocalName, wrapperClazz, wrapper);
}
- Message message = createMessage(wrapper);
+ Message message = createMessage(wrapper, operationDesc);
return message;
@@ -227,7 +208,7 @@
* @see org.apache.axis2.jaxws.convertor.impl.MessageConvertorImpl#fromObjects(java.lang.Object[])
*/
@Override
- public Message marshalRequest(Object[] objects) throws WebServiceException {
+ public Message marshalRequest(Object[] objects, OperationDescription operationDesc) throws WebServiceException {
try {
String className = operationDesc.getRequestWrapperClassName();
String wrapperLocalName = operationDesc.getRequestWrapperLocalName();
@@ -240,7 +221,7 @@
//Get Name Value pair for input parameter Objects, skip AsyncHandler and identify Holders.
Object jaxbObject = null;
- ArrayList<MethodParameter> methodParameters = createRequestWrapperParameters(objects);
+ ArrayList<MethodParameter> methodParameters = createRequestWrapperParameters(objects, operationDesc);
jaxbObject = wrap(wrapperClazz, methodParameters);
@@ -254,7 +235,7 @@
wrapperClazz,
jaxbObject);
}
- Message message = createMessage(jaxbObject);
+ Message message = createMessage(jaxbObject, operationDesc);
return message;
@@ -282,14 +263,19 @@
* @throws MessageException
* @throws XMLStreamException
*/
- private Message createMessage(Object jaxbElement)throws JAXBException, MessageException, XMLStreamException{
+ private Message createMessage(Object jaxbElement, OperationDescription operationDesc)throws JAXBException, MessageException, XMLStreamException{
Block bodyBlock = null;
- // Get the object that is the type
- Object jaxbType = (jaxbElement instanceof JAXBElement) ? ((JAXBElement) jaxbElement).getValue() : jaxbElement;
-
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(operationDesc.getEndpointInterfaceDescription().getEndpointDescription().getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Create the context
- JAXBBlockContext ctx = new JAXBBlockContext(createContextPackageSet());
+ JAXBBlockContext ctx = new JAXBBlockContext(createContextPackageSet(operationDesc));
bodyBlock = createJAXBBlock(jaxbElement, ctx);
if (log.isDebugEnabled()) {
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java Tue Dec 5 10:28:55 2006
@@ -74,46 +74,38 @@
public abstract class MethodMarshallerImpl implements MethodMarshaller {
private static QName SOAPENV_QNAME = new QName("http://schemas.xmlsoap.org/soap/envelope/", "Envelope");
private static Log log = LogFactory.getLog(MethodMarshallerImpl.class);
- protected ServiceDescription serviceDesc = null;
- protected EndpointDescription endpointDesc = null;
- protected OperationDescription operationDesc = null;
- protected Protocol protocol = Protocol.soap11;
-
- public MethodMarshallerImpl(ServiceDescription serviceDesc, EndpointDescription endpointDesc, OperationDescription operationDesc, Protocol protocol){
- this.serviceDesc = serviceDesc;
- this.endpointDesc = endpointDesc;
- this.operationDesc = operationDesc;
- this.protocol = protocol;
+
+ public MethodMarshallerImpl(){
}
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#demarshalResponse(org.apache.axis2.jaxws.message.Message, java.lang.Object[])
*/
- public abstract Object demarshalResponse(Message message, Object[] inputArgs) throws WebServiceException;
+ public abstract Object demarshalResponse(Message message, Object[] inputArgs, OperationDescription operationDesc) throws WebServiceException;
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#demarshalRequest(org.apache.axis2.jaxws.message.Message)
*/
- public abstract Object[] demarshalRequest(Message message) throws WebServiceException;
+ public abstract Object[] demarshalRequest(Message message, OperationDescription operationDesc) throws WebServiceException;
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#marshalResponse(java.lang.Object, java.lang.Object[])
*/
- public abstract Message marshalResponse(Object returnObject, Object[] holderObjects)throws WebServiceException;
+ public abstract Message marshalResponse(Object returnObject, Object[] holderObjects, OperationDescription operationDesc)throws WebServiceException;
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#marshalRequest(java.lang.Object[])
*/
- public abstract Message marshalRequest(Object[] object)throws WebServiceException;
+ public abstract Message marshalRequest(Object[] object, OperationDescription operationDesc)throws WebServiceException;
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#demarshalFaultResponse(org.apache.axis2.jaxws.message.Message)
*/
- public Throwable demarshalFaultResponse(Message message) throws WebServiceException {
+ public Throwable demarshalFaultResponse(Message message, OperationDescription operationDesc) throws WebServiceException {
Exception exception = null;
@@ -146,7 +138,7 @@
// Now demarshal the block to get a business object (faultbean)
// Capture the qname of the element, which will be used to find the JAX-WS Exception
- Object obj = createFaultBusinessObject(block);
+ Object obj = createFaultBusinessObject(block, operationDesc);
QName faultQName = null;
if (obj instanceof JAXBElement) {
faultQName = ((JAXBElement)obj).getName();
@@ -185,7 +177,7 @@
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#marshalFaultResponse(java.lang.Throwable)
*/
- public Message marshalFaultResponse(Throwable throwable) throws WebServiceException {
+ public Message marshalFaultResponse(Throwable throwable, OperationDescription operationDesc) throws WebServiceException {
try {
Throwable t = ClassUtils.getRootCause(throwable);
@@ -196,7 +188,7 @@
}
XMLFault xmlfault = null;
- Message message = createEmptyMessage();
+ Message message = createEmptyMessage(operationDesc);
// Get the FaultDescriptor matching this Exception.
// If FaultDescriptor is found, this is a JAX-B Service Exception.
@@ -207,7 +199,7 @@
// Service Exception. Create an XMLFault with the fault bean
Method getFaultInfo = t.getClass().getMethod("getFaultInfo", null);
Object faultBean = getFaultInfo.invoke(t, null);
- JAXBBlockContext context = createJAXBBlockContext(createContextPackageSet());
+ JAXBBlockContext context = createJAXBBlockContext(createContextPackageSet(operationDesc));
Block[] detailBlocks = new Block[1];
// Make sure to createJAXBBlock with an object that is
@@ -239,7 +231,7 @@
* and creates a name value pair.
* Also handles situation where ResponseWrapper is a holder.
*/
- protected ArrayList<MethodParameter> createResponseWrapperParameter(Object webResultValue) {
+ protected ArrayList<MethodParameter> createResponseWrapperParameter(Object webResultValue, OperationDescription operationDesc) {
ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
if(webResultValue == null){
return mps;
@@ -255,7 +247,7 @@
return mps;
}
- protected ArrayList<MethodParameter> createResponseWrapperParameter(Object webResultObject, Object[] holderObjects)
+ protected ArrayList<MethodParameter> createResponseWrapperParameter(Object webResultObject, Object[] holderObjects, OperationDescription operationDesc)
throws IllegalAccessException, InstantiationException, ClassNotFoundException {
ParameterDescription[] paramDescs = operationDesc.getParameterDescriptions();
ArrayList<ParameterDescription> pds = new ArrayList<ParameterDescription>();
@@ -283,7 +275,7 @@
paramValues.add(value);
index++;
}
- ArrayList<MethodParameter> mps = createParameters(pds.toArray(new ParameterDescription[0]), paramValues);
+ ArrayList<MethodParameter> mps = createParameters(pds.toArray(new ParameterDescription[0]), paramValues, operationDesc);
if(webResultObject!=null){
MethodParameter outputResult = new MethodParameter(operationDesc.getResultName(), operationDesc.getResultTargetNamespace(), webResultObject.getClass(), webResultObject);
@@ -296,7 +288,7 @@
/*
* Request Parameter are those where webParam Mode is IN or INOUT
*/
- protected ArrayList<MethodParameter> createRequestWrapperParameters(Object[] objects)throws IllegalAccessException, InstantiationException, ClassNotFoundException{
+ protected ArrayList<MethodParameter> createRequestWrapperParameters(Object[] objects, OperationDescription operationDesc)throws IllegalAccessException, InstantiationException, ClassNotFoundException{
ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
//Hand no input parameters
if(objects == null){
@@ -332,7 +324,7 @@
if (log.isDebugEnabled()) {
log.debug("Attempting to create Method Parameters");
}
- mps = createParameters(paramDescs, paramValues);
+ mps = createParameters(paramDescs, paramValues, operationDesc);
if (log.isDebugEnabled()) {
log.debug("Method Parameters created");
@@ -340,7 +332,7 @@
return mps;
}
- protected ArrayList<MethodParameter> createParameterForSEIMethod(Object jaxbObject) throws JAXBWrapperException, IllegalAccessException, InstantiationException, ClassNotFoundException{
+ protected ArrayList<MethodParameter> createParameterForSEIMethod(Object jaxbObject, OperationDescription operationDesc) throws JAXBWrapperException, IllegalAccessException, InstantiationException, ClassNotFoundException{
ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
if(jaxbObject == null){
return mps;
@@ -399,7 +391,7 @@
paramIndex++;
}
- return createParameters(paramDescs, objectList);
+ return createParameters(paramDescs, objectList, operationDesc);
}
@@ -408,7 +400,7 @@
* Extract Holder parameter from supplied parameters and add annotation data for these parameters.
*/
- protected ArrayList<MethodParameter> extractHolderParameters(Object jaxbObject) throws JAXBWrapperException, IllegalAccessException, InstantiationException, ClassNotFoundException{
+ protected ArrayList<MethodParameter> extractHolderParameters(Object jaxbObject, OperationDescription operationDesc) throws JAXBWrapperException, IllegalAccessException, InstantiationException, ClassNotFoundException{
ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
if(jaxbObject == null){
return mps;
@@ -456,7 +448,7 @@
paramValues.add(value);
index++;
}
- mps = createParameters(paramDescList.toArray(new ParameterDescription[0]), paramValues);
+ mps = createParameters(paramDescList.toArray(new ParameterDescription[0]), paramValues, operationDesc);
if (log.isDebugEnabled()) {
log.debug("Holder Method Parameters created");
@@ -468,7 +460,7 @@
/*
* Extract Holder parameter from supplied parameters and add annotation data for these parameters.
*/
- protected ArrayList<MethodParameter> extractHolderParameters(Object[] objects)throws IllegalAccessException, InstantiationException, ClassNotFoundException{
+ protected ArrayList<MethodParameter> extractHolderParameters(Object[] objects, OperationDescription operationDesc)throws IllegalAccessException, InstantiationException, ClassNotFoundException{
ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
//Hand no input parameters
if(objects == null){
@@ -506,7 +498,7 @@
if (log.isDebugEnabled()) {
log.debug("Attempting to create Holder Method Parameters");
}
- mps = createParameters(paramDescList.toArray(new ParameterDescription[0]), paramValues);
+ mps = createParameters(paramDescList.toArray(new ParameterDescription[0]), paramValues, operationDesc);
if (log.isDebugEnabled()) {
log.debug("Holder Method Parameters created");
@@ -516,13 +508,13 @@
}
protected ArrayList<MethodParameter> createParameters(
- ParameterDescription[] paramDescs, ArrayList<Object> paramValues){
+ ParameterDescription[] paramDescs, ArrayList<Object> paramValues, OperationDescription operationDesc){
ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
int index = 0;
for (Object paramValue : paramValues){
ParameterDescription paramDesc = paramDescs[index];
MethodParameter mp = null;
- if (!isParamAsyncHandler(paramDesc.getParameterName(), paramValue)){
+ if (!isParamAsyncHandler(paramDesc.getParameterName(), paramValue, operationDesc)){
mp = new MethodParameter(paramDesc, paramValue);
mps.add(mp);
}
@@ -532,7 +524,7 @@
}
- private ArrayList<MethodParameter> createMethodParameters(ParameterDescription[] paramDescs, ArrayList<Object> paramValues)
+ private ArrayList<MethodParameter> createMethodParameters(ParameterDescription[] paramDescs, ArrayList<Object> paramValues, OperationDescription operationDesc)
throws InstantiationException, ClassNotFoundException, IllegalAccessException {
ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
int index = 0;
@@ -544,7 +536,7 @@
MethodParameter mp = null;
// If call is Async call then lets filter AsyncHandler object name
// and value;
- if (!isParamAsyncHandler(paramDesc.getParameterName(), paramValue)) {
+ if (!isParamAsyncHandler(paramDesc.getParameterName(), paramValue, operationDesc)) {
if (paramType != null) {
if(paramValue == null && isHolderType){
Holder<Object> holder = createHolder(paramType, paramValue);
@@ -586,14 +578,13 @@
}
- protected ArrayList<Class> getInputTypes(){
+ protected ArrayList<Class> getInputTypes(OperationDescription operationDesc){
Method seiMethod = operationDesc.getSEIMethod();
ArrayList<Class> paramTypes = new ArrayList<Class>();
Type[] types = seiMethod.getGenericParameterTypes();
for(Type type:types){
if(ParameterizedType.class.isAssignableFrom(type.getClass())){
ParameterizedType pType = (ParameterizedType) type;
- Class rawClazz = (Class)pType.getRawType();
Class actualClazz = (Class)pType.getActualTypeArguments()[0];
paramTypes.add(actualClazz);
}
@@ -605,7 +596,7 @@
return paramTypes;
}
- protected boolean isAsync(){
+ protected boolean isAsync(OperationDescription operationDesc){
Method method = operationDesc.getSEIMethod();
if(method == null){
return false;
@@ -681,10 +672,10 @@
* @param isAsync
* @return
*/
- protected Class getReturnType(){
+ protected Class getReturnType(OperationDescription operationDesc){
Method seiMethod = operationDesc.getSEIMethod();
Class returnType = seiMethod.getReturnType();
- if(isAsync()){
+ if(isAsync(operationDesc)){
//pooling implementation
if(Response.class.isAssignableFrom(returnType)){
Type type = seiMethod.getGenericReturnType();
@@ -710,12 +701,12 @@
return returnType;
}
- private boolean isParamAsyncHandler(String name, Object value){
+ private boolean isParamAsyncHandler(String name, Object value, OperationDescription operationDesc){
if(value!=null && value instanceof AsyncHandler){
if(log.isDebugEnabled()){
log.debug("Parameter is AsycnHandler Object");
}
- if(!isAsync()){
+ if(!isAsync(operationDesc)){
if (log.isDebugEnabled()) {
log.debug("Method parameter type javax.xml.ws.AsyncHandler should only be used with Async Callback operations, method is Async if it returns a Future<?> and endswith letters 'Async'");
}
@@ -763,13 +754,21 @@
return null;
}
- protected Message createMessage(ArrayList<MethodParameter> mps) throws JAXBException, MessageException, XMLStreamException{
+ protected Message createMessage(ArrayList<MethodParameter> mps, OperationDescription operationDesc) throws JAXBException, MessageException, XMLStreamException{
Block block = null;
Object object = null;
String objectName = null;
String objectTNS = null;
Class objectType = null;
boolean isHeader =false;
+
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(operationDesc.getEndpointInterfaceDescription().getEndpointDescription().getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
Message m = mf.create(protocol);
@@ -796,7 +795,7 @@
}
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("DocLitProxyHandlerErr2"));
}
- JAXBBlockContext ctx = createJAXBBlockContext(createContextPackageSet());
+ JAXBBlockContext ctx = createJAXBBlockContext(createContextPackageSet(operationDesc));
if (log.isDebugEnabled()) {
log.debug("Attempting to create Block");
}
@@ -831,7 +830,16 @@
return mf.createFrom(element);
}
- protected Message createEmptyMessage() throws JAXBException, MessageException, XMLStreamException {
+ protected Message createEmptyMessage(OperationDescription operationDesc) throws JAXBException, MessageException, XMLStreamException {
+
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(operationDesc.getEndpointInterfaceDescription().getEndpointDescription().getBindingType());
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
Message m = mf.create(protocol);
return m;
@@ -877,9 +885,9 @@
* @throws MessageException
* @throws XMLStreamException
*/
- protected Object createFaultBusinessObject(Block block)
+ protected Object createFaultBusinessObject(Block block, OperationDescription operationDesc)
throws JAXBException, MessageException, XMLStreamException {
- JAXBBlockContext blockContext = new JAXBBlockContext(createContextPackageSet());
+ JAXBBlockContext blockContext = new JAXBBlockContext(createContextPackageSet(operationDesc));
// Get a JAXBBlockFactory instance.
JAXBBlockFactory factory = (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
@@ -887,19 +895,19 @@
return jaxbBlock.getBusinessObject(true);
}
- protected void assignHolderValues(ArrayList<MethodParameter> mps, ArrayList<Object> inputArgHolders, Message message)
+ protected void assignHolderValues(ArrayList<MethodParameter> mps, ArrayList<Object> inputArgHolders, Message message, OperationDescription operationDesc)
throws JAXBException, MessageException, XMLStreamException{
Object bo = null;
int index = 0;
for(MethodParameter mp:mps){
ParameterDescription pd = mp.getParameterDescription();
if (pd.isHeader() && pd.isHolderType()) {
- bo = createBOFromHeaderBlock(createContextPackageSet(),
+ bo = createBOFromHeaderBlock(createContextPackageSet(operationDesc),
message, pd.getTargetNamespace(), pd
.getParameterName());
}
else if(!pd.isHeader() && pd.isHolderType()){
- bo = createBOFromBodyBlock(createContextPackageSet(), message);
+ bo = createBOFromBodyBlock(createContextPackageSet(operationDesc), message);
}
try{
Holder inputArgHolder = (Holder)inputArgHolders.get(index);
@@ -916,11 +924,11 @@
* @param cls
* @return
*/
- protected Set<String> createContextPackageSet() {
+ protected Set<String> createContextPackageSet(OperationDescription operationDesc) {
return operationDesc.getEndpointInterfaceDescription().getEndpointDescription().getPackages();
}
- protected void assignHolderValues(Object bo, Object[] inputArgs, boolean isBare)throws JAXBWrapperException, InstantiationException, ClassNotFoundException, IllegalAccessException{
+ protected void assignHolderValues(Object bo, Object[] inputArgs, boolean isBare, OperationDescription operationDesc)throws JAXBWrapperException, InstantiationException, ClassNotFoundException, IllegalAccessException{
if(inputArgs == null){
return;
}
@@ -941,7 +949,7 @@
}
//Next get all the holder objects from Business Object created from Response Message
- ArrayList<MethodParameter> mps = extractHolderParameters(bo);
+ ArrayList<MethodParameter> mps = extractHolderParameters(bo, operationDesc);
if(mps.size() <=0){
return;
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/RPCLitMethodMarshallerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/RPCLitMethodMarshallerImpl.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/RPCLitMethodMarshallerImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/RPCLitMethodMarshallerImpl.java Tue Dec 5 10:28:55 2006
@@ -29,36 +29,35 @@
public class RPCLitMethodMarshallerImpl extends MethodMarshallerImpl {
- public RPCLitMethodMarshallerImpl(ServiceDescription serviceDesc,
- EndpointDescription endpointDesc, OperationDescription operationDesc, Protocol protocol) {
- super(serviceDesc, endpointDesc, operationDesc, protocol);
+ public RPCLitMethodMarshallerImpl() {
+ super();
// TODO Unsupported
throw new UnsupportedOperationException();
}
@Override
- public Object demarshalResponse(Message message, Object[] inputArgs)
+ public Object demarshalResponse(Message message, Object[] inputArgs, OperationDescription operationDesc)
throws WebServiceException {
// TODO Unsupported
throw new UnsupportedOperationException();
}
@Override
- public Object[] demarshalRequest(Message message)
+ public Object[] demarshalRequest(Message message, OperationDescription operationDesc)
throws WebServiceException {
// TODO Unsupported
throw new UnsupportedOperationException();
}
@Override
- public Message marshalResponse(Object returnObject, Object[] holderObjects)
+ public Message marshalResponse(Object returnObject, Object[] holderObjects, OperationDescription operationDesc)
throws WebServiceException {
// TODO Unsupported
throw new UnsupportedOperationException();
}
@Override
- public Message marshalRequest(Object[] object) throws WebServiceException {
+ public Message marshalRequest(Object[] object, OperationDescription operationDesc) throws WebServiceException {
// TODO Unsupported
throw new UnsupportedOperationException();
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Tue Dec 5 10:28:55 2006
@@ -25,11 +25,12 @@
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.ParameterDescription;
-import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
import org.apache.axis2.jaxws.message.Message;
+import org.apache.axis2.jaxws.message.MessageException;
import org.apache.axis2.jaxws.message.Protocol;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
@@ -41,22 +42,17 @@
public class DocLitBareMethodMarshaller implements MethodMarshaller {
private static Log log = LogFactory.getLog(DocLitBareMethodMarshaller.class);
- protected ServiceDescription serviceDesc = null;
- protected EndpointDescription endpointDesc = null;
- protected OperationDescription operationDesc = null;
- protected Protocol protocol = Protocol.soap11;
-
- public DocLitBareMethodMarshaller(ServiceDescription serviceDesc, EndpointDescription endpointDesc, OperationDescription operationDesc, Protocol protocol) {
+ public DocLitBareMethodMarshaller() {
super();
- this.serviceDesc = serviceDesc;
- this.endpointDesc = endpointDesc;
- this.operationDesc = operationDesc;
- this.protocol = protocol;
}
- public Object demarshalResponse(Message message, Object[] signatureArgs)
+ public Object demarshalResponse(Message message, Object[] signatureArgs, OperationDescription operationDesc)
throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample Document message
@@ -96,8 +92,12 @@
}
}
- public Object[] demarshalRequest(Message message)
+ public Object[] demarshalRequest(Message message, OperationDescription operationDesc)
throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample Document message
@@ -128,8 +128,20 @@
}
}
- public Message marshalResponse(Object returnObject, Object[] signatureArgs)
+ public Message marshalResponse(Object returnObject, Object[] signatureArgs, OperationDescription operationDesc)
throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample Document message
@@ -181,7 +193,18 @@
}
}
- public Message marshalRequest(Object[] signatureArguments) throws WebServiceException {
+ public Message marshalRequest(Object[] signatureArguments, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample Document message
@@ -224,7 +247,18 @@
}
}
- public Message marshalFaultResponse(Throwable throwable) throws WebServiceException {
+ public Message marshalFaultResponse(Throwable throwable, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Create the message
@@ -243,7 +277,11 @@
}
}
- public Throwable demarshalFaultResponse(Message message) throws WebServiceException {
+ public Throwable demarshalFaultResponse(Message message, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc, endpointDesc.getPackages(), message, false);
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java Tue Dec 5 10:28:55 2006
@@ -30,13 +30,14 @@
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.OperationDescriptionJava;
import org.apache.axis2.jaxws.description.ParameterDescription;
-import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
import org.apache.axis2.jaxws.message.Block;
import org.apache.axis2.jaxws.message.Message;
+import org.apache.axis2.jaxws.message.MessageException;
import org.apache.axis2.jaxws.message.Protocol;
import org.apache.axis2.jaxws.message.databinding.JAXBBlockContext;
import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
@@ -52,23 +53,19 @@
public class DocLitWrappedMethodMarshaller implements MethodMarshaller {
private static Log log = LogFactory.getLog(DocLitWrappedMethodMarshaller.class);
- protected ServiceDescription serviceDesc = null;
- protected EndpointDescription endpointDesc = null;
- protected OperationDescription operationDesc = null;
- protected Protocol protocol = Protocol.soap11;
- public DocLitWrappedMethodMarshaller(ServiceDescription serviceDesc, EndpointDescription endpointDesc, OperationDescription operationDesc, Protocol protocol) {
+ public DocLitWrappedMethodMarshaller() {
super();
- this.serviceDesc = serviceDesc;
- this.endpointDesc = endpointDesc;
- this.operationDesc = operationDesc;
- this.protocol = protocol;
}
- public Object demarshalResponse(Message message, Object[] signatureArgs)
+ public Object demarshalResponse(Message message, Object[] signatureArgs, OperationDescription operationDesc)
throws WebServiceException {
// Note all exceptions are caught and rethrown with a WebServiceException
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
try {
// Sample Document message
// ..
@@ -168,8 +165,12 @@
}
}
- public Object[] demarshalRequest(Message message)
+ public Object[] demarshalRequest(Message message, OperationDescription operationDesc)
throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample Document message
@@ -244,8 +245,19 @@
}
}
- public Message marshalResponse(Object returnObject, Object[] signatureArgs)
+ public Message marshalResponse(Object returnObject, Object[] signatureArgs, OperationDescription operationDesc)
throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample Document message
@@ -338,7 +350,18 @@
}
}
- public Message marshalRequest(Object[] signatureArguments) throws WebServiceException {
+ public Message marshalRequest(Object[] signatureArguments, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample Document message
@@ -418,7 +441,18 @@
}
}
- public Message marshalFaultResponse(Throwable throwable) throws WebServiceException {
+ public Message marshalFaultResponse(Throwable throwable, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Create the message
@@ -437,7 +471,11 @@
}
}
- public Throwable demarshalFaultResponse(Message message) throws WebServiceException {
+ public Throwable demarshalFaultResponse(Message message, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc,
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java?view=diff&rev=482732&r1=482731&r2=482732
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java Tue Dec 5 10:28:55 2006
@@ -27,11 +27,12 @@
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.ParameterDescription;
-import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
import org.apache.axis2.jaxws.message.Message;
+import org.apache.axis2.jaxws.message.MessageException;
import org.apache.axis2.jaxws.message.Protocol;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
@@ -42,21 +43,23 @@
public class RPCLitMethodMarshaller implements MethodMarshaller {
private static Log log = LogFactory.getLog(RPCLitMethodMarshaller.class);
- protected ServiceDescription serviceDesc = null;
- protected EndpointDescription endpointDesc = null;
- protected OperationDescription operationDesc = null;
- protected Protocol protocol = Protocol.soap11;
-
- public RPCLitMethodMarshaller(ServiceDescription serviceDesc, EndpointDescription endpointDesc, OperationDescription operationDesc, Protocol protocol) {
+ public RPCLitMethodMarshaller() {
super();
- this.serviceDesc = serviceDesc;
- this.endpointDesc = endpointDesc;
- this.operationDesc = operationDesc;
- this.protocol = protocol;
}
- public Message marshalRequest(Object[] signatureArguments) throws WebServiceException {
+ public Message marshalRequest(Object[] signatureArguments, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
@@ -113,8 +116,12 @@
}
}
- public Object[] demarshalRequest(Message message)
+ public Object[] demarshalRequest(Message message, OperationDescription operationDesc)
throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample RPC message
@@ -157,8 +164,19 @@
- public Message marshalResponse(Object returnObject, Object[] signatureArgs)
+ public Message marshalResponse(Object returnObject, Object[] signatureArgs, OperationDescription operationDesc)
throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample RPC message
@@ -227,8 +245,12 @@
}
- public Object demarshalResponse(Message message, Object[] signatureArgs)
+ public Object demarshalResponse(Message message, Object[] signatureArgs, OperationDescription operationDesc)
throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Sample RPC message
@@ -276,7 +298,18 @@
}
}
- public Message marshalFaultResponse(Throwable throwable) throws WebServiceException {
+ public Message marshalFaultResponse(Throwable throwable, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+ Protocol protocol = null;
+ try {
+ protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType()); //soap11;
+ } catch (MessageException e) {
+ // TODO better handling than this?
+ e.printStackTrace();
+ }
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
// Create the message
@@ -295,7 +328,11 @@
}
}
- public Throwable demarshalFaultResponse(Message message) throws WebServiceException {
+ public Throwable demarshalFaultResponse(Message message, OperationDescription operationDesc) throws WebServiceException {
+
+ EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
+ EndpointDescription endpointDesc = ed.getEndpointDescription();
+
// Note all exceptions are caught and rethrown with a WebServiceException
try {
Throwable t = MethodMarshallerUtils.demarshalFaultResponse(operationDesc, endpointDesc.getPackages(), message, true);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org