You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Rohan Sahgal <ro...@gmail.com> on 2008/10/31 20:15:50 UTC

Problems with helloworld-ws-reference sample

Hi all,
I had used the combination of helloworld-ws-service and
helloworld-ws-reference samples in Tuscany 1.2.

I used them as a building block to my own application.

At the time, the following worked:-
- Take the wsdl generated by helloworld-ws-service
- Replace the helloworld.wsdl in helloworld-ws-reference sample with
this new one.
- Update the wsdl service name and wsdl port name in the composite of
helloworld-ws-reference sample to reflect the new name's

Now this worked end-to-end.

However now with Tuscany 1.3.2 first of all the wsdl looks different

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="HelloWorldServiceComponent.HelloWorldService"
targetNamespace="http://helloworld/HelloWorldServiceComponent/HelloWorldService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://helloworld/HelloWorldServiceComponent/HelloWorldService"
xmlns:ns0="http://helloworld"
xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/">
  <wsdl:import namespace="http://helloworld"
location="/HelloWorldService?wsdl=wsdl/helloworld.wsdl">
    </wsdl:import>
  <wsdl:binding name="HelloWorldBinding" type="ns0:HelloWorld">
    <SOAP11:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getGreetings">
      <SOAP11:operation soapAction="urn:getGreetings"/>
      <wsdl:input name="getGreetingsRequest">
        <SOAP11:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="getGreetingsResponse">
        <SOAP11:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="HelloWorldService">
    <wsdl:port name="HelloWorldPort" binding="tns:HelloWorldBinding">
      <SOAP11:address location="http://128.107.103.204:8085/HelloWorldService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Now when I updated the reference sample with this wsdl and changed the
corresponding line's in its composite file with
<reference name="HelloWorldService"
promote="HelloWorldServiceComponent/helloWorldService">
        <interface.java interface="helloworld.HelloWorldService" />
        <binding.ws
wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
</reference>

 I get the following error,

run:
     [java] Injected helloWorldService
     [java] Called getGreetings
     [java] Exception in thread "main"
org.osoa.sca.ServiceRuntimeException: org.apache.axis2.AxisFault: The
system cannot infer the transport information from the / URL.
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:136)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
     [java]     at $Proxy4.getGreetings(Unknown Source)
     [java]     at
helloworld.HelloWorldServiceComponent.getGreetings(HelloWorldServiceComponent.java:30)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
     [java]     at
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
     [java]     at $Proxy4.getGreetings(Unknown Source)
     [java]     at helloworld.HelloWorldClient.main(HelloWorldClient.java:33)
     [java] Caused by: org.apache.axis2.AxisFault: The system cannot
infer the transport information from the / URL.
     [java]     at
org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:73)
     [java]     at
org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:302)
     [java]     at
org.apache.axis2.description.OutInAxisOperationClient.execute
Impl(OutInAxisOperation.java:174)
     [java]     at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker$1.run(Axis2BindingInvoker.java:128)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:126)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:94)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
     [java]     ... 16 more
     [java] Java Result: 1

This is the exact error I am getting in my application.

Has something changed, or am I missing something.

Thanks,
Rohan

Re: Problems with helloworld-ws-reference sample

Posted by Simon Nash <na...@apache.org>.
Rohan Sahgal wrote:
> Hi all,
> I had used the combination of helloworld-ws-service and
> helloworld-ws-reference samples in Tuscany 1.2.
> 
> I used them as a building block to my own application.
> 
> At the time, the following worked:-
> - Take the wsdl generated by helloworld-ws-service
> - Replace the helloworld.wsdl in helloworld-ws-reference sample with
> this new one.
> - Update the wsdl service name and wsdl port name in the composite of
> helloworld-ws-reference sample to reflect the new name's
> 
> Now this worked end-to-end.
> 
> However now with Tuscany 1.3.2 first of all the wsdl looks different
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions name="HelloWorldServiceComponent.HelloWorldService"
> targetNamespace="http://helloworld/HelloWorldServiceComponent/HelloWorldService"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:tns="http://helloworld/HelloWorldServiceComponent/HelloWorldService"
> xmlns:ns0="http://helloworld"
> xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/">
>   <wsdl:import namespace="http://helloworld"
> location="/HelloWorldService?wsdl=wsdl/helloworld.wsdl">
>     </wsdl:import>
>   <wsdl:binding name="HelloWorldBinding" type="ns0:HelloWorld">
>     <SOAP11:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="getGreetings">
>       <SOAP11:operation soapAction="urn:getGreetings"/>
>       <wsdl:input name="getGreetingsRequest">
>         <SOAP11:body use="literal"/>
>       </wsdl:input>
>       <wsdl:output name="getGreetingsResponse">
>         <SOAP11:body use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="HelloWorldService">
>     <wsdl:port name="HelloWorldPort" binding="tns:HelloWorldBinding">
>       <SOAP11:address location="http://128.107.103.204:8085/HelloWorldService"/>
>     </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
> 
> Now when I updated the reference sample with this wsdl and changed the
> corresponding line's in its composite file with
> <reference name="HelloWorldService"
> promote="HelloWorldServiceComponent/helloWorldService">
>         <interface.java interface="helloworld.HelloWorldService" />
>         <binding.ws
> wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
> </reference>
> 
>  I get the following error,
> 
> run:
>      [java] Injected helloWorldService
>      [java] Called getGreetings
>      [java] Exception in thread "main"
> org.osoa.sca.ServiceRuntimeException: org.apache.axis2.AxisFault: The
> system cannot infer the transport information from the / URL.
>      [java]     at
> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:136)
>      [java]     at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
>      [java]     at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
>      [java]     at $Proxy4.getGreetings(Unknown Source)
>      [java]     at
> helloworld.HelloWorldServiceComponent.getGreetings(HelloWorldServiceComponent.java:30)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      [java]     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>      [java]     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>      [java]     at java.lang.reflect.Method.invoke(Method.java:597)
>      [java]     at
> org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132)
>      [java]     at
> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>      [java]     at
> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
>      [java]     at
> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>      [java]     at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
>      [java]     at
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
>      [java]     at $Proxy4.getGreetings(Unknown Source)
>      [java]     at helloworld.HelloWorldClient.main(HelloWorldClient.java:33)
>      [java] Caused by: org.apache.axis2.AxisFault: The system cannot
> infer the transport information from the / URL.
>      [java]     at
> org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:73)
>      [java]     at
> org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:302)
>      [java]     at
> org.apache.axis2.description.OutInAxisOperationClient.execute
> Impl(OutInAxisOperation.java:174)
>      [java]     at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>      [java]     at
> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker$1.run(Axis2BindingInvoker.java:128)
>      [java]     at java.security.AccessController.doPrivileged(Native Method)
>      [java]     at
> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:126)
>      [java]     at
> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:94)
>      [java]     at
> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
>      [java]     ... 16 more
>      [java] Java Result: 1
> 
> This is the exact error I am getting in my application.
> 
> Has something changed, or am I missing something.
> 
> Thanks,
> Rohan
> 
> 
Hi Rohan,
It looks like the <binding.ws> element in the reference sample's composite
file is wrong.  You are using
  <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>

It looks like there are two problems with this:
  1. The port name is "HelloWorldSoapPort" and it should be "HelloWorldPort"
     to match the WSDL.
  2. The namespace is "http://helloworld" and it should be
     "http://helloworld/HelloWorldServiceComponent/HelloWorldService"
     to match the WSDL.

Can you change the <binding.ws> element to
  <binding.ws wsdlElement="http://helloworld/HelloWorldServiceComponent/HelloWorldService#wsdl.port(HelloWorldService/HelloWorldPort)"/>
and see if this fixes the problem?

   Simon