OK I see what is happening in the object that User extends you cannot call its default constructor.  I am going to manipulate my User object to handle this as not its default constructor calls super() but is there a way for me to manipulate teh way the object is put back together?

On 4/20/06, Jason Tesser <[EMAIL PROTECTED]> wrote:
I have a web service using Spring, JSR 181, and xfire.  I was working fine until I tries to make it take a parameter in the method being called.  Now I am getting teh following stack trace.  I will paste teh code below along with teh wsdl

10:41:48,511 INFO  [STDOUT] org.codehaus.xfire.fault.XFireFault: Illegal argument. Cannot use default constructor
10:41:48,511 INFO  [STDOUT]     at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java :31)
10:41:48,511 INFO  [STDOUT]     at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
10:41:48,511 INFO  [STDOUT]     at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault (ReadHeadersHandler.java:108)
10:41:48,511 INFO  [STDOUT]     at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
10:41:48,511 INFO  [STDOUT]     at org.codehaus.xfire.handler.HandlerPipeline.invoke (HandlerPipeline.java:98)
10:41:48,527 INFO  [STDOUT]     at org.codehaus.xfire.client.Client.onReceive(Client.java:352)
10:41:48,527 INFO  [STDOUT]     at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient (HttpChannel.java:179)
10:41:48,527 INFO  [STDOUT]     at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:82)
10:41:48,527 INFO  [STDOUT]     at org.codehaus.xfire.handler.OutMessageSender.invoke (OutMessageSender.java:26)
10:41:48,527 INFO  [STDOUT]     at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
10:41:48,527 INFO  [STDOUT]     at org.codehaus.xfire.client.Client.invoke(Client.java :263)
10:41:48,527 INFO  [STDOUT]     at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
10:41:48,527 INFO  [STDOUT]     at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
10:41:48,527 INFO  [STDOUT]     at $Proxy74.sync(Unknown Source)
10:41:48,527 INFO  [STDOUT]     at edu.bju.aem.job.LdapSync.sync(LdapSync.java:39)

Client code calling the service

    Service serviceModel = new ObjectServiceFactory()
                .create(LdapToDBSync.class);
        LdapToDBSync ldapSync = null;
        try {
            ldapSync = (LdapToDBSync) new XFireProxyFactory().create(
                    serviceModel, wsUrl);
        } catch (Exception e) {
            e.printStackTrace();
            return syncedResults;
        }
        try {
            syncedResults = ldapSync.sync(user);
            log.info("Synced " + syncedResults + " results");
        } catch (Exception e) {
            e.printStackTrace();
            log.error("Unable to use the LDAPSync service " + e.toString(), e);

service interface

@WebService(targetNamespace = "edu.bju.shared.ws.ldap")
public interface LdapToDBSync {

    @WebResult(name = "sync", targetNamespace = "edu.bju.shared.ws.ldap")
    @WebMethod()
    public int sync(User user)throws Exception;
}

Service impl
@WebService(serviceName = "LdapSync", endpointInterface = "edu.bju.shared.ws.ldap.LdapToDBSync ")
public class LdapSync implements LdapToDBSync {

    private DataBase dataBase;
    private LDAP ldap;
    private User userToCheckAgainst;
    private String roleNeeded;
   
    public int sync(User user) throws Exception {
        if(isSyncPermissionGranted(user)){
            ArrayList<LDAPPerson> people = ldap.loadLdapUsers();
            return dataBase.syncLDAPUsers(people);
        }
        throw new Exception("Authorization is denied to sync data");
    }
......


Reply via email to