0
votes

So adding some inputs:

The error seems to come from the WSDL file.

IWAB0399E Error in generating Java from WSDL: java.io.IOException: Error: missing type or ref attribute for node 'unknown' java.io.IOException: Error: missing type or ref attribute for node 'unknown'

I simplified the web service and now I have this WDSL file: WSDL


I'm trying to make a SOAP call from my java program, for which I used apache axis1. My client program is the following:

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;

public class Client {

    public Client() {
    }

    public class QueryResult implements java.io.Serializable{

        String type, name, revision, owner, current, description;

        public QueryResult() {
            super();
        }

        public String getType() { return type; }
        public void setType(String s) { type = s; }
        public String getName() { return name; }
        public void setName(String s) { name = s; }
        public String getRevision() { return revision; }
        public void setRevision(String s) { revision = s; }
        public String getOwner() { return owner; }
        public void setOwner(String s) { owner = s; }
        public String getCurrent() { return current; }
        public void setCurrent(String s) { current = s; }
        public String getDescription() { return description; }
        public void setDescription(String s) { description = s; }

      }

    public static void main(String [] args)
    {

        try {

            Service  service = new Service();

            Call call    = (Call) service.createCall();
            call.setTargetEndpointAddress( new java.net.URL(args[0]) );
            call.setOperationName(new QName("urn:Ppap2Service", "evaluateOne"));

            QName qr = new QName("urn:Ppap2Service", "QueryResult");
            BeanSerializerFactory bsf =   new BeanSerializerFactory(QueryResult.class,qr);   // step 2
            BeanDeserializerFactory bdf = new BeanDeserializerFactory(QueryResult.class,qr);  // step 3
            call.registerTypeMapping(QueryResult.class,qr,bsf,bdf);

            // Set the arguments for the call
            call.addParameter("type", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("name", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("revision", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("owner", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("vault", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("where", XMLType.XSD_STRING, ParameterMode.IN);
            call.setReturnType(qr);

            Object[] checkoutParams = new Object[6];
            checkoutParams[0] = args[1];
            checkoutParams[1] = args[2];
            checkoutParams[2] = args[3];
            checkoutParams[3] = args[4];
            checkoutParams[4] = args[5];
            checkoutParams[5] = args[6];

            QueryResult ret = (QueryResult)call.invoke(checkoutParams);

        } catch (Exception e) {

            System.out.println(e.toString());

        }
    }

}

This code gives me this exception when invoking the web service:

ERROR - Exception:
org.xml.sax.SAXException: No object was found for class type class Client
org.xml.sax.SAXException: No object was found for class type class Client
    at org.apache.axis.encoding.ConstructorTarget.set(ConstructorTarget.java:97)
    at org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:249)
    at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:509)
    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
    at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
    at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:369)
    at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
    at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
    at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
    at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
    at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
    at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
    at org.apache.axis.client.Call.invoke(Call.java:2467)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at Client.main(Client.java:164)
Caused by: org.xml.sax.SAXException: No object was found for class type class Client
    at org.apache.axis.encoding.ConstructorTarget.set(ConstructorTarget.java:88)
    ... 16 more
org.xml.sax.SAXException: No object was found for class type class Client
org.xml.sax.SAXException: No object was found for class type class Client

I don't understand what's the issue. It's seems to be a constructor error so I added the no-argument Client constructor but nothing change.

Could you help?

Thank you

1
I'm closing this question because it was due to a limitation of the Axis 1 implemantation inside the application on which I work. - boushi

1 Answers

0
votes

I'm closing this question because it was due to a limitation of the Axis 1 implemantation inside the application on which I work.