Package org.codehaus.xfire.service

Examples of org.codehaus.xfire.service.MessagePartContainer


       
        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


        AbstractSoapBinding soapBinding = (AbstractSoapBinding) service.getBindings().iterator().next();
        assertNotNull(soapBinding);
        assertEquals("literal", soapBinding.getUse());
        assertEquals("", soapBinding.getSoapAction(opInfo));
       
        MessagePartContainer c = soapBinding.getHeaders(opInfo.getInputMessage());
        assertEquals(1, c.getMessageParts().size());
        part = c.getMessagePart(new QName("urn:Echo", "echoHeader"));
        assertNotNull(part);
       
        Collection endpoints = service.getEndpoints();
        assertEquals(1, endpoints.size());
       
View Full Code Here

   
    protected void configureHeaders(Service service, OperationInfo op, Binding b)
    {
        Method method = op.getMethod();
        Class[] paramClasses = method.getParameterTypes();
        MessagePartContainer inHeaders = b.getHeaders(op.getInputMessage());
        MessagePartContainer outHeaders = null;
        if (op.hasOutput()) outHeaders = b.getHeaders(op.getOutputMessage());
       
        for (int j = 0; j < paramClasses.length; j++)
        {
            if (!paramClasses[j].equals(MessageContext.class) && isHeader(method, j))
            {
                final QName q = getInParameterName(service, op, method, j, false);
               
                if (isOutParam(method, j))
                {
                    MessagePartInfo part = outHeaders.getMessagePart(q);
                    if (part == null)
                        throw new XFireRuntimeException("Could not find header " + q + " in wsdl for operation " + op.getName());
                   
                    part.setTypeClass(paramClasses[j]);
                    part.setIndex(j);
View Full Code Here

    {
        Method method = op.getMethod();
        Class[] paramClasses = method.getParameterTypes();
        boolean isDoc = binding.getStyle().equals(SoapConstants.STYLE_DOCUMENT);
       
        MessagePartContainer inParts = binding.getHeaders(op.getInputMessage());
        MessagePartContainer outParts = null;
        if (op.hasOutput()) outParts = binding.getHeaders(op.getOutputMessage());

        for (int j = 0; j < paramClasses.length; j++)
        {
            if (!paramClasses[j].equals(MessageContext.class) && isHeader(method, j))
            {
                if (isOutParam(method, j))
                {
                    QName q = getOutParameterName(binding.getService(), op, method, j, isDoc);
                    outParts.addMessagePart(q, paramClasses[j]).setIndex(j);
                }
               
                if (isInParam(method, j))
                {
                    QName q  = getInParameterName(binding.getService(), op, method, j, isDoc);
                    inParts.addMessagePart(q, paramClasses[j]).setIndex(j);
                }
            }
        }
       
        Class returnType = method.getReturnType();
        if (isHeader(method, -1))
        {
            if (isOutParam(method, -1))
            {
                QName q = getOutParameterName(binding.getService(), op, method, -1, isDoc);
                outParts.addMessagePart(q, returnType).setIndex(-1);
            }
           
            if (isInParam(method, -1))
            {
                QName q  = getInParameterName(binding.getService(), op, method, -1, isDoc);
View Full Code Here

            // read in the headers
            Binding binding = context.getBinding();
           
            MessageInfo msg = AbstractBinding.getIncomingMessageInfo(context);
            MessageInfo outMsg = AbstractBinding.getOutgoingMessageInfo(context);
            MessagePartContainer headerMsg = binding.getHeaders(msg);
            MessagePartContainer outHeaderMsg = null;
            if (outMsg != null) outHeaderMsg = binding.getHeaders(outMsg);
           
            final Object[] paramArray = fillInHolders(context, operation, msg, outMsg, headerMsg, outHeaderMsg, params);
            context.getInMessage().setBody(paramArray);
           
View Full Code Here

    }
   
    public static void writeHeaders(MessageContext context, Object responseValue) throws XFireFault, XMLStreamException
    {
        MessageInfo msgInfo = AbstractBinding.getOutgoingMessageInfo(context);
        MessagePartContainer headers = context.getBinding().getHeaders(msgInfo);
        if (headers.size() == 0) return;
        Object[] body = (Object[]) context.getCurrentMessage().getBody();
       
        JDOMStreamWriter writer = new JDOMStreamWriter(context.getOutMessage().getOrCreateHeader());
        for (Iterator itr = headers.getMessageParts().iterator(); itr.hasNext();)
        {
            MessagePartInfo part = (MessagePartInfo) itr.next();
           
            Object value;
            if (part.getIndex() == -1)
View Full Code Here

TOP

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

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.