You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by 0vermind <vi...@web.de> on 2010/03/17 14:19:44 UTC

can't send request to WS with MINOCCURS=0

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-tp27931946p27931946.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: can't send request to WS with MINOCCURS=0

Posted by 0vermind <vi...@web.de>.
Hi Dan,

I've created an eclipse project for the thing, you can download it here
(zipped, ~20kb):
http://viru55.npage.de/get_file.php?id=11510865&vnr=586013

to answer your questions:
1)CXF 2.2.6
2)removed asm-2.2.3.jar, same stack trace
3)interface was generated (everything works if requested with a value for
the parameter), below are the GetMDEStatus- and
MDEStatusServiceSoapImpl-Classes(the latter responsible for the output,
thought you wanted that despite the other name)


GetMDEStatus:

package de.lbbw.webservices.mde_stats;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;


/**
 * <p>Java class for anonymous complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained
within this class.
 * 
 * <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="process_name"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "processName"
})
@XmlRootElement(name = "GetMDEStatus")
public class GetMDEStatus {

    @XmlElementRef(name = "process_name", namespace =
"http://mde_stats.webservices.lbbw.de/", type = JAXBElement.class)
    protected JAXBElement<String> processName;

    /**
     * Gets the value of the processName property.
     * 
     * @return
     *     possible object is
     *     {@link JAXBElement }{@code <}{@link String }{@code >}
     *     
     */
    public JAXBElement<String> getProcessName() {
        return processName;
    }

    /**
     * Sets the value of the processName property.
     * 
     * @param value
     *     allowed object is
     *     {@link JAXBElement }{@code <}{@link String }{@code >}
     *     
     */
    public void setProcessName(JAXBElement<String> value) {
        this.processName = ((JAXBElement<String> ) value);
    }

}




MDEStatusServiceSoapImpl:

/**
 * Please modify this class to meet your needs
 * This class is not complete
 */

package de.lbbw.webservices.mde_stats;

import java.util.logging.Logger;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

/**
 * This class was generated by Apache CXF 2.2.6
 * Wed Mar 17 15:02:38 CET 2010
 * Generated source version: 2.2.6
 * 
 */

@javax.jws.WebService(
                      serviceName = "MDEStatusService",
                      portName = "MDEStatusServiceSoap",
                      targetNamespace =
"http://mde_stats.webservices.lbbw.de/",
                      wsdlLocation =
"http://localhost:8083/test3/services/MDEStatusServiceSoap?wsdl",
                      endpointInterface =
"de.lbbw.webservices.mde_stats.MDEStatusServiceSoap")
                      
public class MDEStatusServiceSoapImpl implements MDEStatusServiceSoap {

    private static final Logger LOG =
Logger.getLogger(MDEStatusServiceSoapImpl.class.getName());

    /* (non-Javadoc)
     * @see
de.lbbw.webservices.mde_stats.MDEStatusServiceSoap#getMDEStatus(java.lang.String 
processName )*
     */
    public java.lang.String getMDEStatus(java.lang.String processName) { 
        LOG.info("Executing operation getMDEStatus");
        System.out.println(processName);
        try {
            java.lang.String _return = "_return-2102013970";
            return _return;
        } catch (Exception ex) {
            ex.printStackTrace();
            throw new RuntimeException(ex);
        }
    }

}





dkulp wrote:
> 
> 
> Can you package your little testcase into a project and attach to a JIRA?   
> That will help get it into a state to debug.
> 
> Thoughts:
> 1) What version of CXF?
> 2) Can you try removing the ASM jar from the classpath and see if the
> stack 
> trace is different?
> 3) Was the service interface generated from the wsdl?   What is the full 
> method signature (with annotations) for GetMDEStatus method?
> 
-- 
View this message in context: http://old.nabble.com/can%27t-send-request-to-WS-with-MINOCCURS%3D0-tp27931946p27932872.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: can't send request to WS with MINOCCURS=0

Posted by Daniel Kulp <dk...@apache.org>.
Can you package your little testcase into a project and attach to a JIRA?   
That will help get it into a state to debug.

Thoughts:
1) What version of CXF?
2) Can you try removing the ASM jar from the classpath and see if the stack 
trace is different?
3) Was the service interface generated from the wsdl?   What is the full 
method signature (with annotations) for GetMDEStatus method?


Dan



On Wednesday 17 March 2010 9:19:44 am 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.w
> ebservices.lbbw.de/}GetMDEStatus has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault
> 	at
> org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor.handleMessage(W
> rapperClassInInterceptor.java:168) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> n.java:243) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationO
> bserver.java:109) at
> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestinati
> on.java:98) at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(Servle
> tController.java:406) at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController
> .java:178) at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServl
> et.java:142) at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Abstract
> HTTPServlet.java:179) at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPSer
> vlet.java:103) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> 	at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPSe
> rvlet.java:159) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
> nFilterChain.java:252) at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
> hain.java:173) at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
> ava:213) at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j
> ava:178) at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12
> 6) at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:10
> 5) at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav
> a: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.process
> Connection(Http11BaseProtocol.java:664) at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.ja
> va:527) at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerW
> orkerThread.java:80) at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja
> va:684) at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NullPointerException
> 	at
> de.lbbw.webservices.mde_stats.GetMDEStatus_WrapperTypeHelper1.getWrapperPar
> ts(Unknown Source)
> 	at
> org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor.handleMessage(W
> rapperClassInInterceptor.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:Fau
> lt><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>

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: can't send request to WS with MINOCCURS=0

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 17 March 2010 12:11:56 pm 0vermind wrote:
> 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?

Bug.  And testing a fix now.

Dan


> 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(PhaseInterceptorCh
> > ain.java:243)
> > 
> > 	at
> > 
> > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiatio
> > nObserver.java:109)
> > 
> > 	at
> > 
> > org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestina
> > tion.java:98)
> > 
> > 	at
> > 
> > org.apache.cxf.transport.servlet.ServletController.invokeDestination(Serv
> > letController.java:406)
> > 
> > 	at
> > 
> > org.apache.cxf.transport.servlet.ServletController.invoke(ServletControll
> > er.java:178)
> > 
> > 	at
> > 
> > org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSer
> > vlet.java:142)
> > 
> > 	at
> > 
> > org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Abstra
> > ctHTTPServlet.java:179)
> > 
> > 	at
> > 
> > org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPS
> > ervlet.java:103)
> > 
> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > 	at
> > 
> > org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTP
> > Servlet.java:159)
> > 
> > 	at
> > 
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicat
> > ionFilterChain.java:252)
> > 
> > 	at
> > 
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilte
> > rChain.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.j
> > ava:107)
> > 
> > 	at
> > 
> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:14
> > 8)
> > 
> > 	at
> > 
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869
> > )
> > 
> > 	at
> > 
> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proce
> > ssConnection(Http11BaseProtocol.java:664)
> > 
> > 	at
> > 
> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.
> > java:527)
> > 
> > 	at
> > 
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowe
> > rWorkerThread.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.getWrapperP
> > arts(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:F
> > ault><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>

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: can't send request to WS with MINOCCURS=0

Posted by 0vermind <vi...@web.de>.
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.