You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "maomaode (JIRA)" <ji...@apache.org> on 2007/03/08 08:42:24 UTC

[jira] Commented: (CXF-450) JAXWS JavaFirst throws NPE when @WebParameter is not defined in SEP for doc/lit/wrap

    [ https://issues.apache.org/jira/browse/CXF-450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479252 ] 

maomaode commented on CXF-450:
------------------------------

java2wsdl delegate jaxb to generate the schema from the wrapper bean, but currently java2wsdl will not generate the wrapper bean from the SEI, so guess something wrong in your wrapper beans, the correct one should be:
ackage org.apache.cxf.tools.fortest.withannotation.doc.jaxws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "sayHi", namespace = "http://doc.withannotation.fortest.tools.cxf.apache.org/")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "sayHi", namespace = "http://doc.withannotation.fortest.tools.cxf.apache.org/")
public class SayHi {

   @XmlElement(name = "arg0", namespace = "")
   private long arg0;

   /**
    *
    * @return
    *     returns long
    */
   public long getArg0() {
       return this.arg0;
   }

   /**
    *
    * @param arg0
    *     the value for the arg0 property
    */
   public void setArg0(long arg0) {
       this.arg0 = arg0;
   }

}


If your wrapper bean as same as the above, the wsdl should be generated with the arg0 as the augument.

> JAXWS JavaFirst throws NPE when @WebParameter is not defined in SEP for doc/lit/wrap
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-450
>                 URL: https://issues.apache.org/jira/browse/CXF-450
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.0-RC
>            Reporter: Johnson Ma
>
> *JAXWS, JAVA-First, Document/Lit/Wrapper
> * test java SEI class
> @WebService(targetNamespace = "http://iona.com/", name = "Hello")
> public interface Hello {
>     @ResponseWrapper(targetNamespace = "http://iona.com/", className = "com.iona.SayHiResponse", localName = "sayHiResponse")
>     @RequestWrapper(targetNamespace = "http://iona.com/", className = "com.iona.SayHi", localName = "sayHi")
>     @WebMethod(operationName = "sayHi")
>     public void sayHi(
>         long l1
>     );
> }
> * got nullpoint exception as following
> INFO: Creating Service {http://iona.com/}HelloService from WSDL.
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeParameter(ReflectionServiceFactoryBean.java:476)
> 	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(JaxWsServiceFactoryBean.java:343)
> 	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(JaxWsServiceFactoryBean.java:322)
> 	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:160)
> * reason:
> In JaxWsServerFactoryBean, line number 342:
> if (isIn && !isOut) {
>             QName name = getInPartName(o, method, i);
>             part = o.getInput().getMessagePart(name);
>             initializeParameter(part, paramType, genericType);
>             part.setIndex(i);
>         } 
> The part is null, which caused the NPE,
> In JaxWSServiceConfiguration, line number 175.
> public QName getInPartName(OperationInfo op, Method method, int paramNumber) {
>         if (paramNumber < 0) {
>             return null;
>         }
>         
>         return getPartName(op, method, paramNumber, "arg" + paramNumber);
>     }
> But the wsdl we generated from SEI is using 
> <xs:element name="sayHi">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element form="qualified" name="l1" type="xs:long"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
>   <xs:element name="sayHiResponse">
>     <xs:complexType/>
>   </xs:element>
> </xsd:schema>
>   </wsdl:types>
>   <wsdl:message name="sayHi">
>     <wsdl:part name="sayHi" element="tns:sayHi">
>     </wsdl:part>
>   </wsdl:message>
> So it looking for arg0, but it is defined in generated wsdl as 'l1'.

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