Package org.codehaus.xfire.service

Examples of org.codehaus.xfire.service.Binding


        OperationInfo operation = service.getServiceInfo().getOperation("echo");
       
        assertEquals(1, operation.getInputMessage().size());
        assertEquals(2, operation.getOutputMessage().size());
       
        Binding binding = service.getBinding(SoapHttpTransport.SOAP11_HTTP_BINDING);
        MessagePartContainer headers = binding.getHeaders(operation.getOutputMessage());
        assertEquals(1, headers.size());
       
        Document response =
                invokeService("MultipleOutService",
                              "/org/codehaus/xfire/inout/echo.xml");
View Full Code Here


        JDOMEndpoint peer = new JDOMEndpoint();
        channel1.setEndpoint(peer);
       
        Channel channel2 = transport2.createChannel("Echo");

        Binding binding = echo.getBinding(XMPPTransport.BINDING_ID);
        assertNotNull(binding);
       
        // Document to send
        StaxBuilder builder = new StaxBuilder();
        Document doc = builder.build(getResourceAsStream("/org/codehaus/xfire/xmpp/echo.xml"));
View Full Code Here

        getXFire().getServiceRegistry().register(service);
       
        OperationInfo op = (OperationInfo) service.getServiceInfo().getOperations().iterator().next();
        assertEquals(2, op.getInputMessage().getMessageParts().size());
       
        Binding binding = (Binding) service.getBindings().iterator().next();
        assertEquals(1, binding.getHeaders(op.getInputMessage()).getMessageParts().size());
       
        Document response = invokeService("HeaderService", "header.xml");
        assertNotNull(HeaderService.a);
        assertEquals("a", HeaderService.a.getName());
        assertNotNull(HeaderService.b);
View Full Code Here

            throw new XFireFault("Could not find a service to invoke.", XFireFault.SENDER);
        }
       
        // find a binding with that soap binding id
        // set the binding
        Binding binding =  c.getTransport().findBinding(context, service);
       
        if (binding == null)
        {
            throw new XFireFault("Could not find an appropriate Transport Binding to invoke.", XFireFault.SENDER);
        }
       
        if (!binding.isUndefinedEndpointAllowed())
        {
            boolean defined = false;
            for (Iterator itr = service.getEndpoints().iterator(); itr.hasNext();)
            {
                if (((Endpoint) itr.next()).getUrl().equals(c.getUri()))
View Full Code Here

    private Binding findBinding(Transport transport, Service service)
    {
        String[] ids = transport.getSupportedBindings();
        for (int i = 0; i < ids.length; i++)
        {
            Binding b = service.getBinding(ids[i]);
            if (b != null)
            {
                return b;
            }
        }
View Full Code Here

        Collection transports = xfire.getTransportManager().getTransportsForUri(url);

        if (transports.size() == 0)
            throw new XFireRuntimeException("No Transport is available for url " + url);
       
        Binding binding = null;
        Transport transport = null;
        for (Iterator itr = transports.iterator(); itr.hasNext() && binding == null;)
        {
            transport = (Transport) itr.next();
           
View Full Code Here

    }

    public Object create(Endpoint endpoint)
        throws MalformedURLException
    {
        Binding binding = endpoint.getBinding();
        Transport t = xfire.getTransportManager().getTransport(binding.getBindingId());
       
        if (t == null)
        {
            throw new XFireRuntimeException("Could not find transport for binding " +
                                            binding.getBindingId());
        }
       
        return create(new Client(t, endpoint));
    }
View Full Code Here

        javax.wsdl.Service wsdlService = def.createService();
        wsdlService.setQName(name);

        for (Iterator itr = service.getBindings().iterator(); itr.hasNext();)
        {
            Binding binding = (Binding) itr.next();

            javax.wsdl.Binding wbinding = binding.createBinding(this, portType);

            Port port = binding.createPort(this, wbinding);
            if (port != null)
            {
                wsdlService.addPort(port);
            }

            // Add in user defined endpoints
            Collection endpoints = service.getEndpoints(binding.getName());
            if (endpoints == null)
                continue;

            for (Iterator eitr = endpoints.iterator(); eitr.hasNext();)
            {
                Endpoint ep = (Endpoint) eitr.next();

                port = binding.createPort(ep, this, wbinding);
                if (port != null)
                {
                    wsdlService.addPort(port);
                }
            }
View Full Code Here

        throws Exception
    {
        if (context.getCurrentMessage().equals(context.getExchange().getInMessage()))
        {
            List body = (List) context.getCurrentMessage().getBody();
            Binding binding = context.getBinding();
            MessageInfo msgInfo = context.getExchange().getOperation().getOutputMessage();
            Object result = ServiceInvocationHandler.readHeaders(context,
                                                                 binding.getHeaders(msgInfo),
                                                                 (Object[]) context.getOutMessage().getBody());
           
            if (result != null)
            {
                body.add(result);
View Full Code Here

    public void generate(GenerationContext context, Service service)
        throws Exception
    {
        for (Iterator itr = service.getBindings().iterator(); itr.hasNext();)
        {
            Binding b = (Binding) itr.next();
            if (b instanceof AbstractSoapBinding)
            {
                generate(context, service, b);
            }
            else
            {
                log.info("Unknown binding: " + b.getClass().getName());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.service.Binding

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.