I'm integrating with a third party web service (Adyen) using JAX-WS RI. I have downloaded a copy of their wsdl and have used jaxws:wsdl2java in my build to generate the web service implementation source code. At runtime, when I attempt to setup a port by calling the getPort() method of my auto-generated Payment service class, I get the following exception claiming that there is a method exposed, but it is not present in the wsdl portType element:
javax.xml.ws.WebServiceException: Method adjustAuthorisation is exposed as WebMethod, but there is no corresponding wsdl operation with name {http://payment.services.adyen.com}adjustAuthorisation in the wsdl:portType{http://payment.services.adyen.com}PaymentPortType
But, it is present in the portType element. Here's the relevant snipped of the wsdl:
<wsdl:portType name="PaymentPortType">
<wsdl:operation name="adjustAuthorisation">
<wsdl:input name="adjustAuthorisationRequest" message="tns:adjustAuthorisationRequest" />
<wsdl:output name="adjustAuthorisationResponse" message="tns:adjustAuthorisationResponse" />
<wsdl:fault name="ServiceException" message="tns:ServiceException" />
</wsdl:operation>
...
</wsdl:portType>
The full wsdl can be seen here: https://pal-live.adyen.com/pal/servlet/Payment/v30?wsdl
The wsdl is included in the target jar with classpath /wsdl/Payment.wsdl. I am loading it at runtime using this code in a config class:
URL wsdl = getClass().getResource(wsdlLocation);
onlineService = new Payment(wsdl, new QName(serviceUrl, serviceName));
Where serviceUrl = "http://payment.services.adyen.com" and serviceName = "Payment" which matches the wsdl.
Finally, here's the code snippet where I attempt to open the port and ultimately get the exception:
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
try
{
port = config.getOnlineService().getPaymentHttpPort(); // exception thrown here
}
finally
{
Thread.currentThread().setContextClassLoader(oldClassLoader);
}
Any ideas why it seems to be misreading the wsdl? Another potentially important piece of info is that I recently updated the wsdl, previously my app used version 12 of Adyen's API with the corresponding wsdl, now I am upgrading to version 30. The application worked fine with the same code previously.
