On Nov 15, 2007 2:46 PM, ashjk <[EMAIL PROTECTED]> wrote:

> Hello,
>
> I am using callback in my use-case, the scenario is that the callback
> should happen (to the client) only after the approval from an approver. As I
> could see from the samples that the flow is streamlined, I had tried out a
> sample separating the service & client as different composites but it is not
> working as it is throwing some NullPointer Exception while invocation, I
> would be grateful if anyone would like to help me in this regard.
>
> Thanks & Regards,
> Ashwini Kumar J
>


Hi Ashwini

I've been looking at you problem and it appears to be something to do with
promoted references. In the first instance I created an example of what you
are trying to achieve by taking the Tuscany sample simple-callback-ws and
splitting it across two modules. They are in my sandbox [1][2] and work for
me in the form that I have them checked in. However if I change the client
composite file from.

    <component name="MyClientComponent">
        <implementation.java class="simplecallback.MyClientImpl" />
         <reference name="myService">
            <interface.java interface="simplecallback.MyService"
                callbackInterface="simplecallback.MyServiceCallback" />
            <binding.ws
wsdlElement="http://simplecallback#wsdl.port(MyServiceSoapService/MyServiceSoapPort)
<http://simplecallback/#wsdl.port(MyServiceSoapService/MyServiceSoapPort)>"
/>
            <callback>
                <binding.ws wsdlElement="
http://simplecallback#wsdl.port(MyServiceCallbackSoapService/MyServiceCallbackSoapPort)
<http://simplecallback/#wsdl.port(MyServiceCallbackSoapService/MyServiceCallbackSoapPort)>"
/>
            </callback>
        </reference>
    </component>

to

    <component name="MyClientComponent">
        <implementation.java class="simplecallback.MyClientImpl" />
         <reference name="myService"/>
    </component>

         <reference name="MyService" promote="MyClientComponent/myService">
            <interface.java interface="simplecallback.MyService"
                callbackInterface="simplecallback.MyServiceCallback" />
            <binding.ws wsdlElement="
http://simplecallback#wsdl.port(MyServiceSoapService/MyServiceSoapPort)<http://simplecallback/#wsdl.port(MyServiceSoapService/MyServiceSoapPort)>"
/>
            <callback>
                <binding.ws
wsdlElement="http://simplecallback#wsdl.port(MyServiceCallbackSoapService/MyServiceCallbackSoapPort)
<http://simplecallback/#wsdl.port(MyServiceCallbackSoapService/MyServiceCallbackSoapPort)>"
/>
            </callback>
        </reference>

I.e, I've turned the component reference into a promoted reference. I now
get.

java.lang.NullPointerException
        at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.createOpe
rationClient(Axis2BindingInvoker.java:152)
        at
org.apache.tuscany.sca.binding.ws.axis2.Axis2OneWayBindingInvoker.inv
okeTarget(Axis2OneWayBindingInvoker.java :45)
        at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Ax
is2BindingInvoker.java:75)
        at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterc
eptor.invoke(DataTransformationInterceptor.java :74)
        at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
KInvocationHandler.java:233)
        at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
KInvocationHandler.java :130)
        at $Proxy7.someMethod(Unknown Source)
        at simplecallback.MyClientImpl.aClientMethod(MyClientImpl.java:42)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.
java:64)

Can you try modifying you sample to have nested references and services
rather than promoted reference and service and see if it makes a difference.
If so can you raise a JIRA describing the fault so we can track the fix

Regards

Simon

[1] 
http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/slaws/simple-callback-ws-client/

[2]
http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/slaws/simple-callback-ws-server/

Reply via email to