File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Web Service Failed to call binding provider Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web Service Failed to call binding provider" Watch "Web Service Failed to call binding provider" New topic

Web Service Failed to call binding provider

Nilesh Mishra

Joined: Feb 16, 2012
Posts: 8
I have written web service example program using jboss as 7.0.2 Final profile. I want to add MAINTAIN_SESSION_PROPERTY to the client, but while casting to BindingProvider it generate the following exception
org.apache.cxf.calculator.CalculatorServiceSoapBindingStub cannot be cast to

My Web Service Code is

import javax.jws.WebService;

import org.apache.cxf.calculator.CalculatorPortType;
import org.apache.cxf.calculator.types.CalculatorFault;

@WebService(serviceName = "CalculatorService",
portName = "CalculatorPort",
targetNamespace = "",
endpointInterface = "org.apache.cxf.calculator.CalculatorPortType"
public class CalculatorImpl implements CalculatorPortType {
public int add(int number1, int number2) throws AddNumbersFault {
if (number1 < 0 || number2 < 0) {
CalculatorFault fault = new CalculatorFault();
fault.setMessage("Negative number cant be added!");
fault.setFaultInfo("Numbers: " + number1 + ", " + number2);
throw new AddNumbersFault("Negative number cant be added!", fault);
return number1 + number2;


and client code is

public class CalculatorWSClient {
private static final QName SERVICE_1 =
new QName("", "CalculatorService");

private static final QName PORT_1 =
new QName("", "CalculatorPort");

public static void main(String[] args) throws MalformedURLException, CalculatorFault, RemoteException, ServiceException {

String endpointAddress =

CalculatorService calcService=new CalculatorServiceLocator(endpointAddress, SERVICE_1);
CalculatorPortType port=calcService.getCalculatorPort();
System.out.println("\n\n\t-----1 Port: "+port);
BindingProvider bindingProvider=(BindingProvider)port;
Map<String,Object> rc = (Map<String,Object>)bindingProvider.getRequestContext();
System.out.println("\n\n\t-----1 Result: "+port.add(10, 20));


The generated WebServiceClient are :

Kindly help me.
I agree. Here's the link:
subject: Web Service Failed to call binding provider
It's not a secret anymore!