Package org.objectweb.celtix.bindings

Examples of org.objectweb.celtix.bindings.DataBindingCallback


    private void storeBindingInfo(MessageContext context) {
        assert !ContextUtils.isOutbound(context);
        AddressingProperties maps = ContextUtils.retrieveMAPs(context, false, false);
        AttributedURIType actionURI = null == maps ? null : maps.getAction();
        String action = null == actionURI ? null : actionURI.getValue();
        DataBindingCallback callback = null;
        String operationName = null;
        boolean rmProtocolMessage = true;

        if (RMUtils.getRMConstants().getCreateSequenceAction().equals(action)) {
            callback = CreateSequenceRequest.createDataBindingCallback();
View Full Code Here


    }

    private void setUpServerDispatch(
                            MessageContext bindingContext,
                            OutputStreamMessageContext outputStreamContext) {
        DataBindingCallback callback =
            control.createMock(ServerDataBindingCallback.class);
        bindingContext.get(DATABINDING_CALLBACK_PROPERTY);
        EasyMock.expectLastCall().andReturn(callback);
        OutputStream outputStream = control.createMock(OutputStream.class);
        outputStreamContext.getOutputStream();
View Full Code Here

       
        NodeList nl = msg.getRoot().getChildNodes();
        boolean matchFound = false;
       
        for (Map.Entry<QName, ? extends DataBindingCallback> entry : ops.entrySet()) {
            DataBindingCallback callback = entry.getValue();
            if (callback.getSOAPParameterStyle() == SOAPBinding.ParameterStyle.BARE) {
                int nodeIdx = 0;
                if (callback.getParamsLength() != 1) {
                    // If the size of part in message is not ONE,
                    // Then there is a root node as the wrapper.
                    Node node = NodeUtils.getChildElementNode(msg.getRoot());
                    if (callback.getOperationName().equals(node.getLocalName())) {
                        matchFound = true;
                    } else {
                        continue;
                    }
                }
               
                for (int x = 0; x < callback.getParamsLength(); x++) {
                    WebParam param = callback.getWebParam(x);
                    if (param.mode() != WebParam.Mode.OUT) {
                       
                        Node n = nl.item(nodeIdx);
                        while (n.getNodeType() != Node.ELEMENT_NODE) {
                            n = nl.item(++nodeIdx);
                        }

                        if (isMethodMatch(n, param)) {
                            matchFound = true;
                            ++nodeIdx;
                        } else {
                            matchFound = false;
                            break;
                        }
                    }
                }
                if (matchFound) {
                    return entry.getKey();
                }
            } else {
                //WRAPPED Style
                Node node = NodeUtils.getChildElementNode(msg.getRoot());
                QName rw = callback.getRequestWrapperQName();
                //Check for the RequestWrapper name followed by
                //Method Name (To avoid asyncronous operations)
                //The method name check can be removed once JSR181 comes up
                //with annotations for asynchronous operation. JAX-WS spec 2.3.4
                if (rw != null
                    && rw.getLocalPart().equals(node.getLocalName())
                    && rw.getNamespaceURI().equals(node.getNamespaceURI())
                    && callback.getOperationName().equalsIgnoreCase(node.getLocalName())) {
                    return entry.getKey();
                }
            }
        }
       
View Full Code Here

                Response response =
                    ((AbstractClientBinding)handler.getClientBinding())
                        .getResponseCorrelator().getResponse(request);
                response.setHandlerInvoker(request.getHandlerInvoker());
                MessageContext responseContext = response.getBindingMessageContext();
                DataBindingCallback responseCallback =
                    BindingContextUtils.retrieveDataBindingCallback(responseContext);
                response.processLogical(responseCallback);
            }
        } else {
            AddressingProperties maps =
View Full Code Here

        }
        QName firstNodeName = null;
        if (node != null) {
            firstNodeName = new QName(node.getNamespaceURI(), node.getLocalName());
            if (ops.containsKey(firstNodeName)) {
                DataBindingCallback cb = ops.get(firstNodeName);
                if (cb.getSOAPStyle() == SOAPBinding.Style.RPC) {
                    return firstNodeName;
                }
            }
        }

        for (Map.Entry<QName, ? extends DataBindingCallback> entry : ops.entrySet()) {
            DataBindingCallback cb = entry.getValue();
            if (cb.getSOAPStyle() == SOAPBinding.Style.RPC) {
                //RPC ones should already have been found
                continue;
            }
            if (cb.getSOAPParameterStyle() == SOAPBinding.ParameterStyle.BARE) {
                //unwrapped
                try {
                    NodeList nl = msg.getSOAPBody().getChildNodes();
                    NodeList hl = null;
                    if (msg.getSOAPHeader() != null) {
                        hl = msg.getSOAPHeader().getChildNodes();
                    }
                    if (matchParamsForDocLitBare(cb, nl, hl)) {
                        return entry.getKey();
                    }
                } catch (SOAPException e) {
                    //ignore?
                }
            } else {
                //wrapped
                if (firstNodeName != null
                    && firstNodeName.equals(cb.getRequestWrapperQName())) {
                    return entry.getKey();
                }
            }
        }
        if (firstNodeName != null
View Full Code Here

        Port port = def.getService(new QName("http://objectweb.org/hello_world_rpclit",
                                             "SOAPServiceRPCLit1")).getPort("SoapPortRPCLit1");
        WSDLMetaDataCache wsdl = new WSDLMetaDataCache(def, port);
       
        for (Method method : cls.getDeclaredMethods()) {
            DataBindingCallback c1 = new JAXBDataBindingCallback(method, Mode.PARTS, ctx);
            WSDLOperationInfo info = wsdl.getOperationInfo(c1.getOperationName());
            assertNotNull("Could not find operation info in wsdl: " + c1.getOperationName(), info);
            DataBindingCallback c2 = new WSDLOperationDataBindingCallback(info);
            compareDataBindingCallbacks(c1, c2);
        }
    }
View Full Code Here

        Port port = def.getService(new QName("http://objectweb.org/hello_world_doc_lit_bare",
                                             "SOAPService")).getPort("SoapPort");
        WSDLMetaDataCache wsdl = new WSDLMetaDataCache(def, port);
       
        for (Method method : cls.getDeclaredMethods()) {
            DataBindingCallback c1 = new JAXBDataBindingCallback(method, Mode.PARTS, ctx);
            WSDLOperationInfo info = wsdl.getOperationInfo(c1.getOperationName());
            assertNotNull("Could not find operation info in wsdl: " + c1.getOperationName(), info);
            DataBindingCallback c2 = new WSDLOperationDataBindingCallback(info);
            compareDataBindingCallbacks(c1, c2);
        }
    }
View Full Code Here

            aggregator.serverTransport = control.createMock(ServerTransport.class);
            OutputStreamMessageContext outputContext =
                control.createMock(OutputStreamMessageContext.class);
            aggregator.serverTransport.rebase(context, replyTo);
            EasyMock.expectLastCall().andReturn(outputContext);
            DataBindingCallback callback =
                new JAXBDataBindingCallback(null,
                                            DataBindingCallback.Mode.PARTS,
                                            ContextUtils.getJAXBContext());
            EasyMock.reportMatcher(new PartialResponseMatcher());
            EasyMock.reportMatcher(new PartialResponseMatcher());
View Full Code Here

        }

        objMsgContext.setMessageObjects(realArgs);

        boolean isOneway = opInfo.isOneWay();
        DataBindingCallback callback = new SCADataBindingCallback(opInfo, typeHelper,
                                                                  wsBinding.getResourceLoader(),
                                                                  hasInOut);

        try {
            if (isOneway) {
View Full Code Here

            QName operationName = new QName(request.operation());
            corbaCtx.put(MessageContext.WSDL_OPERATION, operationName);

            ObjectMessageContext objectCtx = serverBinding.createObjectContext();
            DataBindingCallback.Mode mode = sbeCallback.getServiceMode();
            DataBindingCallback callback =
                sbeCallback.getDataBindingCallback((QName)corbaCtx.get(MessageContext.WSDL_OPERATION),
                                                   objectCtx,
                                                   mode);
            callback.initObjectContext(objectCtx);
            objectCtx.putAll(corbaCtx);

            // Get the WSDL definition for the operation being invoked
            // TODO: Verify that two operations can't be overloaded.
            OperationType opElement = CorbaUtils.getCorbaOperationType(operationName.getLocalPart(),
                                                                       serverBinding.getBus(),
                                                                       serverBinding.getEndpointReference());
            if (opElement == null) {
                throw new CorbaBindingException("Unable to locate operation type definition");
            }

            List<ParamType> paramTypes = opElement.getParam();
            List<CorbaTypeMap> typeMaps =
                ((CorbaBindingImpl)serverBinding.getBindingImpl()).getCorbaTypeMaps();

            // Build a list of streamables that correspond to the values that should be contained in the
            // argument list of the ServerRequest, build the correct NVList and retreive the arguments
            CorbaStreamable[] arguments = new CorbaStreamable[paramTypes.size()];
            NVList list = prepareDIIArgsList(corbaCtx, objectCtx, arguments, paramTypes, typeMaps, callback);
            request.arguments(list);

            serverBinding.getBindingImpl().unmarshal(corbaCtx, objectCtx, callback);

            boolean isOneWay = callback.isOneWay();
            doCeltixInvocation(callback, objectCtx);

            corbaCtx.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);
            if (!isOneWay) {
                if (objectCtx.getException() != null) {
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.bindings.DataBindingCallback

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.