Examples of MessageFactory


Examples of javax.xml.soap.MessageFactory

    private SOAPMessage greetMeResponse;
   
    public HWSoapMessageDocProvider() {
      
        try {
            MessageFactory factory = MessageFactory.newInstance();           
            InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralResp.xml");
            greetMeResponse =  factory.createMessage(null, is);
            is.close();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
View Full Code Here

Examples of javax.xml.soap.MessageFactory

        if (isGET(message)) {
            return;
        }

        try {
            MessageFactory factory = getFactory(message);
            SOAPMessage soapMessage = factory.createMessage();
            message.setContent(SOAPMessage.class, soapMessage);
           
            SOAPPart part = soapMessage.getSOAPPart();
           
            Document node = (Document) message.getContent(Node.class);
View Full Code Here

Examples of javax.xml.soap.MessageFactory

      SubscribeResponseDocument.SubscribeResponse    sresres = null;
      try
      {
         //now call
         wsaSOAPConnection sconn = wsaSOAPConnection.newInstance(  );
         MessageFactory    mf    = MessageFactory.newInstance(  );
         SOAPMessage       soapm = mf.createMessage(  );

         //put XMLbean into SOAPBody
         soapm.getSOAPBody(  ).addDocument( (org.w3c.dom.Document) sdom.newDomNode(  ) );
         SOAPMessage                   subscribeResponse = sconn.call( soapm,
                                                                       epr.getAddress(  ).toString(  ) );
View Full Code Here

Examples of javax.xml.soap.MessageFactory

      SubscribeResponseDocument.SubscribeResponse sresres = null;
      try
      {
         //now call
         wsaSOAPConnection sconn = wsaSOAPConnection.newInstance(  );
         MessageFactory    mf    = MessageFactory.newInstance(  );
         SOAPMessage       soapm = mf.createMessage(  );

         //put XMLbean into SOAPBody
         soapm.getSOAPBody(  ).addDocument( (org.w3c.dom.Document) sdom.newDomNode(  ) );
         SOAPMessage                   subscribeResponse = sconn.call( soapm,
                                                                       epr.getAddress(  ).toString(  ) );
View Full Code Here

Examples of javax.xml.soap.MessageFactory

    }

    private SOAPMessage prepareSOAPMessage(String resouceName) throws Exception {
        InputStream is = this.getClass().getResourceAsStream(resouceName);
        SOAPMessage soapMessage = null;
        MessageFactory factory = MessageFactory.newInstance();
        MimeHeaders mhs = null;
        soapMessage = factory.createMessage(mhs, is);
        return soapMessage;
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.message.factory.MessageFactory

                    .getProperty(Constants.SAVED_REQUEST_MSG_TEXT);
            if (savedMsg != null && savedMsg.length() > 0) {
                try {
                    StringReader sr = new StringReader(savedMsg);
                    XMLStreamReader xmlreader = StAXUtils.createXMLStreamReader(sr);
                    MessageFactory mf = (MessageFactory)
                            FactoryRegistry.getFactory(MessageFactory.class);
                    Protocol protocol = requestMsgContext.getAxisMessageContext().isDoingREST() ?
                            Protocol.rest : null;
                    Message msg = mf.createFrom(xmlreader, protocol);
                    requestMsgContext.setMessage(msg);
                } catch (Throwable e) {
                    throw ExceptionFactory.makeWebServiceException(e);
                }
            }
View Full Code Here

Examples of org.apache.logging.log4j.message.MessageFactory

     * @param messageFactory
     *            The message factory to check.
     */
    public static void checkMessageFactory(final Logger logger, final MessageFactory messageFactory) {
        final String name = logger.getName();
        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
            StatusLogger
                .getLogger()
                .warn("The Logger {} was created with the message factory {} and is now requested with the " +
                    "message factory {}, which may create log events with unexpected formatting.",
                    name, loggerMessageFactory, messageFactory);
        } else if (messageFactory == null
            && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS)) {
            StatusLogger
                .getLogger()
                .warn("The Logger {} was created with the message factory {} and is now requested with a null " +
                    "message factory (defaults to {}), which may create log events with unexpected formatting.",
                    name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
View Full Code Here

Examples of org.apache.myfaces.extensions.cdi.message.api.MessageFactory

    public MessageContext createContext(MessageContext defaultMessageContext,
                                        Instance<MessageFactory> messageFactoryInstance,
                                        Instance<ELProvider> elProviderInstance,
                                        Instance<ArgumentFilter> argumentFilterInstance)
    {
        MessageFactory messageFactory = null;
        ELProvider elProvider = null;
        ArgumentFilter argumentFilter = null;

        if (!messageFactoryInstance.isUnsatisfied())
        {
View Full Code Here

Examples of org.apache.qpid.proton.message.MessageFactory

    }

    Message decodeMessage(String name) throws IOException
    {
        byte[] data = getBytes(name);
        MessageFactory mf = new ProtonFactoryLoader<MessageFactory>(MessageFactory.class).loadFactory();
        Message m = mf.createMessage();
        m.decode(data, 0, data.length);
        return m;
    }
View Full Code Here

Examples of org.apache.tuscany.core.message.MessageFactory

   
    /**
     * Tests basic wiring of a source to a target, including handlers and interceptors
     */
    public void testInvocation() throws Exception {
        MessageFactory msgFactory = new MessageFactoryImpl();

        SourceInvocationConfiguration source = new SourceInvocationConfiguration(hello);
        MockHandler sourceRequestHandler = new MockHandler();
        MockHandler sourceResponseHandler = new MockHandler();
        MockSyncInterceptor sourceInterceptor = new MockSyncInterceptor();
        source.addRequestHandler(sourceRequestHandler);
        source.addResponseHandler(sourceResponseHandler);
        source.addInterceptor(sourceInterceptor);

        SourceWireFactory sourceFactory = new JDKWireFactoryFactory().createSourceWireFactory();
        Map<Method, SourceInvocationConfiguration> sourceInvocationConfigs = new MethodHashMap<SourceInvocationConfiguration>();
        sourceInvocationConfigs.put(hello, source);
        WireSourceConfiguration sourceConfig = new WireSourceConfiguration("foo",new QualifiedName("target/SimpleTarget"),
                sourceInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory);
        sourceFactory.setConfiguration(sourceConfig);
        sourceFactory.setBusinessInterface(SimpleTarget.class);
       
        TargetInvocationConfiguration target = new TargetInvocationConfiguration(hello);
        MockHandler targetRequestHandler = new MockHandler();
        MockHandler targetResponseHandler = new MockHandler();
        MockSyncInterceptor targetInterceptor = new MockSyncInterceptor();
        target.addRequestHandler(targetRequestHandler);
        target.addResponseHandler(targetResponseHandler);
        target.addInterceptor(targetInterceptor);
        target.addInterceptor(new InvokerInterceptor());

        TargetWireFactory targetFactory = new JDKWireFactoryFactory().createTargetWireFactory();
        Map<Method, TargetInvocationConfiguration> targetInvocationConfigs = new MethodHashMap<TargetInvocationConfiguration>();
        targetInvocationConfigs.put(hello, target);
        WireTargetConfiguration targetConfig = new WireTargetConfiguration(new QualifiedName("target/SimpleTarget"),
                targetInvocationConfigs, Thread.currentThread().getContextClassLoader(), msgFactory);
        targetFactory.setConfiguration(targetConfig);
        targetFactory.setBusinessInterface(SimpleTarget.class);

        // bootstrap a scope container with the target in it
        Map<String,Object> instances = new HashMap<String,Object>();
        SimpleTarget simpleTarget = new SimpleTargetImpl();
        instances.put("target",simpleTarget);
        MockScopeContext scopeCtx = new MockScopeContext(instances);

        // connect the source to the target
        DefaultWireBuilder builder = new DefaultWireBuilder();
        builder.addWireBuilder(new JavaTargetWireBuilder());
       
        builder.connect(sourceFactory, targetFactory, JavaContextFactory.class, true, scopeCtx);
        source.build();
        target.build();
        Assert.assertNotNull(source.getTargetInvoker());
       
        Message msg = msgFactory.createMessage();
        msg.setBody("foo");
        msg.setTargetInvoker(source.getTargetInvoker());
        Message response = source.getHeadInterceptor().invoke(msg);
        Assert.assertEquals("foo", response.getBody());
        Assert.assertEquals(1, sourceRequestHandler.getCount());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.