You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "frederic.dreyfus" <fr...@sungard.com> on 2006/05/01 15:51:59 UTC

Re: Send a remote WS-Notification subscription

I tried your example but it did not work.
Actually, I have a simple WSNComponent declared in my servicemix.xml file : 
<sm:activationSpec>
  <sm:component>
     <bean class="org.apache.servicemix.wsn.spring.WSNSpringComponent">
         <property name="connectionFactory" ref="connectionFactory" />
     </bean>
  </sm:component>
</sm:activationSpec>

Then I deploy a JBI component into the deploy directory. This JBI component
contains the soap binding :
<http:endpoint service="wsn:NotificationBroker"
                        endpoint="http-binding"
                        targetService="wsn:NotificationBroker"			
                        role="consumer"
                        locationURI="http://localhost:8192/Broker/"
                        defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
/>

The component seems to be successfully deployed (I get it in the services
list), but when I click on the service link, the wsdl is still not
retrieved.
I tried adding the wsdlResource property to the bean, but then there are
import problems.

Please help, I really need to make this work.

Thanks very much,

Fred
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4172227
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by Guillaume Nodet <gn...@gmail.com>.
Sure, see
http://xfire.codehaus.org/Client+and+Server+Stub+Generation+from+WSDL

Cheers,
Guillaume Nodet

On 6/15/06, echolu <cj...@163.com> wrote:
>
>
> You mean that XFire also have a tool to parse wsdl to java, is it?
>
> I am freshman of the XFire.
>
> --
> View this message in context:
> http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4878863
> Sent from the ServiceMix - User forum at Nabble.com.
>
>

Re: Send a remote WS-Notification subscription

Posted by echolu <cj...@163.com>.
You mean that XFire also have a tool to parse wsdl to java, is it?

I am freshman of the XFire. 

--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4878863
Sent from the ServiceMix - User forum at Nabble.com.


RE: Send a remote WS-Notification subscription

Posted by echolu <cj...@163.com>.
It is a greate news. I will download it and try again.Thanks!
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4879115
Sent from the ServiceMix - User forum at Nabble.com.


RE: Send a remote WS-Notification subscription

Posted by echolu <cj...@163.com>.
When I use the celtix-1.1's wsdl2java,it shows the following the wrong
messange.
Error : Element : {http://docs.oasis-open.org/wsn/b-2}Notify missing in
wsdl:typ
es of part : Notify

I look for the Notify element in porttypedef.wsdl, the notify is defined
correctly. I don't know why.

--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4880077
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by Guillaume Nodet <gn...@gmail.com>.
Maybe you should try with jaxws (RI or XFire).

Cheers,
Guillaume Nodet

On 6/15/06, echolu <cj...@163.com> wrote:
>
>
> Hi,
> I  parsed the main.WSDL to the java with the tool wsdl2java in ant.
> But the java files producted by ant have some wrong in the Eclipse. There
> is
> no jar of   org.w3.www._2001.XMLSchema.Any. Looking for the jar in Google,
> I
> see somebody post that  Apache Axis complies defines no mapping for
> xsd:any.He suggest that one would have to provide his own
> mapping/serializer/deserializer to get Axis to mapcomplexType of xsd:any
> elements to something useful in Java.
>
> So,Fred, How could you address this problem? Please help me. Thanks.
> BTW, The main.wsdl come from the exapme located
> {SM_HOME}/examples/wsn-http-binding/soap-demo-sa.zip that was deployed to
> SM.
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4877970
> Sent from the ServiceMix - User forum at Nabble.com.
>
>

Re: Send a remote WS-Notification subscription

Posted by echolu <cj...@163.com>.
Hi,
I  parsed the main.WSDL to the java with the tool wsdl2java in ant.
But the java files producted by ant have some wrong in the Eclipse. There is
no jar of   org.w3.www._2001.XMLSchema.Any. Looking for the jar in Google, I
see somebody post that  Apache Axis complies defines no mapping for
xsd:any.He suggest that one would have to provide his own
mapping/serializer/deserializer to get Axis to mapcomplexType of xsd:any
elements to something useful in Java.

So,Fred, How could you address this problem? Please help me. Thanks.
BTW, The main.wsdl come from the exapme located
{SM_HOME}/examples/wsn-http-binding/soap-demo-sa.zip that was deployed to
SM.



--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4877970
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by Guillaume Nodet <gn...@gmail.com>.
It' s just a single element:
  <wnst:Unsubscribe />
but you have to send it to the endpoint that has been created for you
subscription.


On 8/1/07, bgoetzmann <bg...@sophia.symag.com> wrote:
>
> Hello Guillaume,
>
> What is the XML structure for a remote WS-Notification unsubscribe?
>
> Thank you!
>
> Bertrand.
>
>
>
> gnodet wrote:
> >
> >
> > Here is a sample html client page that I started some time ago.
> > Not sure what's its exact state, but if someone want to update
> > and finish it ... ;)
> > Anyway here it is:  http://www.nabble.com/file/p6660986/client.html
>
> > client.html
> >
> > Cheers,
> > Guillaume Nodet
> >
> >
> > frederic.dreyfus wrote:
> >>
> >> Hi
> >>
> >> You can find an example in the 3.0 release of servicemix. This is the
> >> wsn-http-binding example.
> >> In this example the WS-NotificationBroker is exposed through HTPP so that
> >> you can subscribe to a topic from outside the JBI container.
> >> The wsdl of the NotificationBroker service is (in the example) at this
> >> address :  http://localhost:8192/Broker/main.wsdl
> >> http://localhost:8192/Broker/main.wsdl
> >> When an event occurs on a WS resource, the subscriber will get notified.
> >> The only thing missing in the example is how to use it ;), what kind of
> >> soap request you should send to subscribe (the wsdl is not enough).
> >> You can find documentation of WS-Notification at this address :
> >> http://www-128.ibm.com/developerworks/grid/library/gr-ws-not/
> >> http://www-128.ibm.com/developerworks/grid/library/gr-ws-not/
> >> There are examples of such requests.
> >>
> >>
> >>
> >>
> >> dadade wrote:
> >>>
> >>> This sounds like what I want to do.  Where can I find the complete
> >>> example?
> >>>
> >>> Thanks
> >>>
> >>>
> >>> frederic.dreyfus wrote:
> >>>>
> >>>> I'll post a complete example (with the source code) of this use case
> >>>> ASAP.
> >>>>
> >>>> To answer your previous question, the consumer needs to expose a Notify
> >>>> Web Service as well to get notifications from the Bus. As I said, the
> >>>> code will follow...
> >>>>
> >>>> Cheers,
> >>>>
> >>>> Fred
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
>
> --
>
> View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-tf1524232s12049.html#a11940728
>
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/

Re: Send a remote WS-Notification subscription

Posted by bgoetzmann <bg...@sophia.symag.com>.
Hello Guillaume,

What is the XML structure for a remote WS-Notification unsubscribe?

Thank you!

Bertrand.



gnodet wrote:
> 
> 
> Here is a sample html client page that I started some time ago.
> Not sure what's its exact state, but if someone want to update 
> and finish it ... ;)
> Anyway here it is:  http://www.nabble.com/file/p6660986/client.html
> client.html 
> 
> Cheers,
> Guillaume Nodet
> 
> 
> frederic.dreyfus wrote:
>> 
>> Hi 
>> 
>> You can find an example in the 3.0 release of servicemix. This is the
>> wsn-http-binding example.
>> In this example the WS-NotificationBroker is exposed through HTPP so that
>> you can subscribe to a topic from outside the JBI container.
>> The wsdl of the NotificationBroker service is (in the example) at this
>> address :  http://localhost:8192/Broker/main.wsdl
>> http://localhost:8192/Broker/main.wsdl 
>> When an event occurs on a WS resource, the subscriber will get notified.
>> The only thing missing in the example is how to use it ;), what kind of
>> soap request you should send to subscribe (the wsdl is not enough).
>> You can find documentation of WS-Notification at this address :
>> http://www-128.ibm.com/developerworks/grid/library/gr-ws-not/
>> http://www-128.ibm.com/developerworks/grid/library/gr-ws-not/ 
>> There are examples of such requests.
>> 
>> 
>> 
>> 
>> dadade wrote:
>>> 
>>> This sounds like what I want to do.  Where can I find the complete
>>> example?
>>> 
>>> Thanks
>>> 
>>> 
>>> frederic.dreyfus wrote:
>>>> 
>>>> I'll post a complete example (with the source code) of this use case
>>>> ASAP.
>>>> 
>>>> To answer your previous question, the consumer needs to expose a Notify
>>>> Web Service as well to get notifications from the Bus. As I said, the
>>>> code will follow...
>>>> 
>>>> Cheers,
>>>> 
>>>> Fred
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-tf1524232s12049.html#a11940728
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by dadade <de...@lmco.com>.
Hi,

I used ant to build and deploy the wsn-http-binding example.  However, when
I ran the client.html, it gave me an error saying "open error".

I don't understand how the wsn-http-binding works or its purpose.  Can
someone provide me with an explanation?  Thanks.  All I see is the
xbean.xml.  I understand that the wsdl is
http://localhost:8192/broker/main.wsdl.  How does the wsdl helps me to
understand that the consumer is going to subscribe a topic, and a producer
is going to notify the consumer who subscribes it when an event occurs?

>From what I read
http://www-128.ibm.com/developerworks/grid/library/gr-ws-not/ , there should
be a consumer service and a producer serveice, where are they in the
wsn-http-binding example?

Please help.  I would like to know how to get started on the remote
WS-Notification example.

Thanks



gnodet wrote:
> 
> 
> Here is a sample html client page that I started some time ago.
> Not sure what's its exact state, but if someone want to update 
> and finish it ... ;)
> Anyway here it is:  http://www.nabble.com/file/294/client.html client.html 
> 
> Cheers,
> Guillaume Nodet
> 
> 
> frederic.dreyfus wrote:
>> 
>> Hi 
>> 
>> You can find an example in the 3.0 release of servicemix. This is the
>> wsn-http-binding example.
>> In this example the WS-NotificationBroker is exposed through HTPP so that
>> you can subscribe to a topic from outside the JBI container.
>> The wsdl of the NotificationBroker service is (in the example) at this
>> address : http://localhost:8192/Broker/main.wsdl
>> When an event occurs on a WS resource, the subscriber will get notified.
>> The only thing missing in the example is how to use it ;), what kind of
>> soap request you should send to subscribe (the wsdl is not enough).
>> You can find documentation of WS-Notification at this address
>> :http://www-128.ibm.com/developerworks/grid/library/gr-ws-not/
>> There are examples of such requests.
>> 
>> 
>> 
>> 
>> dadade wrote:
>>> 
>>> This sounds like what I want to do.  Where can I find the complete
>>> example?
>>> 
>>> Thanks
>>> 
>>> 
>>> frederic.dreyfus wrote:
>>>> 
>>>> I'll post a complete example (with the source code) of this use case
>>>> ASAP.
>>>> 
>>>> To answer your previous question, the consumer needs to expose a Notify
>>>> Web Service as well to get notifications from the Bus. As I said, the
>>>> code will follow...
>>>> 
>>>> Cheers,
>>>> 
>>>> Fred
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-tf1524232.html#a6770832
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by gnodet <gn...@gmail.com>.

Here is a sample html client page that I started some time ago.
Not sure what's its exact state, but if someone want to update 
and finish it ... ;)
Anyway here it is:  http://www.nabble.com/file/294/client.html client.html 

Cheers,
Guillaume Nodet


frederic.dreyfus wrote:
> 
> Hi 
> 
> You can find an example in the 3.0 release of servicemix. This is the
> wsn-http-binding example.
> In this example the WS-NotificationBroker is exposed through HTPP so that
> you can subscribe to a topic from outside the JBI container.
> The wsdl of the NotificationBroker service is (in the example) at this
> address : http://localhost:8192/Broker/main.wsdl
> When an event occurs on a WS resource, the subscriber will get notified.
> The only thing missing in the example is how to use it ;), what kind of
> soap request you should send to subscribe (the wsdl is not enough).
> You can find documentation of WS-Notification at this address
> :http://www-128.ibm.com/developerworks/grid/library/gr-ws-not/
> There are examples of such requests.
> 
> 
> 
> 
> dadade wrote:
>> 
>> This sounds like what I want to do.  Where can I find the complete
>> example?
>> 
>> Thanks
>> 
>> 
>> frederic.dreyfus wrote:
>>> 
>>> I'll post a complete example (with the source code) of this use case
>>> ASAP.
>>> 
>>> To answer your previous question, the consumer needs to expose a Notify
>>> Web Service as well to get notifications from the Bus. As I said, the
>>> code will follow...
>>> 
>>> Cheers,
>>> 
>>> Fred
>>> 
>> 
>> 
> 
> 


-- 
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-tf1524232.html#a6660986
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by "frederic.dreyfus" <fr...@sungard.com>.
Hi 

You can find an example in the 3.0 release of servicemix. This is the
wsn-http-binding example.
In this example the WS-NotificationBroker is exposed through HTPP so that
you can subscribe to a topic from outside the JBI container.
The wsdl of the NotificationBroker service is (in the example) at this
address : http://localhost:8192/Broker/main.wsdl
When an event occurs on a WS resource, the subscriber will get notified.
The only thing missing in the example is how to use it ;), what kind of soap
request you should send to subscribe (the wsdl is not enough).
You can find documentation of WS-Notification at this address
:http://www-128.ibm.com/developerworks/grid/library/gr-ws-not/
There are examples of such requests.




dadade wrote:
> 
> This sounds like what I want to do.  Where can I find the complete
> example?
> 
> Thanks
> 
> 
> frederic.dreyfus wrote:
>> 
>> I'll post a complete example (with the source code) of this use case
>> ASAP.
>> 
>> To answer your previous question, the consumer needs to expose a Notify
>> Web Service as well to get notifications from the Bus. As I said, the
>> code will follow...
>> 
>> Cheers,
>> 
>> Fred
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-tf1524232.html#a6660863
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by dadade <de...@lmco.com>.
This sounds like what I want to do.  Where can I find the complete example?

Thanks


frederic.dreyfus wrote:
> 
> I'll post a complete example (with the source code) of this use case ASAP.
> 
> To answer your previous question, the consumer needs to expose a Notify
> Web Service as well to get notifications from the Bus. As I said, the code
> will follow...
> 
> Cheers,
> 
> Fred
> 

-- 
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-tf1524232.html#a6651636
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by "frederic.dreyfus" <fr...@sungard.com>.
I'll post a complete example (with the source code) of this use case ASAP.

To answer your previous question, the consumer needs to expose a Notify Web
Service as well to get notifications from the Bus. As I said, the code will
follow...

Cheers,

Fred
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4404322
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by chris24 <il...@gmail.com>.
I just got the code working. Now I need to look into setting up the endpoint
so that the client can recieve notify calls. What steps are involved in
doing that. Obviously it is done in configuration. Thanks,

Chris
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4400056
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by chris24 <il...@gmail.com>.
Thanks....I have been out of town. I will go mess with this now. Is the
output of WSDL2Java source files or class files. And when you say put them
in your sources directory, which sources directory are you referring to?

Chris
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4399649
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by "frederic.dreyfus" <fr...@sungard.com>.
Well,

You don't need to install the axis webapp to make this work but you need
axis jars files to run WSDL2Java and to run the client.
Here is the Ant task I use to generate the stubs (servicemix must be
started) :
       <target name="WSDL2Java">		
		<java classname="org.apache.axis.wsdl.WSDL2Java">
			<arg value="http://localhost:8192/Broker/main.wsdl"/>
	         <classpath>
	         	<fileset dir="lib">
	         	        <include name="**/*.jar"/>
	         	</fileset>	           
	         </classpath>
		</java>
	</target>

The lib directory contains the following jars (used for WSDL2Java AND to run
the client) :
axis-1.2.1.jar
axis-jaxrpc-1.2.1.jar
axis-saaj-1.2.1.jar
axis-wsdl4j-1.2.jar
axis-wsdl4j-1.5.1.jar
commons-discovery-0.2.jar
commons-logging-1.0.4.jar
xercesImpl-2.7.1.jar

Once the stubs are generated, put them in your sources directory.
You can then use the sample code I posted earlier in this thread to make the
call.

Cheers,

Fred 
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4354193
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by chris24 <il...@gmail.com>.
Do you need to install Axis to run WSDL2Java? It seems you should be able to
generate the client code without installing axis. I ran WSDL2Java and got a
bunch of .java files. I would like to try this functionality out. Thanks
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4348675
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by chris24 <il...@gmail.com>.
Do you need to install Axis to useWSDL2Java? It seems you should be able to
generate the client code without installing axis. I ran WSDL2Java and got a
bunch of .java files. I would like to try this functionality out. Thanks
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4348675
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by "frederic.dreyfus" <fr...@sungard.com>.
Hi Chris,

Basically I had just to run the wsn-http-binding example bundled in the
SNAPSHOT release.
The NotificationBroker's wsdl is available at
http://localhost:8192/Broker/?wsdl
You can then use a tool to generate the client stubs from the wsdl (for
instance axis WSDL2Java) and call the Subscribe operation.
To subscribe you need to provide a topic and a consumer reference.
The consumer reference can be directly added to the subscribe object whereas
the topic has to be added as a filter to the subscribe object.

Here is the code to (after WSDL2Java generation) to specify the topic :

Subscribe subscribe = new Subscribe();

String WSN_URI = "http://docs.oasis-open.org/wsn/b-2";
QName QNAME_TOPIC_EXPRESSION = new QName(WSN_URI, "TopicExpression");
FilterType filter = new FilterType();
MessageElement[] elements = new MessageElement[1];
elements[0] = new MessageElement();
elements[0].setQName(QNAME_TOPIC_EXPRESSION);
elements[0].setValue("myTopic");
filter.set_any(elements);

subscribe.setFilter(filter);

Hope this helps.

Cheers,

Fred
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4314758
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by chris24 <il...@gmail.com>.
Hey Fred,

    Can you elaborate a little on how you did this? This sounds quite
similar to what I want to do.

Thanks
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4285431
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by "frederic.dreyfus" <fr...@sungard.com>.
Thank you very much.

You will get feedback asap.

Fred
--
View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4181583
Sent from the ServiceMix - User forum at Nabble.com.


Re: Send a remote WS-Notification subscription

Posted by Guillaume Nodet <gn...@gmail.com>.
I fixed a bug preventing the WSDL to be exposed.
I also added a simple demo showing how to expose the
WS-NotificationBroker over http/soap.
All this should be available in next nightly snapshot.

Cheers,
Guillaume Nodet

On 5/1/06, frederic.dreyfus <fr...@sungard.com> wrote:
>
> I tried your example but it did not work.
> Actually, I have a simple WSNComponent declared in my servicemix.xml file :
> <sm:activationSpec>
>   <sm:component>
>      <bean class="org.apache.servicemix.wsn.spring.WSNSpringComponent">
>          <property name="connectionFactory" ref="connectionFactory" />
>      </bean>
>   </sm:component>
> </sm:activationSpec>
>
> Then I deploy a JBI component into the deploy directory. This JBI component
> contains the soap binding :
> <http:endpoint service="wsn:NotificationBroker"
>                         endpoint="http-binding"
>                         targetService="wsn:NotificationBroker"
>                         role="consumer"
>                         locationURI="http://localhost:8192/Broker/"
>                         defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> />
>
> The component seems to be successfully deployed (I get it in the services
> list), but when I click on the service link, the wsdl is still not
> retrieved.
> I tried adding the wsdlResource property to the bean, but then there are
> import problems.
>
> Please help, I really need to make this work.
>
> Thanks very much,
>
> Fred
> --
> View this message in context: http://www.nabble.com/Send-a-remote-WS-Notification-subscription-t1524232.html#a4172227
> Sent from the ServiceMix - User forum at Nabble.com.
>
>