You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Malcolm Wang (Jira)" <ji...@apache.org> on 2022/03/10 10:11:00 UTC

[jira] [Created] (CXF-8676) Parameter targetNamespace of WebResult annotation is not supported. Problem with empty response targetNamespace

Malcolm Wang created CXF-8676:
---------------------------------

             Summary: Parameter targetNamespace of WebResult annotation is not supported. Problem with empty response targetNamespace
                 Key: CXF-8676
                 URL: https://issues.apache.org/jira/browse/CXF-8676
             Project: CXF
          Issue Type: Bug
    Affects Versions: 3.5.1
            Reporter: Malcolm Wang


In class "org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" method "QName getOutPartName(OperationInfo op, Method method, int paramNumber)" parameter targetNamespace of annotation WebResult is not readed and returned in QName object.

For example targetNamespace parameter of WebResult is used in method "QName getOutParameterName(OperationInfo op, Method method, int paramNumber)" of the same class.

 

Due to this problem soap cxf client can not communicate with SOAP WS whitch have empty targetnamespace in response object (for example when bindings soap style="document"). WS service interface example:
{code:java}
@WebService(
targetNamespace = "http://sample.com",
name = "Sample"
)
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(
parameterStyle = ParameterStyle.BARE
)
public interface Sample{

@WebMethod(
action = "sample"
)
@WebResult(
name = "sampleReturn",
targetNamespace = "",
partName = "sampleReturn"
)
String sample();
} {code}
 

Code throws Exception
{code:java}
org.apache.cxf.interceptor.Fault: Unexpected element sampleReturn found.   Expected {http://sample.com}sampleReturn.
    at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.validatePart(DocLiteralInInterceptor.java:279)
    at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:189)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:829)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1701)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1570)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1371)
    at org.apache.cxf.ext.logging.LoggingOutputStream.postClose(LoggingOutputStream.java:53)
    at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:228)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:528)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:439)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:354)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:312)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140) {code}
 

 

In current CXF version (3.5.1) I have to set enpoint property ""soap.no.validate.parts": "true"  to allow communicate with this WS.

 

The same problem was described in StackOverflow: https://stackoverflow.com/questions/44386088/how-to-configure-empty-targetnamespace-in-the-web-service



--
This message was sent by Atlassian Jira
(v8.20.1#820001)