Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > web Service given by ServiceFactory.createService of wrong class in glassfish

Reply
Thread Tools

web Service given by ServiceFactory.createService of wrong class in glassfish

 
 
ses
Guest
Posts: n/a
 
      10-29-2010
OK so I'm trying to write a client for a SOAP web service using the
dynamic proxy method.

My code is pretty much the standard:

String wsdlURL = SERVICE_WSDL;
String namespace = SERVICE_NAMESPACE;
String serviceName = SERVICE_NAME;
QName serviceQN = new QName(namespace, serviceName);
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service requestedService =
(Service) serviceFactory.createService(new URL(wsdlURL), serviceQN);

However I get from glassfish:

ClassCastException com.sun.xml.rpc.client.dii.ConfiguredService cannot
be cast to javax.xml.ws.Service

I really don't get it as the import is javax.xml.ws.Service and I'm
not trying to use DII, everything else seems fine so I can only
conclude glassfish is interpreting ServiceFactory.newInstance()
wrongly, please can anyone help?
 
Reply With Quote
 
 
 
 
ses
Guest
Posts: n/a
 
      10-29-2010
On 29 Oct, 20:43, ses <(E-Mail Removed)> wrote:
> OK so I'm trying to write a client for a SOAP web service using the
> dynamic proxy method.
>
> My code is pretty much the standard:
>
> String wsdlURL = SERVICE_WSDL;
> String namespace = SERVICE_NAMESPACE;
> String serviceName = SERVICE_NAME;
> QName serviceQN = new QName(namespace, serviceName);
> ServiceFactory serviceFactory = ServiceFactory.newInstance();
> Service requestedService =
> * * * * (Service) serviceFactory.createService(new URL(wsdlURL), serviceQN);
>
> However I get from glassfish:
>
> ClassCastException com.sun.xml.rpc.client.dii.ConfiguredService cannot
> be cast to javax.xml.ws.Service
>
> I really don't get it as the import is javax.xml.ws.Service and I'm
> not trying to use DII, everything else seems fine so I can only
> conclude glassfish is interpreting ServiceFactory.newInstance()
> wrongly, please can anyone help?


Actually I was wrong, javax.xml.rpc.ServiceFactory was being used...
this could be the problem
 
Reply With Quote
 
 
 
 
ses
Guest
Posts: n/a
 
      10-31-2010
On 29 Oct, 19:51, ses <(E-Mail Removed)> wrote:
> On 29 Oct, 20:43, ses <(E-Mail Removed)> wrote:
>
>
>
>
>
>
>
>
>
> > OK so I'm trying to write a client for a SOAP web service using the
> > dynamic proxy method.

>
> > My code is pretty much the standard:

>
> > String wsdlURL = SERVICE_WSDL;
> > String namespace = SERVICE_NAMESPACE;
> > String serviceName = SERVICE_NAME;
> > QName serviceQN = new QName(namespace, serviceName);
> > ServiceFactory serviceFactory = ServiceFactory.newInstance();
> > Service requestedService =
> > * * * * (Service) serviceFactory.createService(new URL(wsdlURL), serviceQN);

>
> > However I get from glassfish:

>
> > ClassCastException com.sun.xml.rpc.client.dii.ConfiguredService cannot
> > be cast to javax.xml.ws.Service

>
> > I really don't get it as the import is javax.xml.ws.Service and I'm
> > not trying to use DII, everything else seems fine so I can only
> > conclude glassfish is interpreting ServiceFactory.newInstance()
> > wrongly, please can anyone help?

>
> Actually I was wrong, javax.xml.rpc.ServiceFactory was being used...
> this could be the problem


For anyone interested, strangely I found that if I used
ConfiguredService, the whole thing worked as though using a Dynamic
Proxy, perhaps in glassfish ConfiguredService = using web service via
dynamic proxy.

I suppose given the many stages JAX-WS has gone through to become what
it is now, there are inevitably different ways of doing things
particularly with different application servers.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Has thought been given given to a cleaned up C? Possibly called C+. Casey Hawthorne C Programming 385 04-04-2010 02:11 AM
" Given BACK what was freely GIVEN " 2Barter.net C++ 0 12-13-2006 02:56 AM
Days in a given date range for a given month......... Lord0 Java 1 04-19-2006 04:54 PM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
generate all possible strings of given length given a set of characters chiara C Programming 6 10-06-2005 01:43 AM



Advertisments