Package com.sun.xml.ws.api.message

Examples of com.sun.xml.ws.api.message.Message


     private boolean putSOAPInPacket(SOAPMessage m, Object p) {
   if (m == null) {
       ((Packet)p).setMessage(null);
   } else {
       Message msg = Messages.create(m);
       ((Packet)p).setMessage(msg);
   }
   return true;
     }
View Full Code Here


    }
   
    // Direct invocation is not implemented in the consumer side.
   
    public void send(Packet packet, EndpointMetaData emd) throws Exception {
        Message message = packet.getMessage();
        String operationName = me.getOperation().getLocalPart();
        WrappedMessage wrappedMessage = new WrappedMessage();
        wrappedMessage.setAbstractMessage(message);
       
        if(message.isFault()) {
            wrappedMessage.wrapFault(operationName, emd);
        } else {
            wrappedMessage.setWSDLBindingStyle(emd.getBindingStyle(operationName));
            wrappedMessage.setWSDLMessageType(emd.getInputMessage(operationName).getQName());
            wrappedMessage.setWSDLMessageName(emd.getOperationInputName(operationName));
            wrappedMessage.setWSDLOrderedParts(emd.getInputMessage(operationName).getOrderedParts(null));
            wrappedMessage.setWSDLPartBindings(emd.getInputPartBindings(operationName));
            wrappedMessage.wrap();
        }
        msg = me.createMessage();
        msg.setContent(wrappedMessage.readPayloadAsSource());
       
        /**
         * Process the attachments.
         */
        for(Attachment attachment : (Iterable<Attachment>)message.getAttachments()) {
            logger.log(Level.FINE, "Adding attachment to Normalized Message, attachmentID = "
                    + attachment.getContentId());
            msg.addAttachment(attachment.getContentId(), attachment.asDataHandler());
        }
        setMessageProperties(packet.invocationProperties);
View Full Code Here

        me.setStatus(ExchangeStatus.DONE);
        send();
    }
   
    public void send(Packet packet, EndpointMetaData emd) throws Exception {
        Message abstractMessage = packet.getMessage();
        if(abstractMessage != null && abstractMessage.isFault()) {
            Exception exObj = null;
            try {
                String operationName = me.getOperation().getLocalPart();
                WrappedMessage wrappedMessage = new WrappedMessage();
                wrappedMessage.setAbstractMessage(abstractMessage);
View Full Code Here

        meTransport = MessageExchangeTransportFactory.getHandler(me);
    }

    public Packet receiveRequest() {
        Packet packet = new Packet();
        Message message = meTransport.receive(endpt.getEndpointMetaData());
        packet.setMessage(message);
        if(packet.invocationProperties != null) {
            packet.invocationProperties.putAll(meTransport.getMessageProperties());
        }
        return packet;
View Full Code Here

    /**
     * @param request packet is used only for construction of response packet.
     * @return response packet.
     */
    public Packet receiveResponse(Packet request) {
        Message respMsg = meTransport.receive(getEndpointMetaData());
        Packet reply = request.createResponse(respMsg);
        if(reply.invocationProperties != null) {
            //TODO :: should we first clear the invocationProperties inherited from request packet?
            reply.invocationProperties.putAll(meTransport.getMessageProperties());
        }
View Full Code Here

   return response.createResponse(Messages.create(t, this.soapVersion));
    }
   
    public boolean isTwoWay(boolean twoWayIsDefault, Packet request) {
   boolean twoWay = twoWayIsDefault;
   Message m = request.getMessage();
   if (m != null) {
      WSDLPort wsdlModel =
    (WSDLPort) getProperty(PipeConstants.WSDL_MODEL);
      if (wsdlModel != null) {
    twoWay = (m.isOneWay(wsdlModel) ? false : true);
      }
  }
   return twoWay;
    }
View Full Code Here

    
    @Override
    public NextAction processResponse(Packet response) {
        try {
            // check for response
            Message m = response.getMessage();
            if (m != null) {
                if (cAC != null) {
                    AuthStatus status;
                    info.setResponsePacket(response);
                    try {
View Full Code Here

       
  // send the request
  Packet response = next.process(info.getRequestPacket());
 
         // check for response
        Message m = response.getMessage();

        if (m != null) {

            if (cAC != null) {
View Full Code Here

        String rvalue = null;
        if (messageInfo instanceof PacketMessageInfo) {
            PacketMessageInfo pmi = (PacketMessageInfo) messageInfo;
            Packet p = (Packet) pmi.getRequestPacket();
            if (p != null) {
                Message m = p.getMessage();
                if (m != null) {
                    WSDLPort port =
                            (WSDLPort) messageInfo.getMap().get("WSDL_MODEL");
                    if (port != null) {
                        WSDLBoundOperation w = m.getOperation(port);
                        if (w != null) {
                            QName n = w.getName();
                            if (n != null) {
                                rvalue = n.getLocalPart();
                            }
View Full Code Here

        SOAPMessage soapMsg = null;
        try {
            //before converting to SOAPMessage, make a copy.  We don't want to consume
            //the original message
            if (packet.getMessage() != null) {
                Message mutable = packet.getMessage().copy();
                soapMsg = mutable.readAsSOAPMessage();
            }

        } catch (Exception e) {
            logger.log(Level.SEVERE, LogUtils.ERROR_OCCURED, e);
        }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.api.message.Message

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.