public interface Dispatch<T>
        extends BindingProvider

The Dispatch object obtained from createDistpatch extends the BindingProvider 
interface.  Just cast it.

Dan



On Fri August 14 2009 10:34:39 am xinxinwang wrote:
> I Created my service this way:
>
> Service service = Service.create(new QName(namespace, serviceName));
> QName portQName = new QName(namespace, portTypeName);
> service.addPort(portQName, SOAPBinding.SOAP11HTTP_BINDING, endPoint);
> dispatchPayload = service.createDispatch(portQName, Source.class,
> Service.Mode.PAYLOAD);
>
> I tried to cast the service to a BindingProvider and got an exception:
> Exception in thread "main" java.lang.ClassCastException:
> javax.xml.ws.Service cannot be cast to javax.xml.ws.BindingProvider
>       at
> mil.army.soa.adsl.client.DataServiceClient.initHandlers(DataServiceClient.j
>ava:77) at
> mil.army.soa.adsl.client.DataServiceClient.<init>(DataServiceClient.java:66
>) at mil.army.soa.adsl.tester.FuncTester.main(FuncTester.java:10)
>
> Thanks for any help.

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to