views:

100

answers:

0

A few weeks ago, my code was working perfectly as expected. I returned to it, and for some reason, when I tried to deploy my web service, it was refusing to, since one of the methods handles and returns a weka.core.Instances object. I'd come across this error before, since Web Services cannot accept or return complex objects without some sort of serialization to String.

However, the odd thing is that this method isn't a webservice - it's simply a method used by the webservice method in the background. I tried making the offending method private to see what would happen, and it deployed. However, now when I create webservice clients for the service, I can call absolutely any method from the web service, instead of just the actual webservice.

Can anyone explain why this could possibly be happening?

Example "troublesome" method (not meant to be open to the world a webservice):

    private void setTraining(Instances trainingData, String index) {
        m_Training = trainingData;

        if (index.equals("last")) {
            m_Training.setClassIndex(m_Training.numAttributes() - 1);
        } else if (index.equals("first")) {
            m_Training.setClassIndex(0);
        }

    } 

Example of the beginning of the actual webservice:

    /**
     * Web service operation - Pure Strings version
     */
    @WebMethod(operationName = "train")
    public String train(@WebParam(name = "trainData") String trainData, 
    @WebParam(name = "targetModelDirectory") String targetModelDirectory, 
    @WebParam(name = "targetModelFile") String targetModelFile, 
    @WebParam(name = "classIndex") String classIndex, 
    @WebParam(name = "classifier") String classifier, 
    @WebParam(name = "filterOptions") String filterOptions) {

        TextCatTrainer result = new TextCatTrainer();
        Instances trainInstances = null;
        ..........
    }