You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by João Luz <jl...@sinfic.pt> on 2006/07/23 17:33:33 UTC

Need Help: Calling external webservice problem!

Hi,
 
I need urgent help.
 
I'm trying too call a simple Hello WebService using xfire. Using X-Fire is fine the problem is when a proxy this web service with servicemix.
 
>From log I see that servicemix receives the soap message and forward it to my webservice. The problem is that ServiceMix doesn't return the response for the client.
 
>From servicemix log I obtain the following lines (among others)...
16:24:37,861 | DEBUG | Thread-72  | DeliveryChannelImpl      | .messaging.DeliveryChannelImpl  577 | Processing inbound exchange: MessageExchange[
  id: ID:jluz-pt-3896-1153666319255-6:20
  status: Active
  role: consumer
  service: {http://xfire.codehaus.org/HelloService}HelloService
  endpoint: xpto
  operation: {http://xfire.sinfic.pt}hello
  in: <?xml version="1.0" encoding="UTF-8"?><hello xmlns="http://xfire.sinfic.pt" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
  out: <?xml version="1.0" encoding="UTF-8"?><helloResponse xmlns="http://xfire.codehaus.org/HelloService" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><out xmlns="http://xfire.codehaus.org/HelloService">Hello!</out></helloResponse>
]

 
As you can see the response is there, it means that service mix did the first part (forwarding request to the real web service).
 
Endpoints configuration is as follows:
 
<http:endpoint service="xns:HelloServiceProxy" endpoint="endpoint" targetService="xns:HelloService" targetEndpoint="xpto" role="consumer"  soap="true" 
                            soapVersion="1.1" locationURI=http://localhost:8192/HelloServiceProxy/"defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />

<http:endpoint service="xns:HelloService" endpoint="xpto"
                            role="provider"
                            soap="true" soapVersion="1.1" 
                            targetService="xns:HelloService" 
                            targetEndpoint="HelloServiceHttpPort" locationURI=http://localhost:8080/xfire-ws/services/HelloService" 
                     wsdlResource="http://localhost:8080/xfire-ws/services/HelloService?wsdl" />

 
The problem is that the client doesn't receive de response. The code I use for acessing is the following.
 
public class ClientXFire {

    public static void main(String[] args) throws MalformedURLException, Exception {
        String serviceDesc = http://localhost:8192/HelloServiceProxy/ <http://localhost:8192/HelloServiceProxy/> ;
        //String serviceDesc = http://localhost:8080/xfire-ws/services/HelloService <http://localhost:8080/xfire-ws/services/HelloService> ;
        Service serviceModel = new ObjectServiceFactory().create(IHelloService.class);
        IHelloService service = (IHelloService) new XFireProxyFactory().create(serviceModel, serviceDesc);
        System.out.println(service.hello());
        System.out.println("finito!");
    }
}

If I access directly the real web service (http://localhost:8080/xfire-ws/services/HelloService <http://localhost:8080/xfire-ws/services/HelloService> ) the output is as excepted, i.e:
    Hello World!
    Finito.

I hope you can have some helpfull ideas for what may be the cause of this strange behaviour...
 
Best Regards,
    João