xwss
  1. xwss
  2. XWSS-23

Please backport NPE fix in XWSSClientPipe to Metro 1.0.x branch

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      23

      Description

      Using the Metro 1.0.1 FCS release, when trying to add a WSS username and
      password header to a client request that has been created using the Dispatch API
      and does NOT reference a WSDL file, I run into the following NullPointerException:

      Exception in thread "main" java.lang.NullPointerException
      at com.sun.xml.ws.api.message.Message.getOperation(Message.java:281)
      at com.sun.xml.xwss.XWSSClientPipe.secureRequest(XWSSClientPipe.java:258)
      at com.sun.xml.xwss.XWSSClientPipe.process(XWSSClientPipe.java:143)
      at
      com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
      at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
      at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
      at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
      at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
      at com.sun.xml.ws.client.Stub.process(Stub.java:248)
      at
      com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:180)
      at com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:206)
      at
      com.sun.germany.vine2.troubleTicket.client.TroubleTicketClientImpl.call(TroubleTicketClientImpl.java:63)
      at
      com.sun.germany.vine2.troubleTicket.client.TroubleTicketClientProxy.call(TroubleTicketClientProxy.java:105)
      at
      com.sun.germany.vine2.troubleTicket.client.test.TroubleTicketClientTest.main(TroubleTicketClientTest.java:108)

      Client code fragment looks like the following:

      Service service = Service.create(serviceName);
      service.addPort(portName, soapBinding, webserviceURL.toExternalForm());
      Source request = new StreamSource(new
      ByteArrayInputStream(messageBody));
      Dispatch<Source> dispatch = service.createDispatch(portName,
      Source.class, Service.Mode.PAYLOAD);
      WSBindingProvider bp = (WSBindingProvider) dispatch;
      XWSSecurityConfiguration securityConfig =
      SecurityConfigurationFactory.newXWSSecurityConfiguration(Thread.currentThread().getContextClassLoader().getResourceAsStream("/xwss-client-config.xml"));
      Map <String, Object> requestCtx = dispatch.getRequestContext();

      requestCtx.put(XWSSecurityConfiguration.MESSAGE_SECURITY_CONFIGURATION,
      securityConfig);
      requestCtx.put(BindingProviderProperties.CONNECT_TIMEOUT,
      connectTimeout);
      requestCtx.put(BindingProviderProperties.REQUEST_TIMEOUT, readTimeout);
      requestCtx.put(Dispatch.ENDPOINT_ADDRESS_PROPERTY,
      webserviceURL.toExternalForm());
      Source response = dispatch.invoke(request);

      The exact same client code works fine using Metro 1.1 FCS.

      From looking at the XWSS source code for com.sun.xml.xwss.XWSSClientPipe, it
      seems like it would be sufficient to backport the changes made between CVS
      revision 2.5.6.1 (WSIT-1_0-FCS-BRANCH) and revision 1.8 to the WSIT-1_0-FCS-BRANCH.

      In my current customer scenario, using Metro 1.1 is not an option, as we have to
      use an officially supported Metro build from the 1.0.x branch.

      Many thanks in advance!

      Best regards,

      Andreas


      Andreas Loew
      Java Architect
      Sun Microsystems (Germany)

        Activity

        Hide
        al130959 added a comment -

        Setting to P1 to clarify its importance for our customer scenario (cf. internal
        mail).

        Show
        al130959 added a comment - Setting to P1 to clarify its importance for our customer scenario (cf. internal mail).
        Hide
        kumarjayanti added a comment -

        checked in the fix to XWSS : WSIT-1_0-FCS-BRANCH Branch.

        Show
        kumarjayanti added a comment - checked in the fix to XWSS : WSIT-1 _0-FCS-BRANCH Branch.

          People

          • Assignee:
            kumarjayanti
            Reporter:
            al130959
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: