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 "Davanum Srinivas (JIRA)" <ji...@apache.org> on 2007/03/09 15:11:24 UTC

[jira] Commented: (AXIS2-2305) Doc/Lit/Bare with Primitives

    [ https://issues.apache.org/jira/browse/AXIS2-2305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479594 ] 

Davanum Srinivas commented on AXIS2-2305:
-----------------------------------------

Ugly Hack that works.

Index: modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
===================================================================
--- modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java     (revision 516017)
+++ modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java     (working copy)
@@ -66,6 +66,7 @@
 import org.apache.axis2.jaxws.utility.ConvertUtils;
 import org.apache.axis2.jaxws.utility.SAAJFactory;
 import org.apache.axis2.jaxws.utility.XMLRootElementUtil;
+import org.apache.axis2.util.JavaUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -210,10 +211,12 @@
                 Block block = null;
                 JAXBBlockContext context = new JAXBBlockContext(packages);
-
-                // RPC is type based, so unfortuately the type of
+
+                // RPC is type based, so unfortuately the type of
                 // object must be provided
-                if (isUnmarshalByType && !pd.isHeader()) {
+                Class type = pd.getParameterActualType();
+                if (isUnmarshalByType && !pd.isHeader() || type.isPrimitive() ||
+                        type.getName().startsWith("java.lang")) {
                     context.setProcessType(pd.getParameterActualType());
                 }



> Doc/Lit/Bare with Primitives
> ----------------------------
>
>                 Key: AXIS2-2305
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2305
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: jaxws
>            Reporter: Davanum Srinivas
>
> Hi,
> Ran into this when testing JSR 181 annotations...
> @WebService
> @SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle=SOAPBinding.ParameterStyle.BARE)
> public class webParamWebService {
>   
>   @WebMethod(operationName="helloString", action="urn:HelloString")
>   public String hello(@WebParam (name="string1") String name) {
>     return "hello : Hello " + name + " to Web Service";
>   }
> }
> Note that the paramter string1 is not a JAXB type, we can't handle this situation right now. Our service fails with an JAXB UnmarshalException. 
> Here's the soap request i used to test.
> <?xml version='1.0' encoding='UTF-8'?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> <soapenv:Body>
> <ns3:string1 xmlns:ns3="http://server.webparam1.webparam/">jsr181</ns3:string1>
> </soapenv:Body>
> </soapenv:Envelope>
> thanks,
> dims

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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