cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jorge Eduardo Elizondo" <jelizon...@gmail.com>
Subject Message part was not recognized
Date Wed, 08 Aug 2007 14:04:58 GMT
Hi,

I created a Web  Service with Spring. I first used apache-cxf-2.0, but
upgraded to apache-cxf-2.1-incubator-20070714.192702-5. I created the wsdl
with java2wsdl and the client code with wsdl2java fine. The problem is that
when I call the method updateCategories from the client, the server throws
the next exception:

Aug 8, 2007 6:14:37 AM org.apache.cxf.phase.PhaseInterceptorChaindoIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Message part {
http://client.order.soap.retkomerco.ordo.com/}updateCategories was not
recognized.
    at org.apache.cxf.interceptor.BareInInterceptor.handleMessage(
BareInInterceptor.java:134)
    at
org.apache.cxf.binding.soap.interceptor.RPCInInterceptor.handleMessage(
RPCInInterceptor.java:78)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:207)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
ChainInitiationObserver.java:73)
    at org.apache.cxf.transport.servlet.ServletDestination.doMessage(
ServletDestination.java:78)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(
ServletController.java:224)
    at org.apache.cxf.transport.servlet.ServletController.invoke(
ServletController.java:137)
    at org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java
:261)
    at org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.java
:239)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
    at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
(OpenSessionInViewFilter.java:198)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(
OncePerRequestFilter.java:75)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
    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(Thread.java:595)


Here is the ItemService.wsdl generated with java2wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="ItemService" targetNamespace="
http://client.order.soap.retkomerco.ordo.com" xmlns:ns1="
http://client.order.soap.retkomerco.ordo.com" xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:ns2="urn:com:ordo:retkomerco:soap:order:client" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:com:ordo:retkomerco:soap:order:client"
attributeFormDefault="unqualified" elementFormDefault="unqualified"
targetNamespace="urn:com:ordo:retkomerco:soap:order:client">
<xs:complexType name="Category">
<xs:sequence>
<xs:element minOccurs="0" name="code" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="images"
nillable="true" type="xs:base64Binary"/>
<xs:element minOccurs="0" name="intro" type="xs:string"/>
<xs:element minOccurs="0" name="name" type="xs:string"/>
<xs:element minOccurs="0" name="parent" type="xs:string"/>
<xs:element minOccurs="0" name="status" type="xs:string"/>
<xs:element minOccurs="0" name="style" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Item">
<xs:sequence>
<xs:element minOccurs="0" name="categoryCode" type="xs:string"/>
<xs:element minOccurs="0" name="customId" type="xs:string"/>
<xs:element minOccurs="0" name="description" type="xs:string"/>
<xs:element minOccurs="0" name="discount" type="xs:decimal"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="images"
nillable="true" type="xs:base64Binary"/>
<xs:element minOccurs="0" name="name" type="xs:string"/>
<xs:element minOccurs="0" name="numOrdered" type="xs:int"/>
<xs:element minOccurs="0" name="price" type="xs:decimal"/>
<xs:element minOccurs="0" name="productCode" type="xs:string"/>
<xs:element minOccurs="0" name="quantity" type="xs:decimal"/>
<xs:element minOccurs="0" name="reducedShippingPrice" type="xs:decimal"/>
<xs:element minOccurs="0" name="shippingPrice" type="xs:decimal"/>
<xs:element minOccurs="0" name="units" type="xs:string"/>
<xs:element minOccurs="0" name="weight" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="#all" name="CategoryArray">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true"
type="tns:Category"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="#all" name="ItemArray">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true"
type="tns:Item"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
  </wsdl:types>
  <wsdl:message name="updateCategories">
    <wsdl:part name="categories" type="ns2:CategoryArray">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="update">
    <wsdl:part name="items" type="ns2:ItemArray">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="ItemService">
    <wsdl:operation name="update">
      <wsdl:input name="update" message="ns1:update">
    </wsdl:input>
    </wsdl:operation>
    <wsdl:operation name="updateCategories">
      <wsdl:input name="updateCategories" message="ns1:updateCategories">
    </wsdl:input>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="ItemServiceServiceSoapBinding" type="ns1:ItemService">
    <soap:binding style="rpc" transport="
http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="update">
      <soap:operation soapAction="" style="rpc"/>
      <wsdl:input name="update">
        <soap:body use="literal" namespace="
http://client.order.soap.retkomerco.ordo.com"/>
      </wsdl:input>
    </wsdl:operation>
    <wsdl:operation name="updateCategories">
      <soap:operation soapAction="" style="rpc"/>
      <wsdl:input name="updateCategories">
        <soap:body use="literal" namespace="
http://client.order.soap.retkomerco.ordo.com"/>
      </wsdl:input>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="ItemService">
    <wsdl:port name="ItemServicePort"
binding="ns1:ItemServiceServiceSoapBinding">
      <soap:address location="http://localhost:9090/hello"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

And this is the SEI:
package com.ordo.retkomerco.soap.order;

import com.ordo.retkomerco.order.Item;
import com.ordo.retkomerco.soap.SoapConstants;

import java.util.Set;
import java.util.List;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.Oneway;
import javax.jws.soap.SOAPBinding;

/**
 * @author Jorge E. Elizondo
 *         Date: Jun 2, 2007
 *         Time: 5:20:59 PM
 */

@WebService(name = "ItemService",
        targetNamespace = SoapConstants.RETKOMERCO_WS_NS)
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface ItemService {

    /**
     * Batch update the Categories within the set of categories
     *
     * @param categories
     */
    @Oneway
    @WebMethod(operationName = "updateCategories")
    void updateCategories(@WebParam(name = "categories", mode=
WebParam.Mode.IN)List<CategoryWS> categories);

    /**
     * Batch update the Inventory with the set of Items
     *
     * @param items the items to be updated
     */

    @Oneway
    @WebMethod(operationName = "update")
    void update(@WebParam(name = "items", mode= WebParam.Mode.IN)Set<ItemWS>
items);
}

And SoapConstants:

package com.ordo.retkomerco.soap;

/**
 * @author Jorge E. Elizondo
 *         Date: Jul 25, 2007
 *         Time: 10:04:02 PM
 */

public class SoapConstants {
    public static final String RETKOMERCO_NS = "
http://client.order.soap.retkomerco.ordo.com";
    public static final String RETKOMERCO_WS_NS = RETKOMERCO_NS;
    public static final String RETKOMERCO_MODEL_NS =
"urn:com:ordo:retkomerco:soap:order:client";
}

I debugged the server side with cxf sources and saw that when the web
service is created in Spring the MessagePartInfo constructor creates these
two Qnames:

{http://client.order.soap.retkomerco.ordo.com}items
{http://client.order.soap.retkomerco.ordo.com}categories

After that, when I call the Web Service from the client, BareInInterceptor
calls
p = findMessagePart(exchange, ops, elName, client, paramNum).
It looks like this method searches
{http://client.order.soap.retkomerco.ordo.com/}updateCategories in the
Qnames array created by the server at startup time, but it doesn't find the
updateCategories method, but the arrays that the WS methods receive as
parameters.

Help will be greatly appreciated. I've been struggling with this for a week
now and Google hasn't been much help.

Thanks in Advance,
Jorge

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message