The operation property of the MessageContext may return wrong value if
erroneous request is sent
------------------------------------------------------------------------------------------------
Key: CXF-4115
URL: https://issues.apache.org/jira/browse/CXF-4115
Project: CXF
Issue Type: Bug
Components: JAX-WS Runtime
Affects Versions: 2.5.2
Reporter: Zsolt Beothy-Elo
Send a random request to a Provider based service. Retrieving the operation
property from the MessageContext within the invoke method always returns an
operation defined in the attached wsdl even if the the rquest is completely
unrelated, e.g. unknown SOAPAction, payload not matching any schema in the WSDL.
Expected behavior is to get back some undefined value, e.g. null, to indicate
the requested operation could not be determined.
Attached is the slightly modified jaxws_dispatch_provider sample. The changes
were basically made in demo.hwDispatch.server.GreeterSoapMessageProvider:
{code:title=GreeterSoapMessageProvider.java}
@WebServiceProvider(portName = "SoapPort1", serviceName = "SOAPService1",
targetNamespace =
"http://apache.org/hello_world_soap_http",
wsdlLocation = "wsdl/hello_world.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
public class GreeterSoapMessageProvider implements Provider<SOAPMessage> {
@Resource
private WebServiceContext context;
public SOAPMessage invoke(SOAPMessage request) {
QName opName = (QName)
context.getMessageContext().get(MessageContext.WSDL_OPERATION);
System.out.println("Incoming Client Request as a SOAPMessage calling
operation " + opName);
...
{code}
If sending the request attached in the output of the console is:
{{monospaced}}Incoming Client Request as a SOAPMessage calling operation
{http://apache.org/hello_world_soap_http}greetMe{{monospaced}}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira