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 13:54:24 UTC

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

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


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

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle closed AXIS2-2305.
---------------------------------

    Resolution: Fixed

No test provided.

Dims, 

Please test and reopen if a problem is found.

> 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
>         Assigned To: Rich Scheuerle
>
> 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


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

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on AXIS2-2305 started by Rich Scheuerle.

> 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
>         Assigned To: Rich Scheuerle
>
> 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


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

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ 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


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

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480200 ] 

Rich Scheuerle commented on AXIS2-2305:
---------------------------------------

Status update:

I have a fix for this, but I am need to upgrade to the current version of Axis to test the fixes.  (The fix is rather large, as it tries to correct this problem for all of the styles/uses)

I will commit the change on 3/13

> 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
>         Assigned To: Rich Scheuerle
>
> 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


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

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas reassigned AXIS2-2305:
---------------------------------------

    Assignee: Rich Scheuerle

Rich, 

Could u please take a look at this.

thanks,
dims

> 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
>         Assigned To: Rich Scheuerle
>
> 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


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

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479838 ] 

Rich Scheuerle commented on AXIS2-2305:
---------------------------------------

Thanks Dims for writing up this problem and providing a work-around.

The proposed "ugly hack" is only a  partial solution.  Please read more. 

Background:
------------------

JAXB provides 2 kinds of marshal/unmarshal modes: "by java type" and "by schema element".

The "by schema element" approach is much safer and xml-centric and is preferred in almost every case.
The "by schema element" approach uses the JAXB annotations (for JAXBBeans) and ObjectFactory for primitives/String.

The "by java type" approach is less safe and much more java centric.  It should only be used in situations where
the "by schema element" approach cannot be applied.  Currently it is used for the rpc/literal scenarios (in rpc/lit, the element on the wire is defined by a wsdl part...not a schema element).  

In Dim's scenario (which I will call doc/lit bare minimal), we have doc/lit bare apis but no ObjectFactory.  Thus we need to use "by java type" for the primitives.  I am going to try a design approach similar to the "doc/lit wrapped minimal" approach.  Implement a separate marshaller "doc/lit bare minimal", which is triggered by the missing ObjectFactory.  Thus we can logically separate this scenario from the more normal "doc/lit bare" scenario.

(The "normal" doc/lit bare scenario will have ObjectFactory objects produced by wsimport / xjc or will only use JAXB compliant beans. )


Next Step (on or before 3/12):
-----------------------------------------

I will work on the design and code for this approach.  If I successfully complete the design/code, I will commit the change.  If I cannot complete the design/code, I will commit Dim's "ugly hack" as a temporary solution.

Thanks,
Scheu



> 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
>         Assigned To: Rich Scheuerle
>
> 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