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

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


            boolean isFastInfoset, boolean useFastInfoset, WSBinding binding) {
        try {
            if (isFastInfoset && !useFastInfoset) {
                // Convert from Fast Infoset to XML
                Codec codec = new XMLHTTPBindingCodec(binding);
                Packet p = new Packet();
                codec.decode(in.getInputStream(), in.getContentType(), p);
               
                p.getMessage().getAttachments();
                codec.getStaticContentType(p);
               
                ByteArrayBuffer bos = new ByteArrayBuffer();
                ContentType ct = codec.encode(p, bos);
                return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());
            } else if (!isFastInfoset && useFastInfoset) {
                // Convert from XML to Fast Infoset
                Codec codec = new XMLHTTPBindingCodec(binding);
                Packet p = new Packet();
                codec.decode(in.getInputStream(), in.getContentType(), p);
               
                p.contentNegotiation = ContentNegotiation.optimistic;
                p.getMessage().getAttachments();
                codec.getStaticContentType(p);
               
                ByteArrayBuffer bos = new ByteArrayBuffer();
                com.sun.xml.ws.api.pipe.ContentType ct = codec.encode(p, bos);
                return XMLMessage.createDataSource(ct.getContentType(), bos.newInputStream());               
View Full Code Here


  // wrap throwable in WebServiceException, if necessary
  if (!(t instanceof WebServiceException)) {
      t = (Throwable) new WebServiceException(t);
  }
   if (response == null) {
       response = new Packet();
    }
  // try to create fault in provided response packet, if an exception
  // is thrown, create new packet, and create fault in it.
  try {
      return response.createResponse(Messages.create(t, this.soapVersion));
  } catch (Exception e) {
      response = new Packet();
  }
   return response.createResponse(Messages.create(t, this.soapVersion));
    }
View Full Code Here

      // exception is consumed, and twoWay is assumed
   }
  if (twoWay) {
      return makeFaultResponse(response,t);
   } else {
      return new Packet();
  }
    }
View Full Code Here

  // wrap throwable in WebServiceException, if necessary
  if (!(t instanceof WebServiceException)) {
      t = (Throwable) new WebServiceException(t);
  }
   if (response == null) {
       response = new Packet();
    }
  // try to create fault in provided response packet, if an exception
  // is thrown, create new packet, and create fault in it.
  try {
      return response.createResponse(Messages.create(t, this.soapVersion));
  } catch (Exception e) {
      response = new Packet();
  }
   return response.createResponse(Messages.create(t, this.soapVersion));
    }
View Full Code Here

      // exception is consumed, and twoWay is assumed
   }
  if (twoWay) {
      return makeFaultResponse(response,t);
   } else {
      return new Packet();
  }
    }
View Full Code Here

    @Override
    public void preDestroy() {
        //Give the AuthContext a chance to cleanup
        //create a dummy request packet
        try {
            Packet request = new Packet();
            PacketMessageInfo info = new PacketMapMessageInfo(request, new Packet());
            Subject subj = getClientSubject(request);
            ClientAuthContext cAC = helper.getClientAuthContext(info, subj);
             if (cAC != null && WSIT_CLIENT_AUTH_CONTEXT.equals(cAC.getClass().getName())) {
                cAC.cleanSubject(info, subj);
            }
View Full Code Here

   if(isHttpBinding) {
       return next.process(request);
   }
        */

  PacketMessageInfo info= new PacketMapMessageInfo(request,new Packet());
       
        info.getMap().put(javax.xml.ws.Endpoint.WSDL_SERVICE,
            helper.getProperty(PipeConstants.WSDL_SERVICE));

        AuthStatus status = AuthStatus.SEND_SUCCESS;

  Subject clientSubject = getClientSubject(request);

  ClientAuthContext cAC = null;

  try {

      cAC = helper.getClientAuthContext(info,clientSubject);

      if (cAC != null) {

    // proceed to process message sescurity
    status = cAC.secureRequest(info, clientSubject);
      }

  } catch(Exception e) {

      _logger.log(Level.SEVERE,"ws.error_secure_request", e);
     
      throw new WebServiceException
    (localStrings.getLocalString
     ("enterprise.webservice.cantSecureRequst",
      "Cannot secure request for {0}",
      new Object[] { helper.getModelName() }),e);
  }

  Packet response;

  if (status == AuthStatus.FAILURE) {
      if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"ws.status_secure_request", status);
      }
View Full Code Here

    private Packet processSecureRequest(PacketMessageInfo info,
  ClientAuthContext cAC, Subject clientSubject)
  throws WebServiceException {
       
  // 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

     
    @Override
    public JAXBElement startSecureConversation(Packet packet)
            throws WSSecureConversationException {

  PacketMessageInfo info = new PacketMapMessageInfo(packet,new Packet());
  JAXBElement token = null;

  try {

      // gets the subject from the packet (puts one there if not found)
View Full Code Here

        // make this more efficient by operating on packet
        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);
View Full Code Here

TOP

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

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.