Package org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01

Examples of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument


    }

    public static String getResourceId(EndpointReferenceType endpointReferenceType)
    {
        System.out.println("Getting resourceid for epr: " + endpointReferenceType.getAddress().getStringValue());
        GetResourcePropertyDocument getResourcePropertyDocument = GetResourcePropertyDocument.Factory.newInstance();
        getResourcePropertyDocument.setGetResourceProperty(IdentityCapability.PROP_NAME_RESOURCE_ID);
        XmlObject xmlObject = sendRequest(getResourcePropertyDocument, "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl/GetResourceProperty", new XmlBeansEndpointReference(endpointReferenceType));
        String resourceID = null;
        if (xmlObject instanceof GetResourcePropertyResponseDocument.GetResourcePropertyResponse)
        {
            GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourcePropertyResponse = (GetResourcePropertyResponseDocument.GetResourcePropertyResponse) xmlObject;
View Full Code Here


       m_epr = epr;
    }

    public XmlObject[] getResourceProperty( QName propName ) throws FaultException
    {
        GetResourcePropertyDocument requestDoc = GetResourcePropertyDocument.Factory.newInstance();
      
        requestDoc.setGetResourceProperty( propName );
        XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/GetResourceProperty","P" );
        if ( ! ( response instanceof GetResourcePropertyResponseDocument.GetResourcePropertyResponse ) )
        {
            throw new FaultException( response.toString() );
        }
View Full Code Here

    }

    protected GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourceProperty( QName propName )
    {
        GetResourcePropertyPortTypeImpl get_provider = new GetResourcePropertyPortTypeImpl( m_resourceContext );
        GetResourcePropertyDocument get_document = GetResourcePropertyDocument.Factory.newInstance();
        get_document.setGetResourceProperty( propName );
        GetResourcePropertyResponseDocument resourceProperty = get_provider.getResourceProperty( get_document );
        GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourcePropertyResponse =
                resourceProperty.getGetResourcePropertyResponse();
        return getResourcePropertyResponse;
    }
View Full Code Here

    public void testGetConfiguredWeatherStation()
    {
        EndpointReferenceDocument clientConfigEpr = CLIENT_CONFIG_EPR;

        //retrieve the epr for weather station 1 from wc
        GetResourcePropertyDocument getResourcePropertyDocument = GetResourcePropertyDocument.Factory.newInstance();
        getResourcePropertyDocument.setGetResourceProperty(WeatherClientConfigPropertyQNames.WEATHERSTATIONREFERENCE);
        XmlObject getResp = InteropRequestUtils.sendRequest(getResourcePropertyDocument, "http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties", new XmlBeansEndpointReference(clientConfigEpr.getEndpointReference()));

    }
View Full Code Here

    {
        EndpointReferenceDocument weatherStationEprDoc = WEATHER_STATION_1_EPR_DOC;
        EndpointReferenceDocument clientConfigEpr = CLIENT_CONFIG_EPR;

        //retrieve the epr for weather station 1 from wc
        GetResourcePropertyDocument getResourcePropertyDocument = GetResourcePropertyDocument.Factory.newInstance();
        getResourcePropertyDocument.setGetResourceProperty(WeatherClientConfigPropertyQNames.WEATHERSTATIONREFERENCE);
        XmlObject getResp = InteropRequestUtils.sendRequest(getResourcePropertyDocument, "http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties", new XmlBeansEndpointReference(clientConfigEpr.getEndpointReference()));

        //assertTrue(getResp instanceof )
        //todo check its ws1

        getResourcePropertyDocument = GetResourcePropertyDocument.Factory.newInstance();
        getResourcePropertyDocument.setGetResourceProperty(WeatherStationPropertyQNames.TEMPERATURE);
        getResp = InteropRequestUtils.sendRequest(getResourcePropertyDocument, "http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties", new XmlBeansEndpointReference(weatherStationEprDoc.getEndpointReference()));
        //todo assert

        /* //retrieve the metrics
         GetMultipleResourcePropertiesDocument getMultipleResourcePropertiesDocument = GetMultipleResourcePropertiesDocument.Factory.newInstance();
         GetMultipleResourcePropertiesDocument.GetMultipleResourceProperties getMultipleResourceProperties = getMultipleResourcePropertiesDocument.addNewGetMultipleResourceProperties();
         QName[] metrics = {WeatherStationPropertyQNames.HUMIDITY, WeatherStationPropertyQNames.TEMPERATURE, WeatherStationPropertyQNames.VISIBILITY};
         getMultipleResourceProperties.setResourcePropertyArray(metrics);
         XmlObject getMultResp = InteropRequestUtils.sendRequest(getMultipleResourcePropertiesDocument,"http://wsdmdemo.org/service/weather-station-dir/GetMultipleResourceProperties",new XmlBeansEndpointReference(weatherStationEprDoc.addNewEndpointReference()));

         //pull again should be different
         XmlObject getMultResp2 = InteropRequestUtils.sendRequest(getMultipleResourcePropertiesDocument,"http://wsdmdemo.org/service/weather-station-dir/GetMultipleResourceProperties",new XmlBeansEndpointReference(weatherStationEprDoc.addNewEndpointReference()));
         */

        testgetRelationships();

        //check the OpStatus prop is PartiallyAvail .....also need to check notif
        getResourcePropertyDocument = GetResourcePropertyDocument.Factory.newInstance();
        getResourcePropertyDocument.setGetResourceProperty(WeatherStationPropertyQNames.OPERATIONALSTATUS);
        getResp = InteropRequestUtils.sendRequest(getResourcePropertyDocument, "http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties", new XmlBeansEndpointReference(weatherStationEprDoc.getEndpointReference()));
        //todo check avail

        //recalibrate ws1
        RecalibrateDocument recalibrateDocument = RecalibrateDocument.Factory.newInstance();
        org.wsdmdemo.service.weatherStation.RecalibrateDocument.Recalibrate recalibrate = recalibrateDocument.addNewRecalibrate();
        XmlObject recalibResponse = InteropRequestUtils.sendRequest(recalibrateDocument, "http://wsdmdemo.org/service/weather-station-dir/Recalibrate", new XmlBeansEndpointReference(weatherStationEprDoc.getEndpointReference()));
        //todo assert not fault

        //check the OpStatus prop is PartiallyAvail .....also need to check notif
        getResourcePropertyDocument = GetResourcePropertyDocument.Factory.newInstance();
        getResourcePropertyDocument.setGetResourceProperty(WeatherStationPropertyQNames.OPERATIONALSTATUS);
        getResp = InteropRequestUtils.sendRequest(getResourcePropertyDocument, "http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties", new XmlBeansEndpointReference(weatherStationEprDoc.getEndpointReference()));
        //todo check unavail


        //todo test notifs....???are there notifs anymore??
View Full Code Here

        //todo test notifs....???are there notifs anymore??
    }

    public void testgetRelationships()
    {
        GetResourcePropertyDocument getResourcePropertyDocument;
        //get relationships from dir > 0
        getResourcePropertyDocument = GetResourcePropertyDocument.Factory.newInstance();
        getResourcePropertyDocument.setGetResourceProperty(WeatherStationDirPropertyQNames.RELATIONSHIP);     //need epr
        XmlObject getRelResp = InteropRequestUtils.sendRequest(getResourcePropertyDocument, "http://wsdmdemo.org/service/weather-station-dir/GetResourceProperties", WEATHER_STATION_DIR_SERVICE_URL);
        //todo assert we get both relationships
    }
View Full Code Here

       m_epr = epr;
    }

    public XmlObject[] getResourceProperty( QName propName ) throws FaultException
    {
        GetResourcePropertyDocument requestDoc = GetResourcePropertyDocument.Factory.newInstance();
        requestDoc.setGetResourceProperty( propName );
        XmlObject response = sendRequest( requestDoc, "http://xyz.com/action/GetResourceProperty" );
        if ( ! ( response instanceof GetResourcePropertyResponseDocument.GetResourcePropertyResponse ) )
        {
            throw new FaultException( response.toString() );
        }
View Full Code Here

    }

    public static LastMessageType getLastMessage(String serviceURL)
    {

        GetResourcePropertyDocument getResourcePropertyDocument = GetResourcePropertyDocument.Factory.newInstance();
        getResourcePropertyDocument.setGetResourceProperty(ConsumerPropertyQNames.LASTMESSAGE);
        XmlObject xmlObject = sendRequest(getResourcePropertyDocument, "http://getResourceProp", createEpr(serviceURL));
        if (xmlObject instanceof GetResourcePropertyResponseDocument.GetResourcePropertyResponse)
        {
            GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourcePropertyDocumentResponse = (GetResourcePropertyResponseDocument.GetResourcePropertyResponse) xmlObject;
            XmlObject[] childElements = XmlBeanUtils.getChildElements(getResourcePropertyDocumentResponse);
View Full Code Here

    * @return DOCUMENT_ME
    */
   protected GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourceProperty( QName propName )
   {
      GetResourcePropertyPortTypeImpl get_provider = new GetResourcePropertyPortTypeImpl( m_resourceContext );
      GetResourcePropertyDocument     get_document = GetResourcePropertyDocument.Factory.newInstance(  );
      get_document.setGetResourceProperty( propName );
      GetResourcePropertyResponseDocument                             resourceProperty =
         get_provider.getResourceProperty( get_document );
      GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourcePropertyResponse =
         resourceProperty.getGetResourcePropertyResponse(  );
      return getResourcePropertyResponse;
View Full Code Here

    * @return DOCUMENT_ME
    */
   protected GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourceProperty( QName propName )
   {
      GetResourcePropertyPortTypeImpl get_provider = new GetResourcePropertyPortTypeImpl( m_resourceContext );
      GetResourcePropertyDocument     get_document = GetResourcePropertyDocument.Factory.newInstance(  );
      get_document.setGetResourceProperty( propName );
      GetResourcePropertyResponseDocument                             resourceProperty =
         get_provider.getResourceProperty( get_document );
      GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourcePropertyResponse =
         resourceProperty.getGetResourcePropertyResponse(  );
      return getResourcePropertyResponse;
View Full Code Here

TOP

Related Classes of org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument

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.