Hi list! I'm trying to use CXF to consume a SOAP service. I'm facing a problem related to namespaces and prefixes.
Here it is a "valid" request (generated by Soap UI. The real namespaces were shortened on purpose for the sake of privacy): <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.cuentaservices/" xmlns:req=" http://request.ws.cuentaservices/"> <soapenv:Header/> <soapenv:Body> <ser:getCuentaPorCBU> <requerimientogetCuentaPorCBU> <req:cabecera> <idRequerimiento>11111111111</idRequerimiento> <ipCliente>0.0.0.0</ipCliente> <timeStamp>20161011153347271</timeStamp> <idEntidad>0011</idEntidad> <canal>HB</canal> </req:cabecera> <tipoTerminal>74</tipoTerminal> <fiidPagador>0014</fiidPagador> <req:datosTarjeta> <fiidEmisorEntidad>0029</fiidEmisorEntidad> <numeroTarjeta></numeroTarjeta> </req:datosTarjeta> <cbu>0720141388000036824786</cbu> <moneda>032</moneda> <ipOrigen>0.0.0.0</ipOrigen> </requerimientogetCuentaPorCBU> </ser:getCuentaPorCBU> </soapenv:Body> </soapenv:Envelope> I want you to notice two things: - getCuentaPorCBU belongs to http://service.ws.cuentaservices/ namespace - requerimientogetCuentaPorCBU belongs to thje global namespace (namespace = "") Here it is a request generated by CXF (or the underlying marshalling layer to be more precise) <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <getCuentaPorCBU xmlns="http://service.ws.cuentaservices/" xmlns:ns2="http://request.ws.cuentaservices/" xmlns:ns3="http://service.ws.cuentaservices/" xmlns:ns4="http://response.ws.cuentaservices/" xmlns:ns5="http://cuenta_cheque.response.ws.cuentaservices/" xmlns:ns6="http://response.ws.cuenta_cuit.cuentaservicesr/"> <requerimientogetCuentaPorCBU> <ns2:cabecera> <idRequerimiento>eba20cc2-0c23-4154-85dc-f3d98cb1ab26</idRequerimiento> <ipCliente>0.0.0.0</ipCliente> <timeStamp>20161011153347271</timeStamp> <idEntidad>0011</idEntidad> <canal>HB</canal> </ns2:cabecera> <tipoTerminal>74</tipoTerminal> <fiidPagador>0014</fiidPagador> <ns2:datosTarjeta> <fiidEmisorEntidad>0029</fiidEmisorEntidad> <numeroTarjeta/> </ns2:datosTarjeta> <cbu>0720141388000036824786</cbu> <moneda>032</moneda> <ipOrigen>0.0.0.0</ipOrigen> </requerimientogetCuentaPorCBU> </getCuentaPorCBU> </env:Body> </env:Envelope> As you can see, in this request both getCuentaPorCBU and requerimientogetCuentaPorCBU "belongs" to the http://service.ws.cuentaservices/ Of course, the server counterpart doesn't like this request and it complains about the requerimientogetCuentaPorCBU node belonging to http://service.ws.cuentaservices/ ns instead of the empty namespace. I'm using CXF 3.1.7 Just in case it's relevant I want to add I'm using JaxWsProxyFactoryBean to build de client. Service definition: @WebService(targetNamespace = "http://service.ws.cuentaservices/", name = "WSCuentRestriccionTransferenciaServices") @XmlSeeAlso( ommitted ) public interface WSCuentRestriccionTransferenciaServices { @WebMethod @RequestWrapper(localName = "getCuentaPorCBU", targetNamespace = " http://service.ws.cuentaservices/", className = "cuentaservices.ws.service.GetCuentaPorCBU") @ResponseWrapper(localName = "getCuentaPorCBUResponse", targetNamespace = "http://service.ws.cuentaservices/", className = "cuentaservices.ws.service.GetCuentaPorCBUResponse") @WebResult(name = "respuestaGetCuentaPorCBU", targetNamespace = "") public ar.com.redlink.cuentaservices.ws.client.service.WsGetCuentaPorCBUResponse getCuentaPorCBU( @WebParam(name = "requerimientogetCuentaPorCBU", targetNamespace = "") cuentaservices.ws.client.service.WsGetCuentaPorCBURequest requerimientogetCuentaPorCBU ); Could someone help me? Thank you very much! Pablo
