i install globus 4.0.3.i have written a java class to query from my Default
IndexService for get some info but when running it ,i see the following
Error:
ERROR: Unable to invoke QueryRP operation
my java class is :
import java.net.URL;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.Stub;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.addressing.Address;
import org.apache.axis.message.addressing.EndpointReferenceType;
import org.apache.axis.types.URI;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.globus.mds.aggregator.types.AggregatorContent;
import org.globus.mds.aggregator.types.AggregatorData;
import org.globus.wsrf.NoSuchResourceException;
import org.globus.wsrf.ResourceContext;
import org.globus.wsrf.ResourceContextException;
import org.globus.wsrf.ResourceKey;
import org.globus.wsrf.WSRFConstants;
import org.globus.wsrf.encoding.ObjectDeserializer;
import org.globus.wsrf.impl.security.authorization.NoAuthorization;
import org.globus.wsrf.security.Constants;
import org.globus.wsrf.security.SecurityManager;
import org.globus.wsrf.utils.AddressingUtils;
import org.oasis.wsrf.properties.QueryExpressionType;
import org.oasis.wsrf.properties.QueryResourcePropertiesResponse;
import org.oasis.wsrf.properties.QueryResourceProperties_Element;
import org.oasis.wsrf.properties.QueryResourceProperties_PortType;
import
org.oasis.wsrf.properties.WSResourcePropertiesServiceAddressingLocator;
import org.oasis.wsrf.servicegroup.EntryType;
public class query{
public static void main (String args[])
{
query q=new query();
try {
q.find();
}
catch (Exception e) {
}
}
public void find() throws RemoteException {
EndpointReferenceType indexEPR = new EndpointReferenceType();
try {
indexEPR.setAddress(new Address("
https://Mehdi:8443/wsrf/services/DefaultIndexService"));
} catch (Exception e) {
}
// Get QueryResourceProperties portType
WSResourcePropertiesServiceAddressingLocator queryLocator;
queryLocator = new WSResourcePropertiesServiceAddressingLocator();
QueryResourceProperties_PortType query = null;
try {
query = queryLocator.getQueryResourcePropertiesPort(indexEPR);
} catch (ServiceException e) {
System.out.print("ERROR: Unable to obtain query portType.");
throw new RemoteException("ERROR: Unable to obtain query
portType.", e);
}
// Setup security options
((Stub)
query)._setProperty(Constants.GSI_TRANSPORT,Constants.SIGNATURE);
((Stub) query)._setProperty(Constants.AUTHORIZATION,
NoAuthorization.getInstance());
// The following XPath query retrieves all the files with the
specified
// name
String xpathQuery = "//*[local-name()='Address']/text()";
// Create request to QueryResourceProperties
QueryExpressionType queryExpr = new QueryExpressionType();
try {
queryExpr.setDialect(new URI(WSRFConstants.XPATH_1_DIALECT));
} catch (Exception e) {
System.out.print("ERROR: Malformed URI
(WSRFConstants.XPATH_1_DIALECT)");
throw new RemoteException("ERROR: Malformed URI
(WSRFConstants.XPATH_1_DIALECT)", e);
}
queryExpr.setValue(xpathQuery);
QueryResourceProperties_Element queryRequest = new
QueryResourceProperties_Element(queryExpr);
// Invoke QueryResourceProperties
QueryResourcePropertiesResponse queryResponse = null;
try {
//System.out.print(indexEPR);
queryResponse = query.queryResourceProperties(queryRequest);
} catch (RemoteException e) {
System.out.print("ERROR: Unable to invoke QueryRP operation.");
throw new RemoteException("ERROR: Unable to invoke QueryRP
operation.", e);
}
// The response includes 0 or more entries from the index service.
MessageElement[] entries = queryResponse.get_any();
// If the number of entries is 0, there are no files with that name.
if (entries == null || entries.length == 0) {
System.out.print("No file found with name ");
}
else{
System.out.print("ok file found with name*******************");
}
}
}
do any one exist to help me for this Error?