<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Hey Dan,</div><div><br></div><div>Thanks for putting these notes together. &nbsp;Very useful and I will definitely slap this into an article in the SwitchYard community. &nbsp;One small change to the steps you've used:</div><div><br><blockquote type="cite"><div><div><font class="Apple-style-span" color="#000000"><br></font><div># add &lt;component name="Hello"&gt;&lt;/component&gt; and &lt;component name="Goodbye"&gt;&lt;/component&gt; nodes as children of the &lt;composite&gt; node in switchyard.xml</div></div></div></blockquote><div><br></div><div>This is not necessary and I'll tell you why in one sec ...</div><br><blockquote type="cite"><div><div>

<div><br></div><div>switchyard add-reference --referenceName Hello --interfaceType java --interface org.example.greeting.Hello --componentName Hello</div><div>switchyard add-reference --referenceName Goodbye --interfaceType java --interface org.example.greeting.Goodbye --componentName Goodbye</div></div></div></blockquote><div><br></div><div>I left out an important detail in my prior email, which is that the target component for these references should be the Greeting service component. &nbsp;A service reference is essentially documentation of a dependency on another service (e.g. @Inject in a bean, import … in a Java class, etc.). &nbsp;So in this case, you want to add the references to the component which is calling the service(s). &nbsp;Modifying your instructions, it should look like this:</div><div><br></div><div><div>switchyard add-reference --referenceName Hello --interfaceType java --interface org.example.greeting.Hello --componentName Greeting</div><div>switchyard add-reference --referenceName Goodbye --interfaceType java --interface org.example.greeting.Goodbye --componentName&nbsp;Greeting</div><div><br></div><div>The reason why it works with your original commands is that there's a bug (which you uncovered ;-) ) where service references are shared across all service components in an application. &nbsp;So even though you were defining the service reference on the Hello service component, the Greeting service component was able to resolve the same reference at runtime. &nbsp;This also required you to add the extra component definitions to switchyard.xml in order to add the reference to them.</div><div><br></div><div>Bottom line is that if you use the modified commands above, it will still work and you won't have to muck with the XML at all. &nbsp;Here's the JIRA for the bug:</div><div><a href="https://issues.jboss.org/browse/SWITCHYARD-915">https://issues.jboss.org/browse/SWITCHYARD-915</a></div><div><br></div><div>cheers,</div><div>keith</div></div><div><br></div><br><blockquote type="cite"><div><div>

<div><br></div><div>test</div><div><br></div><div>switchyard promote-service --serviceName Greeting</div><div>camel-binding bind-service --serviceName Greeting --configURI <a href="file:///tmp/input">file:///tmp/input</a></div><div><br></div><div>build</div>

<div><br></div><div># deploy target/greeting.jar to SwitchYard AS 7 Server (<a href="http://downloads.jboss.org/switchyard/releases/v0.5.Beta1/switchyard-as7-0.5.0.Beta1.zip">http://downloads.jboss.org/switchyard/releases/v0.5.Beta1/switchyard-as7-0.5.0.Beta1.zip</a>)</div>

<div><br></div><div>mkdir /tmp/input</div><div>echo "SwitchYard" &gt; /tmp/input/message.txt</div><div><br></div><div># Observe the following output in the AS 7 console:</div><div>#&nbsp;INFO &nbsp;[stdout] (Camel (camel-5) thread #10 - <a href="file:///tmp/input">file:///tmp/input</a>) Hello, SwitchYard</div>

<div><div># INFO &nbsp;[stdout] (Camel (camel-5) thread #10 - <a href="file:///tmp/input">file:///tmp/input</a>)&nbsp;</div><div># INFO &nbsp;[stdout] (Camel (camel-5) thread #10 - <a href="file:///tmp/input">file:///tmp/input</a>) Goodbye, SwitchYard</div><div># INFO &nbsp;[stdout] (Camel (camel-5) thread #10 - <a href="file:///tmp/input">file:///tmp/input</a>)&nbsp;</div>

</div><div><br></div><div>Good luck!</div><div><br></div><div>-Dan</div></div><div><div><br><div class="gmail_quote">On Fri, Jul 6, 2012 at 6:34 PM, Dan Allen <span dir="ltr">&lt;<a href="mailto:dan.j.allen@gmail.com" target="_blank">dan.j.allen@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Jul 6, 2012 at 5:53 PM, Keith Babo <span dir="ltr">&lt;<a href="mailto:kbabo@redhat.com" target="_blank">kbabo@redhat.com</a>&gt;</span> wrote:<br>

</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF"><div>This is a "feature" of the XML validation in Eclipse. &nbsp;Disable "Honour all scheme locations" under XML - Validation (or something like that).<br></div></div></blockquote></div>

<div>
<br>When I got back a test with lots of red marks, I should have asked my teacher "is it possible to turn off this validation feature?"<br><br>hahaha <br></div><span class="HOEnZb"><font color="#888888"><div><br clear="all">

-Dan<br></div></font></span></div><div class="HOEnZb"><div class="h5"><br>-- <br>
<div>Dan Allen</div>Principal Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><div><a href="http://google.com/profiles/dan.j.allen" target="_blank">http://google.com/profiles/dan.j.allen</a><br>


<a href="http://mojavelinux.com/" target="_blank">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br></div><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Dan Allen</div>Principal Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><div><a href="http://google.com/profiles/dan.j.allen" target="_blank">http://google.com/profiles/dan.j.allen</a><br>

<a href="http://mojavelinux.com/" target="_blank">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br></div><br>
</div></div></div>
</blockquote></div><br></body></html>