FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Cannot find a method in the generated Web Service stub

 
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users
View previous topic :: View next topic  
Author Message
ManojRajPaul



Joined: 19 Jun 2009
Posts: 3

PostPosted: Mon Jun 22, 2009 7:03 am    Post subject: Cannot find a method in the generated Web Service stub Reply with quote

Hello all,

I am developing an application which calls a web service from "http://jupiter.webspiders.com/event2mobile/services/entityservice.asmx?WSDL".

The genereted stub(EntityService_Stub.java) is:

Code:

package entityservice;

import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.microedition.xml.rpc.Operation;
import javax.microedition.xml.rpc.Type;
import javax.microedition.xml.rpc.ComplexType;
import javax.microedition.xml.rpc.Element;

public class EntityService_Stub implements EntityService, javax.xml.rpc.Stub {

    private String[] _propertyNames;
    private Object[] _propertyValues;

    public EntityService_Stub() {
        _propertyNames = new String[] { ENDPOINT_ADDRESS_PROPERTY };
        _propertyValues = new Object[] { "http://jupiter.webspiders.com/event2mobile/services/entityservice.asmx" };
    }

    public void _setProperty( String name, Object value ) {
        int size = _propertyNames.length;
        for (int i = 0; i < size; ++i) {
            if( _propertyNames[i].equals( name )) {
                _propertyValues[i] = value;
                return;
            }
        }
        String[] newPropNames = new String[size + 1];
        System.arraycopy(_propertyNames, 0, newPropNames, 0, size);
        _propertyNames = newPropNames;
        Object[] newPropValues = new Object[size + 1];
        System.arraycopy(_propertyValues, 0, newPropValues, 0, size);
        _propertyValues = newPropValues;

        _propertyNames[size] = name;
        _propertyValues[size] = value;
    }

    public Object _getProperty(String name) {
        for (int i = 0; i < _propertyNames.length; ++i) {
            if (_propertyNames[i].equals(name)) {
                return _propertyValues[i];
            }
        }
        if (ENDPOINT_ADDRESS_PROPERTY.equals(name) || USERNAME_PROPERTY.equals(name) || PASSWORD_PROPERTY.equals(name)) {
            return null;
        }
        if (SESSION_MAINTAIN_PROPERTY.equals(name)) {
            return new Boolean(false);
        }
        throw new JAXRPCException("Stub does not recognize property: " + name);
    }

    protected void _prepOperation(Operation op) {
        for (int i = 0; i < _propertyNames.length; ++i) {
            op.setProperty(_propertyNames[i], _propertyValues[i].toString());
        }
    }

    public Entity GetSingleEntity(int pEntityID) throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
            new Integer(pEntityID)
        };

        Operation op = Operation.newInstance( _qname_operation_GetSingleEntity, _type_GetSingleEntity, _type_GetSingleEntityResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/GetSingleEntity" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            throw e;
        }

        return Entity_fromObject((Object[])((Object[]) resultObj)[0]);
    }

    public ArrayOfEntity GetAllEntity() throws java.rmi.RemoteException {
        Object inputObject[] = new Object[] {
        };

        Operation op = Operation.newInstance( _qname_operation_GetAllEntity, _type_GetAllEntity, _type_GetAllEntityResponse );
        _prepOperation( op );
        op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/GetAllEntity" );
        Object resultObj;
        try {
            resultObj = op.invoke( inputObject );
        } catch( JAXRPCException e ) {
            Throwable cause = e.getLinkedCause();
            if( cause instanceof java.rmi.RemoteException ) {
                throw (java.rmi.RemoteException) cause;
            }
            throw e;
        }

        return ArrayOfEntity_fromObject((Object[])((Object[]) resultObj)[0]);
    }

    private static Entity[] Entity_ArrayfromObject( Object obj[] ) {
        if(obj == null) return null;
        Entity result[] = new Entity[obj.length];
        for( int i = 0; i < obj.length; i++ ) {
            result[i] = new Entity();
            Object[] oo = (Object[]) obj[i];
            result[i].setEntityID(((Integer )oo[0]).intValue());
            result[i].setEntityName((String )oo[1]);
            result[i].setEntityIcon((byte[] )oo[2]);
            result[i].setAttr_Integer1((String )oo[3]);
            result[i].setIsReq_Attr_Integer1(((Boolean )oo[4]).booleanValue());
            result[i].setAttr_Integer2((String )oo[5]);
            result[i].setIsReq_Attr_Integer2(((Boolean )oo[6]).booleanValue());
            result[i].setAttr_Float1((String )oo[7]);
            result[i].setIsReq_Attr_Float1(((Boolean )oo[8]).booleanValue());
            result[i].setAttr_Float2((String )oo[9]);
            result[i].setIsReq_Attr_Float2(((Boolean )oo[10]).booleanValue());
            result[i].setAttr_NVarchar1((String )oo[11]);
            result[i].setIsReq_Attr_NVarchar1(((Boolean )oo[12]).booleanValue());
            result[i].setAttr_NVarchar2((String )oo[13]);
            result[i].setIsReq_Attr_NVarchar2(((Boolean )oo[14]).booleanValue());
            result[i].setAttr_NVarchar3((String )oo[15]);
            result[i].setIsReq_Attr_NVarchar3(((Boolean )oo[16]).booleanValue());
            result[i].setAttr_NVarchar4((String )oo[17]);
            result[i].setIsReq_Attr_NVarchar4(((Boolean )oo[18]).booleanValue());
            result[i].setAttr_NVarchar5((String )oo[19]);
            result[i].setIsReq_Attr_NVarchar5(((Boolean )oo[20]).booleanValue());
            result[i].setAttr_Image((String )oo[21]);
            result[i].setIsReq_Attr_Image(((Boolean )oo[22]).booleanValue());
            result[i].setAttr_DateTime1((String )oo[23]);
            result[i].setIsReq_Attr_DateTime1(((Boolean )oo[24]).booleanValue());
            result[i].setAttr_DateTime2((String )oo[25]);
            result[i].setIsReq_Attr_DateTime2(((Boolean )oo[26]).booleanValue());
            result[i].setAttr_DateTime3((String )oo[27]);
            result[i].setIsReq_Attr_DateTime3(((Boolean )oo[28]).booleanValue());
            result[i].setAttr_Bit1((String )oo[29]);
            result[i].setIsReq_Attr_Bit1(((Boolean )oo[30]).booleanValue());
            result[i].setAttr_Bit2((String )oo[31]);
            result[i].setIsReq_Attr_Bit2(((Boolean )oo[32]).booleanValue());
        }
        return result;
    }

    private static Entity Entity_fromObject( Object obj[] ) {
        if(obj == null) return null;
        Entity result = new Entity();
        result.setEntityID(((Integer )obj[0]).intValue());
        result.setEntityName((String )obj[1]);
        result.setEntityIcon((byte[] )obj[2]);
        result.setAttr_Integer1((String )obj[3]);
        result.setIsReq_Attr_Integer1(((Boolean )obj[4]).booleanValue());
        result.setAttr_Integer2((String )obj[5]);
        result.setIsReq_Attr_Integer2(((Boolean )obj[6]).booleanValue());
        result.setAttr_Float1((String )obj[7]);
        result.setIsReq_Attr_Float1(((Boolean )obj[8]).booleanValue());
        result.setAttr_Float2((String )obj[9]);
        result.setIsReq_Attr_Float2(((Boolean )obj[10]).booleanValue());
        result.setAttr_NVarchar1((String )obj[11]);
        result.setIsReq_Attr_NVarchar1(((Boolean )obj[12]).booleanValue());
        result.setAttr_NVarchar2((String )obj[13]);
        result.setIsReq_Attr_NVarchar2(((Boolean )obj[14]).booleanValue());
        result.setAttr_NVarchar3((String )obj[15]);
        result.setIsReq_Attr_NVarchar3(((Boolean )obj[16]).booleanValue());
        result.setAttr_NVarchar4((String )obj[17]);
        result.setIsReq_Attr_NVarchar4(((Boolean )obj[18]).booleanValue());
        result.setAttr_NVarchar5((String )obj[19]);
        result.setIsReq_Attr_NVarchar5(((Boolean )obj[20]).booleanValue());
        result.setAttr_Image((String )obj[21]);
        result.setIsReq_Attr_Image(((Boolean )obj[22]).booleanValue());
        result.setAttr_DateTime1((String )obj[23]);
        result.setIsReq_Attr_DateTime1(((Boolean )obj[24]).booleanValue());
        result.setAttr_DateTime2((String )obj[25]);
        result.setIsReq_Attr_DateTime2(((Boolean )obj[26]).booleanValue());
        result.setAttr_DateTime3((String )obj[27]);
        result.setIsReq_Attr_DateTime3(((Boolean )obj[28]).booleanValue());
        result.setAttr_Bit1((String )obj[29]);
        result.setIsReq_Attr_Bit1(((Boolean )obj[30]).booleanValue());
        result.setAttr_Bit2((String )obj[31]);
        result.setIsReq_Attr_Bit2(((Boolean )obj[32]).booleanValue());
        return result;
    }

    protected static final QName _qname_operation_GetAllEntity = new QName( "http://tempuri.org/", "GetAllEntity" );
    protected static final QName _qname_operation_GetSingleEntity = new QName( "http://tempuri.org/", "GetSingleEntity" );
    protected static final QName _qname_GetAllEntity = new QName( "http://tempuri.org/", "GetAllEntity" );
    protected static final QName _qname_GetSingleEntity = new QName( "http://tempuri.org/", "GetSingleEntity" );
    protected static final QName _qname_GetSingleEntityResponse = new QName( "http://tempuri.org/", "GetSingleEntityResponse" );
    protected static final QName _qname_GetAllEntityResponse = new QName( "http://tempuri.org/", "GetAllEntityResponse" );
    protected static final Element _type_GetSingleEntityResponse;
    protected static final Element _type_GetAllEntity;
    protected static final Element _type_GetAllEntityResponse;
    protected static final Element _type_GetSingleEntity;

    static {
        _type_GetAllEntity = new Element( _qname_GetAllEntity, _complexType( new Element[] {
        }), 1, 1, false );
        _type_GetSingleEntity = new Element( _qname_GetSingleEntity, _complexType( new Element[] {
            new Element( new QName( "http://tempuri.org/", "pEntityID" ), Type.INT )}), 1, 1, false );
        _type_GetSingleEntityResponse = new Element( _qname_GetSingleEntityResponse, _complexType( new Element[] {
            new Element( new QName( "http://tempuri.org/", "GetSingleEntityResult" ), _complexType( new Element[] {
                new Element( new QName( "http://tempuri.org/", "EntityID" ), Type.INT ),
                new Element( new QName( "http://tempuri.org/", "EntityName" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "EntityIcon" ), Type.BYTE, 0, Element.UNBOUNDED, false ),
                new Element( new QName( "http://tempuri.org/", "Attr_Integer1" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Integer1" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_Integer2" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Integer2" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_Float1" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Float1" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_Float2" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Float2" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_NVarchar1" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar1" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_NVarchar2" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar2" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_NVarchar3" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar3" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_NVarchar4" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar4" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_NVarchar5" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar5" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_Image" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Image" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_DateTime1" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_DateTime1" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_DateTime2" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_DateTime2" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_DateTime3" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_DateTime3" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_Bit1" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Bit1" ), Type.BOOLEAN ),
                new Element( new QName( "http://tempuri.org/", "Attr_Bit2" ), Type.STRING, 0, 1, false ),
                new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Bit2" ), Type.BOOLEAN )}))}), 1, 1, false );
        _type_GetAllEntityResponse = new Element( _qname_GetAllEntityResponse, _complexType( new Element[] {
            new Element( new QName( "http://tempuri.org/", "GetAllEntityResult" ), _complexType( new Element[] {
                new Element( new QName( "http://tempuri.org/", "Entity" ), _complexType( new Element[] {
                    new Element( new QName( "http://tempuri.org/", "EntityID" ), Type.INT ),
                    new Element( new QName( "http://tempuri.org/", "EntityName" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "EntityIcon" ), Type.BYTE, 0, Element.UNBOUNDED, false ),
                    new Element( new QName( "http://tempuri.org/", "Attr_Integer1" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Integer1" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_Integer2" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Integer2" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_Float1" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Float1" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_Float2" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Float2" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_NVarchar1" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar1" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_NVarchar2" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar2" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_NVarchar3" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar3" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_NVarchar4" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar4" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_NVarchar5" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_NVarchar5" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_Image" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Image" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_DateTime1" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_DateTime1" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_DateTime2" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_DateTime2" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_DateTime3" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_DateTime3" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_Bit1" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Bit1" ), Type.BOOLEAN ),
                    new Element( new QName( "http://tempuri.org/", "Attr_Bit2" ), Type.STRING, 0, 1, false ),
                    new Element( new QName( "http://tempuri.org/", "IsReq_Attr_Bit2" ), Type.BOOLEAN )}), 0, Element.UNBOUNDED, true )}))}), 1, 1, false );
    }

    private static ComplexType _complexType( Element[] elements ) {
        ComplexType result = new ComplexType();
        result.elements = elements;
        return result;
    }
}




The main problem in this generated stub is that the method GetAllEntity()
gives an error. It says "Cannot find symbol method ArrayOfEntity_fromObject((Object[])((Object[]) resultObj)[0])". And there is no method named ArrayOfEntity_fromObject() in the generated stub.

Can someone please throw some lights over this. Please Help!!

_________________
warm regards,
Manoj Raj Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB