I am connecting to an external WSDL using IntelliJ.
After connecting to the WSDL and generating my Java classes I am attempting to get a response from the service.
The service is not complicated at all just simple 'Yes', 'No' and 'Incorrect' message responses.
But I am getting a class cast exception involving PortInfo
and Qname
.
The method list call is as below.
Service helloService = Service.create(
helloWsdlUrl,
new QName(nameSpaceUri, serviceName));
List list = helloService.getHandlerResolver().getHandlerChain(
(PortInfo) new QName(nameSpaceUri, portName));
list.add(new HandlerInfo((Class) null, (Map)null, (QName[])null));
And the error message I am getting is:
Exception in thread "main" java.lang.ClassCastException:
javax.xml.namespace.QName cannot be cast to javax.xml.ws.handler.PortInfo
at Client.main(Client.java:37)
Any help would be greatly appreciated.
Thank you