{
// Subscribe to a MUWS ResourceState property change
SubscribeResponse sub_response =
subscribe( Muws05Constants.RESOURCE_PROP_QNAME_RESOURCE_STATE,
this.getAxisBaseUrl( ).toString( ) );
EndpointReferenceType rsSubRef = sub_response.getSubscriptionReference( );
// Subscribe to a BlockSize property change
//setup listener url for consumer endpoint url
sub_response =
subscribe( ExampleConstants.RESOURCE_PROP_QNAME_BLOCK_SIZE,
"http://127.0.0.1:" + NOTIFICATION_LISTENER_PORT );
EndpointReferenceType bsSubRef = sub_response.getSubscriptionReference( );
assertNotNull( rsSubRef );
assertNotNull( bsSubRef );
// The two subscription references should be equal except for the ResourceID property
assertTrue( rsSubRef.getAddress( ).toString( ).compareTo( bsSubRef.getAddress( ).toString( ) ) == 0 );
assertTrue( rsSubRef.getPortType( ).toString( ).compareTo( bsSubRef.getPortType( ).toString( ) ) == 0 );
//test as a listener for events
PortListen notificationListener = new PortListen( NOTIFICATION_LISTENER_PORT, LISTENER_TIMEOUT );
assertTrue( AxisGenTypesUtils.getResourceId( rsSubRef ).compareTo( AxisGenTypesUtils.getResourceId( bsSubRef ) ) != 0 );