pullPoint = (WsResource)manager.createResource(endpoint);
}
catch (SoapFault error)
{
throw new UnableToCreatePullPointFault(error);
}
EndpointReference epr = pullPoint.getEndpointReference();
PullPoint pullPointCap = (PullPoint)pullPoint.getCapability(WsnConstants.PULL_POINT_URI);
Filter filter = pullPointCap.getFilter();
//
// create subscription that will send messages to the pullpoint
//
NotificationProducer wsn = (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);
WsResource sub = null;
try
{
sub = wsn.subscribe(epr, filter, null, null);
}
catch (BaseFault error)
{
throw new UnableToCreatePullPointFault(error);
}
pullPointCap.setSubscription(sub);
//
// initialize pullpoint to complete creation process
//
try
{
pullPoint.initialize();
manager.addResource(epr, pullPoint);
}
catch (SoapFault error)
{
throw new UnableToCreatePullPointFault(error);
}
return epr;
}