Package javax.xml.rpc.handler.soap

Examples of javax.xml.rpc.handler.soap.SOAPMessageContext


      // Verify parameter was actually an attachment
      String attachedStr = null;
      try
      {
         SOAPMessageContext msgContext = (SOAPMessageContext)sepCtx.getMessageContext();
         AttachmentPart part = (AttachmentPart)msgContext.getMessage().getAttachments().next();
         attachedStr = (String)part.getContent();
      }
      catch (SOAPException ex)
      {
         throw new RuntimeException(ex);
View Full Code Here


   public void setReturnValue(Object value)
   {
      EndpointInvocation epInv = getEndpointInvocation();
      epInv.setReturnValue(value);

      SOAPMessageContext msgContext = (SOAPMessageContext)getInvocationContext().getAttachment(javax.xml.rpc.handler.MessageContext.class);
      if (msgContext != null && msgContext.getMessage() == null)
      {
         try
         {
            // Bind the response message
            OperationMetaData opMetaData = epInv.getOperationMetaData();
            CommonBindingProvider bindingProvider = new CommonBindingProvider(opMetaData.getEndpointMetaData());
            CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
            SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
            msgContext.setMessage(resMessage);
         }
         catch (BindingException ex)
         {
            WSException.rethrow(ex);
         }
View Full Code Here

   public void setReturnValue(Object value)
   {
      EndpointInvocation epInv = getEndpointInvocation();
      epInv.setReturnValue(value);

      SOAPMessageContext msgContext = (SOAPMessageContext)getInvocationContext().getAttachment(javax.xml.rpc.handler.MessageContext.class);
      if (msgContext != null && msgContext.getMessage() == null)
      {
         try
         {
            // Bind the response message
            OperationMetaData opMetaData = epInv.getOperationMetaData();
            CommonBindingProvider bindingProvider = new CommonBindingProvider(opMetaData.getEndpointMetaData());
            CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
            SOAPMessage resMessage = (SOAPMessage)binding.bindResponseMessage(opMetaData, epInv);
            msgContext.setMessage(resMessage);
         }
         catch (BindingException ex)
         {
            WSException.rethrow(ex);
         }
View Full Code Here

        private JAXRPCHandlersInterceptor() {}

        @Override
        public Object processInvocation(final InterceptorContext context) throws Exception {
            final SOAPMessageContext msgContext = (SOAPMessageContext) context.getPrivateData(MessageContext.class);
            final Invocation wsInvocation = (Invocation) context.getPrivateData(Invocation.class);
            final HandlerCallback callback = (HandlerCallback) context.getPrivateData(HandlerCallback.class);
            if (msgContext == null || callback == null || wsInvocation == null) {
                // not for us
                return context.proceed();
            }

            // Handlers need to be Tx. Therefore we must invoke the handler chain after the TransactionInterceptor.
            try {
                // call the request handlers
                boolean handlersPass = callback.callRequestHandlerChain(wsInvocation, HandlerType.ENDPOINT);
                handlersPass = handlersPass && callback.callRequestHandlerChain(wsInvocation, HandlerType.POST);

                // Call the next interceptor in the chain
                if (handlersPass) {
                    // The SOAPContentElements stored in the EndpointInvocation might have changed after
                    // handler processing. Get the updated request payload. This should be a noop if request
                    // handlers did not modify the incomming SOAP message.
                    final Object[] reqParams = wsInvocation.getArgs();
                    context.setParameters(reqParams);
                    final Object resObj = context.proceed();

                    // Setting the message to null should trigger binding of the response message
                    msgContext.setMessage(null);
                    wsInvocation.setReturnValue(resObj);
                }

                // call the response handlers
                handlersPass = callback.callResponseHandlerChain(wsInvocation, HandlerType.POST);
View Full Code Here

            throw new JAXRPCException(messageText, ex);
        }
    }

    public boolean handleFault(MessageContext _context) {
        SOAPMessageContext context = (SOAPMessageContext) _context;

        for (int i = size() - 1; i >= 0; i--)
            if (getHandlerInstance(i).handleFault(context) == false)
                return false;
        return true;
View Full Code Here

                return false;
        return true;
    }

    public boolean handleRequest(MessageContext _context) {
        SOAPMessageContext context = (SOAPMessageContext) _context;

        boolean processFault = false;

        for (int i = 0; i < size(); i++) {
            Handler currentHandler = getHandlerInstance(i);
View Full Code Here

   * @see javax.xml.rpc.handler.Handler#handleRequest(MessageContext)
   */
  public boolean handleRequest(MessageContext context) {
    System.out.println("Hey - in Handle request");
    try {
      SOAPMessageContext smc = (SOAPMessageContext) context;
      SOAPMessage msg = smc.getMessage();
      SOAPPart sp = msg.getSOAPPart();
      SOAPEnvelope se = sp.getEnvelope();
      SOAPHeader sh = se.getHeader();
      Name name =
      se.createName(
View Full Code Here

    System.out.println("Hey - in Handle response");
    try {
      String counter = null;
      String faultCounter = null;

      SOAPMessageContext smc = (SOAPMessageContext) context;
      SOAPMessage msg = smc.getMessage();
      SOAPPart sp = msg.getSOAPPart();
      SOAPEnvelope se = sp.getEnvelope();
      SOAPHeader sh = se.getHeader();
      SOAPBody sb = se.getBody();
      Name name =
View Full Code Here

   * @see javax.xml.rpc.handler.Handler#handleRequest(MessageContext)
   */
  public boolean handleRequest(MessageContext context) {
    System.out.println("Hey - in Handle request");
    try {
      SOAPMessageContext smc = (SOAPMessageContext) context;
      SOAPMessage msg = smc.getMessage();
      SOAPPart sp = msg.getSOAPPart();
      SOAPEnvelope se = sp.getEnvelope();
      SOAPHeader sh = se.getHeader();
      Name name = se.createName("HeaderTest", "AXIS",
                    "http://xml.apache.org/axis");
View Full Code Here

   */
  public boolean handleResponse(MessageContext context) {

    System.out.println("Hey - in Handle response");
    try {
      SOAPMessageContext smc = (SOAPMessageContext) context;
      SOAPMessage msg = smc.getMessage();
      SOAPPart sp = msg.getSOAPPart();
      SOAPEnvelope se = sp.getEnvelope();
      SOAPHeader sh = se.getHeader();
      Name name = se.createName("HeaderTest", "AXIS",
                    "http://xml.apache.org/axis");
View Full Code Here

TOP

Related Classes of javax.xml.rpc.handler.soap.SOAPMessageContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.