Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4115

The operation property of the MessageContext may return wrong value if erroneous request is sent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.2
    • 2.3.10, 2.4.7, 2.5.3
    • JAX-WS Runtime
    • None
    • Unknown

    Description

      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:

      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);
      
      ...
      

      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}}

      Attachments

        1. jaxws_dispatch_provider.zip
          9 kB
          Zsolt Beothy-Elo
        2. request.txt
          0.5 kB
          Zsolt Beothy-Elo

        Issue Links

          Activity

            People

              dkulp Daniel Kulp
              zbeothy Zsolt Beothy-Elo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: