7 Replies Latest reply on Sep 28, 2005 6:06 PM by thomas.diesler

    soap client code getting items in the message context for th

    acxsjones

      Is there a way to get an item in the MessageContext for a handler to look at. This is from the client code that is calling the gnerated code.

       HelloWorld_Impl service = new HelloWorld_Impl();
       HelloWorldEndpoint endPoint = service.getHelloWorldEndpointPort();
      
       Stub stub = (Stub) endPoint;
      
       stub._setProperty(Stub.USERNAME_PROPERTY, "scott");
       stub._setProperty(Stub.PASSWORD_PROPERTY, "password");
       stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:7070/helloworld/1.0");
      
       try {
       String output = endPoint.hello("Scott");
      
       } catch (RemoteException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       super.fail("exception caught in test case");
       }
      


      I know how to get a hold of the message context from the ejb that is called
       SOAPMessageContext msgContext = (SOAPMessageContext)_ctx.getMessageContext();
       SOAPMessage soapMessage = msgContext.getMessage();
       SOAPHeader soapHeader;
       try {
       soapHeader = soapMessage.getSOAPHeader();
       Iterator it = soapHeader.extractAllHeaderElements();
       if (it.hasNext() == false)
       log.info("No header elements");
       }
      


      I need to place something in the context or some way to pass something to one of my handlers