found the bug...or is this a feature of CXF?

in the wsdl i have:
<xs:element minOccurs="0" name="process_name" nillable="true"
type="xs:string"/>

if i leave nillable="true" out, i can send a request without the element.
i formerly used jax-ws from sun, which accepted the wsdl with both
attributes present.
so again, dan: bug or feature?




0vermind wrote:
> 
> Hi there,
> i've got a wsdl (see below), with the minoccurs=0 attribute in the request
> parameter set.
> I have generated the java classes with cxf from eclipse and deployed the
> service on tomcat 5.5.
> The WS works correctly if I send the minoccurs-element in the request.
> If I leave it out completely i get the following error:
> 
> 
> 
> 17.03.2010 13:53:30 org.apache.cxf.interceptor.LoggingInInterceptor
> logging
> INFO: Inbound Message
> ----------------------------
> ID: 2
> Address: /test3/services/MDEStatusServiceSoap
> Encoding: UTF-8
> Content-Type: text/xml;charset=UTF-8
> Headers: {content-type=[text/xml;charset=UTF-8], host=[localhost:8083],
> Content-Length=[271], SOAPAction=[""], user-agent=[Jakarta
> Commons-HttpClient/3.1], Content-Type=[text/xml;charset=UTF-8]}
> 
> Payload: <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:mde="http://mde_stats.webservices.lbbw.de/";>
>    <soapenv:Header/>
>    <soapenv:Body>
>       <mde:GetMDEStatus>
>          
>       </mde:GetMDEStatus>
>    </soapenv:Body>
> </soapenv:Envelope>
> 
> 
> --------------------------------------
> 17.03.2010 13:53:30 org.apache.cxf.phase.PhaseInterceptorChain
> doDefaultLogging
> WARNUNG: Interceptor for
> {http://mde_stats.webservices.lbbw.de/}MDEStatusService#{http://mde_stats.webservices.lbbw.de/}GetMDEStatus
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault
>       at
> org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor.handleMessage(WrapperClassInInterceptor.java:168)
>       at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
>       at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
>       at
> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:98)
>       at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:406)
>       at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:178)
>       at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142)
>       at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
>       at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>       at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>       at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>       at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>       at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>       at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>       at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>       at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>       at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>       at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NullPointerException
>       at
> de.lbbw.webservices.mde_stats.GetMDEStatus_WrapperTypeHelper1.getWrapperParts(Unknown
> Source)
>       at
> org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor.handleMessage(WrapperClassInInterceptor.java:135)
>       ... 24 more
> 17.03.2010 13:53:30
> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
> 
> 
> 
> INFO: Outbound Message
> ---------------------------
> ID: 2
> Response-Code: 500
> Encoding: UTF-8
> Content-Type: text/xml
> Headers: {}
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Fault
> occurred while
> processing.</faultstring></soap:Fault></soap:Body></soap:Envelope>
> 
> 
> 
> 
> The wsdl is this (i think any HelloWorld with minoccurs=0 should do):
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://mde_stats.webservices.lbbw.de/";
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/";
> xmlns:s="http://www.w3.org/2001/XMLSchema";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:tns="http://mde_stats.webservices.lbbw.de/";
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
> xmlns:xs="http://www.w3.org/2001/XMLSchema";
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";>
>   <wsdl:types>
>     <xs:schema elementFormDefault="qualified"
> targetNamespace="http://mde_stats.webservices.lbbw.de/";>
>             <xs:element name="GetMDEStatus">
>                 <xs:complexType>
>                     <xs:sequence>
>                         <xs:element minOccurs="0" name="process_name"
> nillable="true" type="xs:string"/>
>                                               
>                     </xs:sequence>
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="GetMDEStatusResponse">
>                 <xs:complexType>
>                     <xs:sequence>
>                         <xs:element maxOccurs="1" minOccurs="0"
> name="process_result" type="xs:string"/>
>                     </xs:sequence>
>                 </xs:complexType>
>             </xs:element>
>             
>         </xs:schema>
>   </wsdl:types>
>   <wsdl:message name="GetMDEStatusSoapIn">
>     <wsdl:part name="parameters" element="tns:GetMDEStatus">
>     </wsdl:part>
>   </wsdl:message>
>   <wsdl:message name="GetMDEStatusSoapOut">
>     <wsdl:part name="parameters" element="tns:GetMDEStatusResponse">
>     </wsdl:part>
>   </wsdl:message>
>   <wsdl:portType name="MDEStatusServiceSoap">
>     <wsdl:operation name="GetMDEStatus">
>       <wsdl:input message="tns:GetMDEStatusSoapIn">
>     </wsdl:input>
>       <wsdl:output message="tns:GetMDEStatusSoapOut">
>     </wsdl:output>
>     </wsdl:operation>
>   </wsdl:portType>
>   <wsdl:binding name="MDEStatusServiceSoap"
> type="tns:MDEStatusServiceSoap">
>     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="GetMDEStatus">
>       <soap:operation soapAction=""/>
>       <wsdl:input>
>         <soap:body use="literal"/>
>       </wsdl:input>
>       <wsdl:output>
>         <soap:body use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="MDEStatusService">
>     <wsdl:port name="MDEStatusServiceSoap"
> binding="tns:MDEStatusServiceSoap">
>       <soap:address
> location="http://localhost:8083/test/services/MDEStatusServiceSoap"/>
>     </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
> 

-- 
View this message in context: 
http://old.nabble.com/can%27t-send-request-to-WS-with-MINOCCURS%3D0-tp27931946p27933573.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to