Looking for some quick help on wireformats, specifically 
<ts:wireFormat.jmsText/>.
I think I must be missing something obvious.
Basically, I modified the composite files to the have tuscany name space and 
placed the <ts:wireFormat.jmsText/> in the appropriate locations.

So the hello world service example now looks like this:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
        xmlns:sca="http://www.osoa.org/xmlns/sca/1.0";
        xmlns:ts="http://tuscany.apache.org/xmlns/sca/1.0";
        targetNamespace="http://helloworld";
        xmlns:hw="http://helloworld";
    name="helloworld">

    <component name="HelloWorldServiceComponent">
        <implementation.java class="helloworld.HelloWorldImpl" />
            <service name="HelloWorldService">
                <interface.java interface="helloworld.HelloWorldService"/>
                <binding.jms 
initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
                             jndiURL="tcp://localhost:61619">
                    <destination name="RequestQueue" create="ifnotexist"/>
                    <response>
                        <destination name="ResponseQueue" create="ifnotexist"/>
                                <ts:wireFormat.jmsText/>
                    </response>
                          <ts:wireFormat.jmsText/>
                </binding.jms>
        </service>
    </component>

</composite>

And the hello world reference jms example now looks like this:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
        targetNamespace="http://helloworld";
      xmlns:ts="http://tuscany.apache.org/xmlns/sca/1.0";
        xmlns:hw="http://helloworld";
        name="helloworldjmsreference">

    <!-- A component with a reference promoted as a composite reference -->
    <component name="HelloWorldServiceComponent">
      <implementation.java class="helloworld.HelloWorldServiceComponent"/>
      <reference name="helloWorldService">
          <interface.java interface="helloworld.HelloWorldService"/>
          <binding.jms 
initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
                       jndiURL="tcp://localhost:61619">
              <destination name="RequestQueue" create="always"/>
              <response>
                  <destination name="ResponseQueue" create="always"/>
                        <ts:wireFormat.jmsText/>
              </response>
                  <ts:wireFormat.jmsText/>
          </binding.jms>
      </reference>
    </component>

</composite>


I expected this to work based on the fact that the HelloWorld interface is:

public String getGreetings(String s)

And my understanding of wireFormat.jmsText is this:

"The data in the JMS message is the string representation of data coming 
from/going to the service operation. The service operation signature is 
expected to have a single String parameter"

However, when I run this, I get the following error:
d helloworld-reference-jms

C:\Documents and Settings\hatfieda\workspace\Tuscany\tuscany-sca-1.5.1\samples\h
elloworld-reference-jms>ant run
Buildfile: build.xml

     [java] INFO: Starting node: helloworldjmsreference.composite
     [java] Injected helloWorldService
     [java] Called getGreetings
     [java] Exception in thread "main" java.lang.ClassCastException: org.apache.
activemq.command.ActiveMQTextMessage
     [java]     at org.apache.tuscany.sca.binding.jms.wireformat.jmstext.runtime
.WireFormatJMSTextReferenceInterceptor.invokeRequest(WireFormatJMSTextReferenceI
nterceptor.java:83)
     [java]     at org.apache.tuscany.sca.binding.jms.wireformat.jmstext.runtime
.WireFormatJMSTextReferenceInterceptor.invoke(WireFormatJMSTextReferenceIntercep
tor.java:65)
     [java]     at org.apache.tuscany.sca.binding.jms.wireformat.jmstext.runtime
.WireFormatJMSTextReferenceInterceptor.invoke(WireFormatJMSTextReferenceIntercep
tor.java:68)
     [java]     at org.apache.tuscany.sca.binding.jms.provider.RRBJMSBindingInvo
ker.invoke(RRBJMSBindingInvoker.java:203)
     [java]     at org.apache.tuscany.sca.core.databinding.wire.PassByValueInter
ceptor.invoke(PassByValueInterceptor.java:55)
     [java]     at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.i
nvoke(JDKInvocationHandler.java:346)
     [java]     at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.i
nvoke(JDKInvocationHandler.java:193)
     [java]     at $Proxy5.getGreetings(Unknown Source)
     [java]     at helloworld.HelloWorldServiceComponent.getGreetings(HelloWorld
ServiceComponent.java:30)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:585)
     [java]     at org.apache.tuscany.sca.implementation.java.invocation.JavaImp
lementationInvoker.invoke(JavaImplementationInvoker.java:156)
     [java]     at org.apache.tuscany.sca.core.databinding.wire.PassByValueInter
ceptor.invoke(PassByValueInterceptor.java:60)
     [java]     at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.inv
oke(SCABindingInvoker.java:61)
     [java]     at org.apache.tuscany.sca.core.databinding.wire.PassByValueInter
ceptor.invoke(PassByValueInterceptor.java:60)
     [java]     at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.i
nvoke(JDKInvocationHandler.java:346)
     [java]     at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.i
nvoke(JDKInvocationHandler.java:193)
     [java]     at $Proxy5.getGreetings(Unknown Source)
     [java]     at helloworld.HelloWorldJmsClient.main(HelloWorldJmsClient.java:
36)


Reply via email to