EndpointReferenceType epr1 = EndpointReferenceType.Factory.newInstance();
AttributedURI uri = AttributedURI.Factory.newInstance();
uri.setStringValue("http://consumer");
epr1.setAddress(uri);
EndpointReference epr = new XmlBeansEndpointReference(epr1);
TopicExpressionDocument topicExprType = null;
try
{
topicExprType = (TopicExpressionDocument) XmlObject.Factory.parse("<wsnt:TopicExpression xmlns:wsnt=\"http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd\" Dialect=\"http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple\">fs:MountPointDirectory</wsnt:TopicExpression>");
}
catch (XmlException e)
{
e.printStackTrace();
}
//topicExprType.setDialect("http://foobar");
XmlBeansTopicExpression topicExpr = new XmlBeansTopicExpression(topicExprType.getTopicExpression());
SubscriptionResource sub = new SubscriptionResource(epr,epr,null,"my/producer/home",topicExpr);
sub.setNotificationProducer(new NotifProducer());
/* EndpointReference consumerReference, EndpointReference producerReference,
Calendar initialTerminationTime, Object policy, QueryExpression precondition,