Package axis.com.ibm.www.xmlns.stdwip.web_services.WS_BaseNotification

Examples of axis.com.ibm.www.xmlns.stdwip.web_services.WS_BaseNotification.Subscribe


          ResourceUnknownFaultType,
          TopicPathDialectUnknownFaultType,
          RemoteException,
          MalformedURIException
   {
      Subscribe request = new Subscribe(  );
      // Create an endpoint reference for the NotificationConsumer
      // Note that since we are using PortListener to handle notifications,
      // rather than a Web Service that implements NotificationConsumer this
      // EPR is somewhat bogus.
      EndpointReferenceType epr = new EndpointReferenceType(  );
      epr.setAddress( new AttributedURI( callback_url ) );
      epr.setPortType( new AttributedQName( "nothing" ) );
      ServiceNameType snt = new ServiceNameType(  );
      snt.setPortName( new NCName( "NotificationConsumer" ) );
      snt.set_value( new QName( "TestNotifConsumer" ) );
      epr.setServiceName( snt );

      // Set a couple of reference properties, including a ResourceID.
      MessageElement[] prop = new MessageElement[2];
      MessageElement   propsResourceID =
         new SOAPBodyElement( MuseAddressingConstants.REFERENCE_PROP_QNAME_RESOURCE_ID, "4444" );
      prop[0] = propsResourceID;
      MessageElement otherProp = new SOAPBodyElement( new QName( "http://com.xyz/props", "myprop" ),
                                                      "foo" );
      prop[1] = otherProp;
      ReferencePropertiesType props = new ReferencePropertiesType(  );
      props.set_any( prop );
      epr.setReferenceProperties( props );
      request.setConsumerReference( epr );

      // Build the TopicExpressionType for the request.
      TopicExpressionType tet = new TopicExpressionType(  );

      // Currently on the Simple dialect is supported.
      tet.setDialect( new URI( TopicsConstants.DIALECT_TOPIC_EXPRESSION_SIMPLE ) );
      tet.set_any( this.buildTopicExpressionTypeAny( propQname ) );
      request.setTopicExpression( tet );

      // Setup other subscription information.
      Calendar terminationTime = Calendar.getInstance(  );
      terminationTime.add( Calendar.HOUR, 1 ); // expire this subscription in 1 hour
      request.setInitialTerminationTime( terminationTime );
      request.setPrecondition( new QueryExpressionType(  ) );
      request.setSelector( new QueryExpressionType(  ) );
      request.setSubscriptionPolicy( null );

      // useNotify == true indicates that the Notification will be wrapped in a wsnt:Notify element.
      request.setUseNotify( new Boolean( true ) );

      // Issue the actual request to subscribe
      SubscribeResponse response = m_stub.subscribe( request );

      return response;
View Full Code Here


      //ref_prop.set_any();
      axis_endpoint.setReferenceProperties( ref_prop );

      //axis_endpoint.set_any();
      Subscribe subscribe = new Subscribe(  );
      subscribe.setConsumerReference( axis_endpoint );
      subscribe.setInitialTerminationTime( termination );

      //subscribe.setPrecondition();
      //subscribe.setSelector();
      //subscribe.setSubscriptionPolicy();
      //subscribe.setTopicExpression();
      subscribe.setUseNotify( new Boolean( isNotify ) );

      SubscriptionRequest subreq = new SubscriptionRequestImpl( subscribe );

      org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType consumer = subreq.getConsumer(  );
      validateEndpointsMatch( consumer, axis_endpoint );
View Full Code Here

         // locate the sensor service
         EndpointReferenceType     sensorEpr = endpointReferences[i];
         SensorSoapHttpBindingStub sensor = getSensorService( sensorEpr );

         // build the request to subscribe to the sensor services' change notifications
         Subscribe         subscribeRequest  = buildSubscribe( sensorEpr );
         SubscribeResponse subscribeResponse = sensor.subscribe( subscribeRequest );

         // the subscription request succeeded - remember the EPR to the new subscription in case we need to unsubscribe
         m_subscriptions.add( subscribeResponse.getSubscriptionReference(  ) );
      }
View Full Code Here

    */
   private Subscribe buildSubscribe( EndpointReferenceType sensorEpr )
   throws URI.MalformedURIException
   {
      // First the _Subscribe request must be setup.
      Subscribe request = new Subscribe(  );

      //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];
         String           resourceId      = AddressingUtils.getResourceId( m_notificationConsumer.getProperties(  ) );
         MessageElement   propsResourceId =
            new SOAPBodyElement( MuseAddressingConstants.REFERENCE_PROP_QNAME_RESOURCE_ID, resourceId );
         prop[0] = propsResourceId;
         org.xmlsoap.schemas.ws._2003._03.addressing.ReferencePropertiesType props =
            new org.xmlsoap.schemas.ws._2003._03.addressing.ReferencePropertiesType(  );
         props.set_any( prop );
         consumerEprForStub.setReferenceProperties( props );
       */
      request.setConsumerReference( consumerEprForStub );

      // Set up the request to ask for a subscription to the change notification of the given Resource Property
      TopicExpressionType tet = new TopicExpressionType(  );
      tet.setDialect( new URI( TopicsConstants.DIALECT_TOPIC_EXPRESSION_SIMPLE ) );
      tet.set_any( new MessageElement[]
                   {
                      new MessageElement( SensorWsdmServiceWSResource.PropertyQNames.TEMPERATURE )
                   } );
      request.setTopicExpression( tet );

      Calendar terminationTime = Calendar.getInstance(  );
      terminationTime.add( Calendar.HOUR, 24 ); // expire this subscription in 24 hours
      request.setInitialTerminationTime( terminationTime );
      request.setPrecondition( null );
      request.setSelector( null );
      request.setSubscriptionPolicy( null );
      request.setUseNotify( Boolean.TRUE );

      return request;
   }
View Full Code Here

TOP

Related Classes of axis.com.ibm.www.xmlns.stdwip.web_services.WS_BaseNotification.Subscribe

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.