Examples of MessageFactory


Examples of com.google.gwt.requestfactory.shared.messages.MessageFactory

   * {@link #addInvocation}.
   * </ul>
   */
  private String makePayload() {
    // Get the factory from the runtime-specific holder.
    MessageFactory f = MessageFactoryHolder.FACTORY;

    List<OperationMessage> operations = makePayloadOperations();
    List<InvocationMessage> invocationMessages = makePayloadInvocations();

    // Create the outer envelope message
    AutoBean<RequestMessage> bean = f.request();
    RequestMessage requestMessage = bean.as();
    if (!invocationMessages.isEmpty()) {
      requestMessage.setInvocations(invocationMessages);
    }
    if (!operations.isEmpty()) {
View Full Code Here

Examples of com.google.web.bindery.requestfactory.shared.messages.MessageFactory

  /**
   * Create an InvocationMessage for each remote method call being made by the context.
   */
  private List<InvocationMessage> makePayloadInvocations() {
    MessageFactory f = MessageFactoryHolder.FACTORY;

    List<InvocationMessage> invocationMessages = new ArrayList<InvocationMessage>();
    for (AbstractRequest<?, ?> invocation : state.invocations) {
      // RequestData is produced by the generated subclass
      RequestData data = invocation.getRequestData();
      InvocationMessage message = f.invocation().as();

      // Operation; essentially a method descriptor
      message.setOperation(data.getOperation());

      // The arguments to the with() calls
View Full Code Here

Examples of com.twilio.sdk.resource.factory.MessageFactory

    callParams.put("Url", "http://demo.twilio.com/welcome/voice/");
    Call call = callFactory.create(callParams);
    System.out.println(call.getSid());

    // Send an sms (using the new messages endpoint)
    MessageFactory messageFactory = mainAccount.getMessageFactory();
    List<NameValuePair> messageParams = new ArrayList<NameValuePair>();
    messageParams.add(new BasicNameValuePair("To", "5105551212")); // Replace with a valid phone number
    messageParams.add(new BasicNameValuePair("From", "(510) 555-1212")); // Replace with a valid phone
    // number in your account
    messageParams.add(new BasicNameValuePair("Body", "This is a test message!"));
    messageFactory.create(messageParams);

        // Search for all available phone numbers
        AvailablePhoneNumberList phoneNumbers = mainAccount.getAvailablePhoneNumbers();
        List<AvailablePhoneNumber> phoneNumberList = phoneNumbers.getPageData();
View Full Code Here

Examples of com.volantis.mps.bms.MessageFactory

        assertNull(request.getSender().getMSISDN());
    }

    public void testSendRequestBasicSerialization() throws Exception {

        MessageFactory factory = MessageFactory.getDefaultInstance();

        Address address = factory.createSMTPAddress("alice@volantis.com");
        Recipient alice = factory.createRecipient(address, "Nokia-6600");
        alice.setChannel("smtp");

        SendRequest request = factory.createSendRequest();
        request.addRecipient(alice);

        Message message = factory.createMessage(
                new URL("http://localhost:8080/volantis/welcome/welcome.xdime"));
        message.setSubject("Hello");
        request.setMessage(message);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
View Full Code Here

Examples of fr.tm.elibel.smartqvt.message.MessageFactory

   * <!-- end-user-doc -->
   * @generated
   */
  public static MessageFactory init() {
    try {
      MessageFactory theMessageFactory = (MessageFactory)EPackage.Registry.INSTANCE.getEFactory("http://smartqvt.elibel.tm.fr/models/mm/message/");
      if (theMessageFactory != null) {
        return theMessageFactory;
      }
    }
    catch (Exception exception) {
View Full Code Here

Examples of hermes.MessageFactory

                     if (browserAction instanceof MessageStoreBrowserAction)
                     {
                        if (HermesBrowser.getBrowser().getBrowserTree().getLastSelectedHermesTreeNode() != null)
                        {
                           final MessageStoreBrowserAction storeAction = (MessageStoreBrowserAction) browserAction;
                           final MessageFactory messageFactory = HermesBrowser.getBrowser().getBrowserTree().getLastSelectedHermesTreeNode().getHermes();
                           HermesBrowser.getBrowser().getThreadPool()
                                 .invokeLater(new AddToMessageStoreTask(messageFactory, storeAction.getMessageStore(), xml));
                        }
                        else
                        {
View Full Code Here

Examples of javax.sip.message.MessageFactory

    private void forwardRequestStatefully(SipProvider sipProvider,
            Request clonedRequest, Request originalRequest,
            ServerTransaction serverTransaction) throws ParseException,
            SipException, JipletException
    {
        MessageFactory messageFactory = jiplet.getMessageFactory();

        /*
         * A stateful jiplet MUST create a new client transaction for this
         * request as described in Section 17.1 and instructs the transaction to
         * send the request using the address, port and transport determined in
         * step 7
         */

        // SERVER TRANSACTION CHECK
        if (serverTransaction == null
                && !clonedRequest.getMethod().equals(Request.MESSAGE))
        {
            // dont create a server transaction for MESSAGE -
            // just forward the request statefully through a new
            // client transaction.
            return;
        }

        if (originalRequest.getMethod().equals(Request.CANCEL))
        {
            // reply to the canceled request and maybe to the received CANCEL
            // and also send CANCELs to pending client transactions
            JipletDialog jdialog = jiplet.getDialog(serverTransaction
                    .getDialog(), true);
            Transaction firstTransaction = (Transaction) jdialog
                    .getAttribute("firstTransaction");
            if (firstTransaction == null)
            {
                throw new JipletException(
                        "ERROR, RequestForwarding Cancel, the first transaction"
                                + " for the  dialog is null");
            }

            if (firstTransaction instanceof ClientTransaction)
            {
                return;
            }

            ServerTransaction firstServerTransaction = (ServerTransaction) firstTransaction;

            try
            {
                // send 487 Request Terminated reply to canceled request
                Response response = messageFactory.createResponse(
                        Response.REQUEST_TERMINATED, firstServerTransaction
                                .getRequest());
                firstServerTransaction.sendResponse(response);
            }
            catch (InvalidArgumentException e)
            {
                // inapplicable - it only happens if the Response was created
                // by Dialog.createReliableProvisionalResponse(int) and the
                // application calls ServerTransaction.sendResponse() to send it
                JipletLogger
                        .error("Cancel response sending failed  - invalid send method used.");
            }

            // find the response context
            TransactionsMapping transactionsMapping = jdialog
                    .getTransactionsMapping();
            Vector clientTransactions = transactionsMapping
                    .getClientTransactions(firstServerTransaction);
            if (clientTransactions == null || clientTransactions.isEmpty())
            {
                // RFC states to send the CANCEL statelessly in this case
                forwardRequestStatelessly(sipProvider, clonedRequest,
                        originalRequest, serverTransaction);
                return;
            }

            try
            {
                // send OK to CANCEL
                Response response = messageFactory.createResponse(Response.OK,
                        originalRequest);
                serverTransaction.sendResponse(response);
            }
            catch (InvalidArgumentException e)
            {
View Full Code Here

Examples of javax.xml.soap.MessageFactory

       
        Service service = Service.create(wsdlURL, SERVICE_NAME);
        Dispatch<SOAPMessage> dispatcher = service.createDispatch(
            portName, SOAPMessage.class, Service.Mode.MESSAGE);
      
        MessageFactory factory = MessageFactory.newInstance();
       
        String str="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsdl=\"http://www.jboss.org/bpel/examples/wsdl\">"+
          "<soapenv:Header/><soapenv:Body><wsdl:hello><TestPart>Hello</TestPart></wsdl:hello></soapenv:Body></soapenv:Envelope>";

        java.io.InputStream is=new java.io.ByteArrayInputStream(str.getBytes());
       
        SOAPMessage soapReq1 = factory.createMessage(null, is);
       
        System.out.println("Invoking server through Dispatch interface using SOAPMessage");
        SOAPMessage soapResp = dispatcher.invoke(soapReq1);
       
        String result=soapResp.getSOAPBody().getTextContent();
View Full Code Here

Examples of javax.xml.soap.MessageFactory

            portName,
            SOAPMessage.class,
            Service.Mode.MESSAGE
        );
      
        MessageFactory factory = MessageFactory.newInstance();
       
        String str="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsdl=\"http://www.jboss.org/bpel/examples/wsdl\">"+
            "<soapenv:Header/><soapenv:Body><wsdl:hello><TestPart>Hello</TestPart></wsdl:hello></soapenv:Body></soapenv:Envelope>";
        java.io.InputStream is=new java.io.ByteArrayInputStream(str.getBytes());
       
        SOAPMessage soapReq1 = factory.createMessage(null, is);
       
          System.out.println("Invoking server through Dispatch interface using SOAPMessage");
          SOAPMessage soapResp = dispatcher.invoke(soapReq1);
          System.out.println("Response from server: " + soapResp.getSOAPBody().getTextContent());
         
View Full Code Here

Examples of javax.xml.soap.MessageFactory

        ObjectMessageContext objectCtx = new ObjectMessageContextImpl();
        objectCtx.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);
        objectCtx.put(MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
        SOAPMessageContext context = (SOAPMessageContext)sb.createBindingMessageContext(objectCtx);

        MessageFactory msgFactory = MessageFactory.newInstance();
        SOAPMessage msg = msgFactory.createMessage();
        msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
        msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(W3CConstants.NP_SCHEMA_XSD,
                                                                W3CConstants.NU_SCHEMA_XSD);
        msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(W3CConstants.NP_SCHEMA_XSI,
                                                                W3CConstants.NU_SCHEMA_XSI);
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.