FileDocCategorySizeDatePackage
JBITransportPipe.javaAPI DocGlassfish v2 API4487Fri May 04 22:30:26 BST 2007com.sun.enterprise.jbi.serviceengine.bridge.transport

JBITransportPipe

public class JBITransportPipe extends com.sun.xml.ws.api.pipe.helper.AbstractPipeImpl
This is the main Pipe that is used by JAX-WS client runtime to sendRequest the request to the service and return the response back to the client.
author
Vikas Awasthi

Fields Summary
private URL
wsdlLocation
private QName
service
private com.sun.xml.ws.api.model.wsdl.WSDLPort
wsdlPort
Constructors Summary
public JBITransportPipe(com.sun.xml.ws.api.WSBinding binding, URL wsdlLocation, QName service, com.sun.xml.ws.api.model.wsdl.WSDLPort wsdlPort)

        /*
        StreamSOAPCodec xmlEnvCodec =
            Codecs.createSOAPEnvelopeXmlCodec(binding.getSOAPVersion());
        codec = Codecs.createSOAPBindingCodec(binding, xmlEnvCodec);
         */
        this.wsdlLocation = wsdlLocation;
        this.service = service;
        this.wsdlPort = wsdlPort;
    
private JBITransportPipe(com.sun.xml.ws.api.pipe.Pipe that, com.sun.xml.ws.api.pipe.PipeCloner cloner)

        super(that, cloner);
    
Methods Summary
public com.sun.xml.ws.api.pipe.Pipecopy(com.sun.xml.ws.api.pipe.PipeCloner cloner)

        return new JBITransportPipe(this, cloner);
    
public com.sun.xml.ws.api.message.Packetprocess(com.sun.xml.ws.api.message.Packet request)

        try {
            // TODO get the oneway flag from the message
//            Boolean isOneway = request.getMessage().isOneWay(wSDLPort);
            boolean isOneWay = !request.expectReply;
            
            QName operation = request.getMessage().getOperation(wsdlPort).getName();
            String endpointName = wsdlPort.getName().getLocalPart();
            NMRClientConnection con =
                    new NMRClientConnection(wsdlLocation, service, endpointName, operation, isOneWay);

            con.initialize();
            con.sendRequest(request.getMessage());

            Message respMsg = con.receiveResponse();
            Packet reply = request.createResponse(respMsg);
            if(!isOneWay) {
                con.sendStatus();
            }

            return reply;
        } catch(Exception wex) {
            RuntimeException ex = new RuntimeException(wex.getMessage());
            ex.setStackTrace(wex.getStackTrace());
            throw ex;
        }