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( );