Skip to main content



      Home
Home » Archived » BIRT » ClassCastException when using a BindingProvider
ClassCastException when using a BindingProvider [message #1228193] Mon, 06 January 2014 11:16
Eclipse UserFriend
Hello there,

I have the below code
public static ListsSoap sharePointListsAuth(String userName, String password) throws Exception {
    ListsSoap port = null;
    if (userName != null && password != null) {
        try {
            Lists service = new ListsLocator();
            port = service.getListsSoap();
            BindingProvider bp = (BindingProvider) port;
            Map<String, Object> rc = bp.getRequestContext();
            System.out.println("Web Service Auth Username: " + userName);
            rc.put(BindingProvider.USERNAME_PROPERTY, userName);
           // ((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, userName);
           // ((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
        } catch (Exception e) {
            throw new Exception("Error: " + e.toString());
        }
    } else {
        throw new Exception("Couldn't authenticate: Invalid connection details given.");
    }
    return port;
}


I get an error saying "java.lang.ClassCastException: com.microsoft.schemas.sharepoint.soap.ListsSoapStub cannot be cast to javax.xml.ws.BindingProvider"

I have been following the "reading-a-sharepoint-list-with-java-tutorial" (which can be found via google"

Can anyone please help in this issue, its been driving me crazy as to why I cannot do this!
Previous Topic:Dynamically sum column-data total in tables onPrepare event
Next Topic:Birt report - own buttons for refresh
Goto Forum:
  


Current Time: Thu Jul 03 21:04:02 EDT 2025

Powered by FUDForum. Page generated in 0.03381 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top