Package org.xmlsoap.schemas.ws._2003._03.addressing

Examples of org.xmlsoap.schemas.ws._2003._03.addressing.ServiceNameType


      //create the EPR of the consumer - this EPR object is a specific type for use with the client-side stub
      axis.org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType consumerEprForStub =
         new axis.org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType(  );
      consumerEprForStub.setAddress( new AttributedURI( m_notificationConsumer.getAddress(  ) ) );
      consumerEprForStub.setPortType( new AttributedQName( m_notificationConsumer.getPortType(  ) ) );
      ServiceNameType snt = new ServiceNameType(  );
      snt.setPortName( new NCName( m_notificationConsumer.getServiceName(  ).getPort(  ) ) );
      snt.set_value( m_notificationConsumer.getServiceName(  ) );
      consumerEprForStub.setServiceName( snt );

      // ... this puts the reference property for ResourceID in the EPR
      /*
         MessageElement[] prop            = new MessageElement[1];
View Full Code Here


    private static CustomInfoType convertCustomInfo(Map<String, String> customInfo) {
        if (customInfo == null) {
            return null;
        }

        CustomInfoType ciType = new CustomInfoType();
        for (Entry<String, String> entry : customInfo.entrySet()) {
            CustomInfoType.Item cItem = new CustomInfoType.Item();
            cItem.setKey(entry.getKey());
            cItem.setValue(entry.getValue());
            ciType.getItem().add(cItem);
        }

        return ciType;
    }
View Full Code Here

            origType.setIp("Unknown ip address");
        }
        eventType.setOriginator(origType);

        String path = System.getProperty("karaf.home");
        CustomInfoType ciType = new CustomInfoType();
        CustomInfoType.Item cItem = new CustomInfoType.Item();
        cItem.setKey("path");
        cItem.setValue(path);
        ciType.getItem().add(cItem);
        eventType.setCustomInfo(ciType);

        return eventType;
    }
View Full Code Here

 
  @Test
  public void testEventMapper() throws IOException {
    Event event = new Event();
    event.setContent("testContent");
    EventType eventOut = EventMapper.map(event);
    DataHandler dh = eventOut.getContent();
    String outContent = getContent(dh);
    Assert.assertEquals(event.getContent(), outContent);
    // TODO test the other properties
  }
View Full Code Here

     *
     * @param event the event
     * @return the event type
     */
    public static EventType map(Event event) {
        EventType eventType = new EventType();
        eventType.setTimestamp(Converter.convertDate(event.getTimestamp()));
        eventType.setEventType(convertEventType(event.getEventType()));
        OriginatorType origType = mapOriginator(event.getOriginator());
        eventType.setOriginator(origType);
        MessageInfoType miType = mapMessageInfo(event.getMessageInfo());
        eventType.setMessageInfo(miType);
        eventType.setCustomInfo(convertCustomInfo(event.getCustomInfo()));
        eventType.setContentCut(event.isContentCut());
        if (event.getContent() != null) {
            DataHandler datHandler = getDataHandlerForString(event);
            eventType.setContent(datHandler);
        }
        return eventType;
    }
View Full Code Here

        if (monitoringService == null) {
            initWsClient(context);
        }

        EventType serverStartEvent = createEventType(EventEnumType.SERVER_START);
        putEvent(serverStartEvent);

        LOG.info("Send SERVER_START event to SAM Server successful!");
    }
View Full Code Here

        if (monitoringService == null) {
            initWsClient(context);
        }

        EventType serverStopEvent = createEventType(EventEnumType.SERVER_STOP);
        putEvent(serverStopEvent);

        LOG.info("Send SERVER_STOP event to SAM Server successful!");
    }
View Full Code Here

     *
     * @param type the EventEnumType
     * @return the event type
     */
    private EventType createEventType(EventEnumType type) {
        EventType eventType = new EventType();
        eventType.setTimestamp(Converter.convertDate(new Date()));
        eventType.setEventType(type);

        OriginatorType origType = new OriginatorType();
        origType.setProcessId(Converter.getPID());
        try {
            InetAddress inetAddress = InetAddress.getLocalHost();
            origType.setIp(inetAddress.getHostAddress());
            origType.setHostname(inetAddress.getHostName());
        } catch (UnknownHostException e) {
            origType.setHostname("Unknown hostname");
            origType.setIp("Unknown ip address");
        }
        eventType.setOriginator(origType);

        String path = System.getProperty("karaf.home");
        CustomInfoType ciType = new CustomInfoType();
        CustomInfoType.Item cItem = new CustomInfoType.Item();
        cItem.setKey("path");
        cItem.setValue(path);
        ciType.getItem().add(cItem);
        eventType.setCustomInfo(ciType);

        return eventType;
    }
View Full Code Here

    private static void throwFault(String code, String message, Throwable t) throws PutEventsFault {
        if (LOG.isLoggable(Level.SEVERE)) {
            LOG.log(Level.SEVERE, "Throw Fault " + code + " " + message, t);
        }

        FaultType faultType = new FaultType();
        faultType.setFaultCode(code);
        faultType.setFaultMessage(message);

        StringWriter stringWriter = new StringWriter();
        PrintWriter printWriter = new PrintWriter(stringWriter);

        t.printStackTrace(printWriter);

        faultType.setStackTrace(stringWriter.toString());

        throw new PutEventsFault(message, faultType, t);
    }
View Full Code Here

        return dataFormat;
    }

    @Override
    public Object doMarshal(Exchange exchange, Object inputObject, OutputStream stream, String soapAction) throws IOException {
        Body body = new Body();
        Header header = new Header();

        Throwable exception = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);
        if (exception == null) {
            exception = exchange.getIn().getHeader(Exchange.EXCEPTION_CAUGHT, Throwable.class);
        }

        final List<JAXBElement<?>> bodyContent;
        List<JAXBElement<?>> headerContent = new ArrayList<JAXBElement<?>>();
        if (exception != null) {
            bodyContent = new ArrayList<JAXBElement<?>>();
            bodyContent.add(createFaultFromException(exception));
        } else {
            bodyContent = getDataFormat().createContentFromObject(inputObject, soapAction, headerContent);
        }

        for (JAXBElement<?> elem : bodyContent) {
            body.getAny().add(elem);
        }
        for (JAXBElement<?> elem : headerContent) {
            header.getAny().add(elem);
        }
        Envelope envelope = new Envelope();
View Full Code Here

TOP

Related Classes of org.xmlsoap.schemas.ws._2003._03.addressing.ServiceNameType

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.