SubscribeDocument sdom = SubscribeDocument.Factory.newInstance( );
SubscribeDocument.Subscribe s = sdom.addNewSubscribe( );
//create notifyTo EPR
EndpointReferenceType nepr =
(EndpointReferenceType) ( (XmlObjectWrapper) notificationConsumer.getEPR( ) ).getXmlObject( );
//add ReferenceProperties
ReferencePropertiesType refProps = nepr.addNewReferenceProperties( );
XmlObject xmlObject = XmlBeanUtils.addChildElement( refProps,
new QName( "TODO" ) );
XmlCursor xmlCursor = xmlObject.newCursor( );
xmlCursor.setTextValue( String.valueOf( ls.getID( ) ) );
xmlCursor.dispose( );
//notifications are send to:
DeliveryType delivery = s.addNewDelivery( );
delivery.setNotifyTo( nepr );
if ( UseNotify == true )
{
delivery.setMode( WRAPPED_MODE_URI );
}
//create endto EPR
EndpointReferenceType eepr =
(EndpointReferenceType) ( (XmlObjectWrapper) subscriptionEndConsumer.getEPR( ) ).getXmlObject( );
//add ReferenceProperties we already created
eepr.setReferenceProperties( refProps );
//subscription ends are send to:
s.setEndTo( eepr );
//TODO check Calendar serializing