Package org.foodwebs.www._2009._11

Examples of org.foodwebs.www._2009._11.ExecuteRequest


    try {
      JAXBContext jc11 = JAXBContext.newInstance("com.topografix.gpx._1._1");
      Unmarshaller unmarshaller = jc11.createUnmarshaller();
      Object result = unmarshaller.unmarshal(file);
     
      return new Gpx11( (com.topografix.gpx._1._1.GpxType)result );
    } catch(Exception e) {
      throw new Exception("Unable to unmarshall file "+file.getAbsolutePath(), e);
    }
  }
View Full Code Here


    Assert.assertEquals( message.getMessageSummary(), content.getMessageSummary() );
    Assert.assertEquals( settings.getLanguageCode(), content.getLanguageCode() );
    Notification notification = request.getNotifications().getNotification().get( 0 );
    List<ReceiverEndPoint> receiverEndPoints = notification.getReceiverEndPoints().getReceiverEndPoint();
    for (ReceiverEndPoint receiverEndPoint : receiverEndPoints) {
      TransportType transportType = receiverEndPoint.getTransportType();
      if (TransportType.EMAIL.equals( transportType )) {
      } else if (TransportType.SMS.equals( transportType )) {
      } else {
        Assert.fail( "Unknown TransportType: " + transportType );
      }
View Full Code Here

    return service;
  }

  protected int submitRequest(ICorrespondenceAgencyExternalBasic port, InsertCorrespondenceV2 request, CorrespondenceMessage msg) {

    ReceiptExternal response;
    try {
      response = port.insertCorrespondenceBasicV2(settings.getSystemUserName(), settings.getSystemPassword(), settings.getSystemUserCode(), msg.getExternalReference(), request);
      if (!ReceiptStatusEnum.OK.equals(response.getReceiptStatusCode()))
        throw new AltinnException("Status was not ok: receiptID " + response.getReceiptId() + " status " + response.getReceiptStatusCode());

    } catch (ICorrespondenceAgencyExternalBasicInsertCorrespondenceBasicV2AltinnFaultFaultFaultMessage e) {
      throw new AltinnException(getAltinnFaultMessage(e), e);
    }
    return response.getReceiptId();
  }
View Full Code Here

    ExternalContentV2 content = request.getContent();
    Assert.assertEquals( message.getMessageTitle(), content.getMessageTitle() );
    Assert.assertEquals( message.getMessageBody(), content.getMessageBody() );
    Assert.assertEquals( message.getMessageSummary(), content.getMessageSummary() );
    Assert.assertEquals( settings.getLanguageCode(), content.getLanguageCode() );
    Notification notification = request.getNotifications().getNotification().get( 0 );
    List<ReceiverEndPoint> receiverEndPoints = notification.getReceiverEndPoints().getReceiverEndPoint();
    for (ReceiverEndPoint receiverEndPoint : receiverEndPoints) {
      TransportType transportType = receiverEndPoint.getTransportType();
      if (TransportType.EMAIL.equals( transportType )) {
      } else if (TransportType.SMS.equals( transportType )) {
      } else {
View Full Code Here

public class MessageNotificationTest {

    @Test
    public void testMessageNotificationContainsEmailAddressIfAddressNotNull() throws Exception {
        MessageNotification messageNotification = new MessageNotification(new CorrespondenceSettings(), "test@example.com");
        NotificationBEList notifications = messageNotification.getNotifications();

        assertEquals(1, notifications.getNotification().size());
        assertEquals(2, notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().size());

        ReceiverEndPoint smsEndpoint = notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().get(0);
        ReceiverEndPoint mailEndpoint = notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().get(1);

        assertEquals(TransportType.SMS, smsEndpoint.getTransportType());
        assertEquals("", smsEndpoint.getReceiverAddress());

        assertEquals(TransportType.EMAIL, mailEndpoint.getTransportType());
View Full Code Here

    }

    @Test
    public void testMessageNotificationContainsEmailEmptyStringIfAddressIsNull() throws Exception {
        MessageNotification messageNotification = new MessageNotification(new CorrespondenceSettings(), "");
        NotificationBEList notifications = messageNotification.getNotifications();

        assertEquals(1, notifications.getNotification().size());
        assertEquals(2, notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().size());

        ReceiverEndPoint smsEndpoint = notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().get(0);
        ReceiverEndPoint mailEndpoint = notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().get(1);

        assertEquals(TransportType.SMS, smsEndpoint.getTransportType());
        assertEquals("", smsEndpoint.getReceiverAddress());

        assertEquals(TransportType.EMAIL, mailEndpoint.getTransportType());
View Full Code Here

        NotificationBEList notifications = messageNotification.getNotifications();

        assertEquals(1, notifications.getNotification().size());
        assertEquals(2, notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().size());

        ReceiverEndPoint smsEndpoint = notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().get(0);
        ReceiverEndPoint mailEndpoint = notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().get(1);

        assertEquals(TransportType.SMS, smsEndpoint.getTransportType());
        assertEquals("", smsEndpoint.getReceiverAddress());

        assertEquals(TransportType.EMAIL, mailEndpoint.getTransportType());
        assertEquals("test@example.com", mailEndpoint.getReceiverAddress());
    }
View Full Code Here

        NotificationBEList notifications = messageNotification.getNotifications();

        assertEquals(1, notifications.getNotification().size());
        assertEquals(2, notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().size());

        ReceiverEndPoint smsEndpoint = notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().get(0);
        ReceiverEndPoint mailEndpoint = notifications.getNotification().get(0).getReceiverEndPoints().getReceiverEndPoint().get(1);

        assertEquals(TransportType.SMS, smsEndpoint.getTransportType());
        assertEquals("", smsEndpoint.getReceiverAddress());

        assertEquals(TransportType.EMAIL, mailEndpoint.getTransportType());
        assertEquals("", mailEndpoint.getReceiverAddress());
    }
View Full Code Here

    }
    return response.getReceiptId();
  }

  private String getAltinnFaultMessage(ICorrespondenceAgencyExternalBasicInsertCorrespondenceBasicV2AltinnFaultFaultFaultMessage f) {
    AltinnFault faultMessage = f.getFaultInfo();
    log.info("Error id:" + faultMessage.getErrorID() + "Error: " + faultMessage.getAltinnErrorMessage());
    return faultMessage.getAltinnErrorMessage();
  }
View Full Code Here

  public CorrespondenceClient(CorrespondenceSettings settings) {
    this.settings = settings;
  }

  public int send(CorrespondenceMessage msg, String notificationEmail) {
    ICorrespondenceAgencyExternalBasic port = createClientPort();
    InsertCorrespondenceV2 request = createRequest(msg, notificationEmail);
    request.setContent(createContent(msg));
    return submitRequest(port, request, msg);
  }
View Full Code Here

TOP

Related Classes of org.foodwebs.www._2009._11.ExecuteRequest

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.