You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Teresa <te...@gmail.com> on 2014/07/09 22:57:05 UTC

Problem with @ResponseWrapper in authentication client CXF

Hi Daniel,
I have a problem with CXF, namely to generate a java client. CFX version is
3.0.0.
This client is authenticated and the BindingProvider use for it, running
without problem. The failure occurs when the answer turns, I siguiete
obtendiendo the exception:
Caused by: org.apache.cxf.interceptor.Fault: Unexpected wrapper element
{urn:sap-com:document:sap:soap:functions:mc-style}ZsdClientesGet found.
Expected
{urn:sap-com:document:sap:soap:functions:mc-style}ZsdClientesGetResponse.
at
org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:105)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at
org.apache.cxf.phase.PhaseInterceptorChain.doInterceptStartingAt(PhaseInterceptorChain.java:456)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
at
org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleAbort(SOAPHandlerInterceptor.java:208)
at
org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessageInternal(SOAPHandlerInterceptor.java:170)
at
org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.access$000(SOAPHandlerInterceptor.java:71)
at org.apache.cxf.jaxws.handler.soap.SOAPHa
Self-generated service interface is as follows:
@WebService(targetNamespace =
“urn:sap-com:document:sap:soap:functions:mc-style”, name =
“ZSD_CLIENTES_GET”)
@XmlSeeAlso({ObjectFactory.class})
public interface ZSDCLIENTESGET {
@RequestWrapper(localName = “ZsdClientesGet”, targetNamespace =
“urn:sap-com:document:sap:soap:functions:mc-style”, className =
“com.sgae.dedalo.ws.client.sap.ZsdClientesGet_Type”)
@WebMethod(operationName = “ZsdClientesGet”, action =
“urn:sap-com:document:sap:soap:functions:mc-style:ZSD_CLIENTES_GET:ZsdClientesGetRequest”)
@ResponseWrapper(localName = “ZsdClientesGetResponse”, targetNamespace =
“urn:sap-com:document:sap:soap:functions:mc-style”, className =
“com.sgae.dedalo.ws.client.sap.ZsdClientesGetResponse”)
public void zsdClientesGet(
@WebParam(name = “Apellidos”, targetNamespace = “”)
java.lang.String apellidos,
@WebParam(name = “CodigoFiscal”, targetNamespace = “”)
java.lang.String codigoFiscal,
@WebParam(name = “CodigoPostal”, targetNamespace = “”)
java.lang.String codigoPostal,
@WebParam(name = “DelegacionGestora”, targetNamespace = “”)
java.lang.String delegacionGestora,
@WebParam(name = “DireccionCliente”, targetNamespace = “”)
java.lang.String direccionCliente,
@WebParam(name = “EsCompania”, targetNamespace = “”)
java.lang.String esCompania,
@WebParam(name = “GrupoEmpresas”, targetNamespace = “”)
java.lang.String grupoEmpresas,
@WebParam(name = “IdCliente”, targetNamespace = “”)
java.lang.String idCliente,
@WebParam(name = “MaxReg”, targetNamespace = “”)
java.lang.String maxReg,
@WebParam(name = “MunicipioCliente”, targetNamespace = “”)
java.lang.String municipioCliente,
@WebParam(name = “Nombre”, targetNamespace = “”)
java.lang.String nombre,
@WebParam(name = “NumeroEdifCliente”, targetNamespace = “”)
java.lang.String numeroEdifCliente,
@WebParam(name = “NumeroPisoCliente”, targetNamespace = “”)
java.lang.String numeroPisoCliente,
@WebParam(name = “PaisCliente”, targetNamespace = “”)
java.lang.String paisCliente,
@WebParam(name = “Poblacion”, targetNamespace = “”)
java.lang.String poblacion,
@WebParam(name = “ProvinciaCliente”, targetNamespace = “”)
java.lang.String provinciaCliente,
@WebParam(name = “TipoCompania”, targetNamespace = “”)
java.lang.String tipoCompania,
@WebParam(name = “TipoInterlocutor”, targetNamespace  </a> <http://> = “”)
java.lang.String tipoInterlocutor,
@WebParam(name = “TipoViaCliente”, targetNamespace = “”)
java.lang.String tipoViaCliente,
@WebParam(mode = WebParam.Mode.OUT, name = “Clientes”, targetNamespace = “”)
javax.xml.ws.Holder clientes,
@WebParam(mode = WebParam.Mode.OUT, name = “Mensaje”, targetNamespace = “”)
javax.xml.ws.Holder mensaje,
@WebParam(mode = WebParam.Mode.OUT, name = “Resultado”, targetNamespace =
“”)
javax.xml.ws.Holder resultado
);
}
I’m looking for the cause of the problem, and find nothing, because
customers axis and soapUI works. Looking online there were people that had
this failure response and they made implicit reference to the soap header.
If you need to send you the wsdl, give me a contact email and I’ll pass, I
need help please.



--
View this message in context: http://cxf.547215.n5.nabble.com/Problem-with-ResponseWrapper-in-authentication-client-CXF-tp5746244.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Problem with @ResponseWrapper in authentication client CXF

Posted by Daniel Kulp <dk...@apache.org>.
This looks like the service is not responding with a valid message according to it’s own schema/wsdl. 

Assuming the annotation is generated correctly from the wsdl, the child element of the soap:Body should be ZsdClientesGetResponse.   The @ResponseWrapper shows that.  Double check your wsdl to make sure the <part>  element attribute is specifying the ZsdClientesGetResponse element.   If not, that would be a code generation issue and I’d like to see the WSDL.

Assuming the WSDL says that it should be ZsdClientesGetResponse, then the server is apparently returning an invalid response.   From the error, the server is returning “ZsdClientesGet”, not “ZsdClientesGetResponse”.   That would be a bug on the server side.


Dan



On Jul 9, 2014, at 4:57 PM, Teresa <te...@gmail.com> wrote:

> Hi Daniel,
> I have a problem with CXF, namely to generate a java client. CFX version is
> 3.0.0.
> This client is authenticated and the BindingProvider use for it, running
> without problem. The failure occurs when the answer turns, I siguiete
> obtendiendo the exception:
> Caused by: org.apache.cxf.interceptor.Fault: Unexpected wrapper element
> {urn:sap-com:document:sap:soap:functions:mc-style}ZsdClientesGet found.
> Expected
> {urn:sap-com:document:sap:soap:functions:mc-style}ZsdClientesGetResponse.
> at
> org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:105)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doInterceptStartingAt(PhaseInterceptorChain.java:456)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at
> org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleAbort(SOAPHandlerInterceptor.java:208)
> at
> org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessageInternal(SOAPHandlerInterceptor.java:170)
> at
> org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.access$000(SOAPHandlerInterceptor.java:71)
> at org.apache.cxf.jaxws.handler.soap.SOAPHa
> Self-generated service interface is as follows:
> @WebService(targetNamespace =
> “urn:sap-com:document:sap:soap:functions:mc-style”, name =
> “ZSD_CLIENTES_GET”)
> @XmlSeeAlso({ObjectFactory.class})
> public interface ZSDCLIENTESGET {
> @RequestWrapper(localName = “ZsdClientesGet”, targetNamespace =
> “urn:sap-com:document:sap:soap:functions:mc-style”, className =
> “com.sgae.dedalo.ws.client.sap.ZsdClientesGet_Type”)
> @WebMethod(operationName = “ZsdClientesGet”, action =
> “urn:sap-com:document:sap:soap:functions:mc-style:ZSD_CLIENTES_GET:ZsdClientesGetRequest”)
> @ResponseWrapper(localName = “ZsdClientesGetResponse”, targetNamespace =
> “urn:sap-com:document:sap:soap:functions:mc-style”, className =
> “com.sgae.dedalo.ws.client.sap.ZsdClientesGetResponse”)
> public void zsdClientesGet(
> @WebParam(name = “Apellidos”, targetNamespace = “”)
> java.lang.String apellidos,
> @WebParam(name = “CodigoFiscal”, targetNamespace = “”)
> java.lang.String codigoFiscal,
> @WebParam(name = “CodigoPostal”, targetNamespace = “”)
> java.lang.String codigoPostal,
> @WebParam(name = “DelegacionGestora”, targetNamespace = “”)
> java.lang.String delegacionGestora,
> @WebParam(name = “DireccionCliente”, targetNamespace = “”)
> java.lang.String direccionCliente,
> @WebParam(name = “EsCompania”, targetNamespace = “”)
> java.lang.String esCompania,
> @WebParam(name = “GrupoEmpresas”, targetNamespace = “”)
> java.lang.String grupoEmpresas,
> @WebParam(name = “IdCliente”, targetNamespace = “”)
> java.lang.String idCliente,
> @WebParam(name = “MaxReg”, targetNamespace = “”)
> java.lang.String maxReg,
> @WebParam(name = “MunicipioCliente”, targetNamespace = “”)
> java.lang.String municipioCliente,
> @WebParam(name = “Nombre”, targetNamespace = “”)
> java.lang.String nombre,
> @WebParam(name = “NumeroEdifCliente”, targetNamespace = “”)
> java.lang.String numeroEdifCliente,
> @WebParam(name = “NumeroPisoCliente”, targetNamespace = “”)
> java.lang.String numeroPisoCliente,
> @WebParam(name = “PaisCliente”, targetNamespace = “”)
> java.lang.String paisCliente,
> @WebParam(name = “Poblacion”, targetNamespace = “”)
> java.lang.String poblacion,
> @WebParam(name = “ProvinciaCliente”, targetNamespace = “”)
> java.lang.String provinciaCliente,
> @WebParam(name = “TipoCompania”, targetNamespace = “”)
> java.lang.String tipoCompania,
> @WebParam(name = “TipoInterlocutor”, targetNamespace  </a> <http://> = “”)
> java.lang.String tipoInterlocutor,
> @WebParam(name = “TipoViaCliente”, targetNamespace = “”)
> java.lang.String tipoViaCliente,
> @WebParam(mode = WebParam.Mode.OUT, name = “Clientes”, targetNamespace = “”)
> javax.xml.ws.Holder clientes,
> @WebParam(mode = WebParam.Mode.OUT, name = “Mensaje”, targetNamespace = “”)
> javax.xml.ws.Holder mensaje,
> @WebParam(mode = WebParam.Mode.OUT, name = “Resultado”, targetNamespace =
> “”)
> javax.xml.ws.Holder resultado
> );
> }
> I’m looking for the cause of the problem, and find nothing, because
> customers axis and soapUI works. Looking online there were people that had
> this failure response and they made implicit reference to the soap header.
> If you need to send you the wsdl, give me a contact email and I’ll pass, I
> need help please.
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Problem-with-ResponseWrapper-in-authentication-client-CXF-tp5746244.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com