Hello,
I have been evaluating Xfire and created a document based web service per the
example on the website for the Weather Service using castor bindings. The web
service WSDL comes up and the web service works correctly when invoked from a C#
client. However I have not been able to write an XFire client for this service.
Not sure what's going on but the Xml generated doesn't right, however I have not
been able to figure out what I need to code in the client for the request to be
serialized properly. Here's the client code - 

        public static void main(String[] args)
        {
                //Create a metadata of the service      
                ObjectServiceFactory svcFactory = new ObjectServiceFactory();
                svcFactory.setBindingProvider(new AegisBindingProvider(new
CastorTypeMappingRegistry()));
                Service serviceModel = svcFactory.create(IWeatherService.class, 
null,
"http://www.webservicex.net";, null);
                
                //Create a proxy for the deployed service
                XFire xfire = XFireFactory.newInstance().getXFire();
                XFireProxyFactory factory = new XFireProxyFactory(xfire);

                String serviceUrl = 
"http://localhost:7002/xfirews-web/services/WeatherService";;
                IWeatherService client = null;
                try {
                        client = (IWeatherService)factory.create(serviceModel, 
serviceUrl);
                } 
                catch (MalformedURLException e) {
                        System.out.println("Error:" + e.toString());
                }

                //Invoke the service
                GetWeatherByZipCodeResponse serviceResponse = null;
                try {
                        GetWeatherByZipCode ZipCode = new GetWeatherByZipCode();
                        ZipCode.setZipCode("1050");
                        serviceResponse = client.GetWeatherByZipCode(ZipCode);
                } 
                catch (Exception e) {
                        System.out.println(e.toString());
                }
        }

The SOAP Xml generated for this looks as follows on a snoop - 
<soap:Envelope 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";>
<soap:Body>
<GetWeatherByZipCode xmlns="http://www.webservicex.net";>
<GetWeatherByZipCode xmlns="http://www.webservicex.net";>
<ZipCode>1050</ZipCode>
</GetWeatherByZipCode>
</GetWeatherByZipCode>
</soap:Body>
</soap:Envelope>

Can't be that complicated to create a client. What am I doing wrong?? Any help
would be appreciated. 

Thanks
Amit


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to