You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Michael Nelson <mi...@gmail.com> on 2008/03/01 14:16:25 UTC
CXF 2.0.4 client sends SOAP request that server doesn't like
I am using CXF 2.0.4 on both client and server. I have a simple server
interface derived from one of the samples (see below). When I try to call
the "deleteCustomer" function using the CXF 2.0.4 wsdl2java client, the
first element of the paramArray passed into
org.apache.cxf.jaxws.JAXWSMethodInvoker.performInvocation() is null. If I
use Microsoft's WCF, I don't have this problem.
The difference between the two requests is the namespace prefix on the tags
in the method invocation. If I remove them and do a manual post using wget,
the call succeeds.
WCF:
<s:Envelope xmlns:s="
http://schemas.xmlsoap.org/soap/envelope/"><s:Body><deleteCustomer
xmlns="
http://customer.acme.com"><id>4300</id></deleteCustomer></s:Body></s:Envelope
>
CXF client:
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:deleteCustomerxmlns:ns2="
http://customer.acme.com"><id>4300</id></ns2:deleteCustomer></soap:Body></soap:Envelope><s:Envelope
xmlns:s="
http://schemas.xmlsoap.org/soap/envelope/"><s:Body><deleteCustomer><id>4300</id></deleteCustomer>
</s:Body></s:Envelope>
Any ideas on how I might be able to solve this problem? Or is this just a
bug?
Thanks,
-mike
===============================
@WebService(targetNamespace = "http://customer.acme.com")
public interface CustomerService {
[ ... Other methods ...]
@Delete
@HttpResource(location = "/customers/{id}")
void deleteCustomer(@WebParam(name = "id")
long id) throws CustomerNotFoundFault;
}
The client interface that is generated from wsdl2java is:
@WebService(targetNamespace = "http://customer.acme.com", name =
"CustomerService")
public interface CustomerService {
[... Other methods ...]
@RequestWrapper(localName = "deleteCustomer", targetNamespace = "
http://customer.acme.com", className = "com.acme.customer.DeleteCustomer")
@ResponseWrapper(localName = "deleteCustomerResponse", targetNamespace =
"http://customer.acme.com", className = "
com.acme.customer.DeleteCustomerResponse")
@WebMethod
public void deleteCustomer(
@WebParam(name = "id", targetNamespace = "http://customer.acme.com")
long id
);
};
Re: CXF 2.0.4 client sends SOAP request that server doesn't like
Posted by Michael Nelson <mi...@gmail.com>.
Never mind -- my build script wasn't properly rebuilding the client stub.
Thanks.
On 3/1/08, Michael Nelson <mi...@gmail.com> wrote:
>
> I am using CXF 2.0.4 on both client and server. I have a simple server
> interface derived from one of the samples (see below). When I try to call
> the "deleteCustomer" function using the CXF 2.0.4 wsdl2java client, the
> first element of the paramArray passed into
> org.apache.cxf.jaxws.JAXWSMethodInvoker.performInvocation() is null. If I
> use Microsoft's WCF, I don't have this problem.
>
> The difference between the two requests is the namespace prefix on the
> tags in the method invocation. If I remove them and do a manual post using
> wget, the call succeeds.
>
> WCF:
> <s:Envelope xmlns:s="
> http://schemas.xmlsoap.org/soap/envelope/"><s:Body><deleteCustomer<http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Cs:Body%3E%3CdeleteCustomer>
> xmlns="
> http://customer.acme.com"><id>4300</id></deleteCustomer></s:Body></s:Envelope
> >
>
> CXF client:
>
> <soap:Envelope xmlns:soap="
> http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:deleteCustomer<http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoap:Body%3E%3Cns2:deleteCustomer>xmlns:ns2="
> http://customer.acme.com"><id>4300</id></ns2:deleteCustomer></soap:Body></soap:Envelope><s:Envelope
> xmlns:s="
> http://schemas.xmlsoap.org/soap/envelope/"><s:Body><deleteCustomer><id>4300</id></deleteCustomer>
> </s:Body></s:Envelope>
>
> Any ideas on how I might be able to solve this problem? Or is this just a
> bug?
>
> Thanks,
> -mike
>
> ===============================
>
> @WebService(targetNamespace = "http://customer.acme.com")
> public interface CustomerService {
> [ ... Other methods ...]
>
> @Delete
> @HttpResource(location = "/customers/{id}")
> void deleteCustomer(@WebParam(name = "id")
> long id) throws CustomerNotFoundFault;
>
> }
>
> The client interface that is generated from wsdl2java is:
>
> @WebService(targetNamespace = "http://customer.acme.com", name =
> "CustomerService")
>
> public interface CustomerService {
> [... Other methods ...]
>
> @RequestWrapper(localName = "deleteCustomer", targetNamespace = "
> http://customer.acme.com", className = "com.acme.customer.DeleteCustomer")
> @ResponseWrapper(localName = "deleteCustomerResponse", targetNamespace
> = "http://customer.acme.com", className = "
> com.acme.customer.DeleteCustomerResponse")
> @WebMethod
> public void deleteCustomer(
> @WebParam(name = "id", targetNamespace = "http://customer.acme.com
> ")
> long id
> );
> };
>
>
>