What you are trying to do is to get the value of the Resource Property (RP)
with the QName ManagedJobConstants.RESOURCE_KEY_QNAME, but this RP does
not exist for Fork (InvalidResourcePropertyQNameFaultType).
You can only use QNames of existing RPs.

Valid RPs are listed in 2.3.1 on http://tinyurl.com/aqlg74
You can find constants for most of these in the class
org.globus.exec.utils.ManagedJobFactoryConstants
(Those starting with 'RP_')

The following should work:
...
GetResourcePropertyResponse response =
  
factoryPort.getResourceProperty(ManagedJobFactoryConstants.RP_DELEGATION_FACTORY_ENDPOINT);
...


I think, what you are mixing up is this:

The '-key "{http://www.globus.org/namespaces/2004/10/gram/job}ResourceID"; Fork'
of your wsrf-query command is functionally comparable to specifying the 
factoryType
in the ManagedJobFactoryClientHelper.getFactoryEndpoint(...) call, but
it does NOT specify the name of the RP to query.
Actually you query the whole RP document (all RPs) and narrow down the result
by "//*[local-name()='version']"
What you are trying to do in your code is comparable to a call to the shell 
script
wsrf-get-property.

Hope that gets you started.

-Martin

Ufuk Utku Turuncoglu wrote:
Hi,

I try to connect a remote GRAM server in TeraGrid using following code,

       try {
URL factoryUrl = ManagedJobFactoryClientHelper.getServiceURL(contactString).getURL(); String factoryType = ManagedJobFactoryConstants.FACTORY_TYPE.FORK; EndpointReferenceType factoryEndpoint = ManagedJobFactoryClientHelper.getFactoryEndpoint(factoryUrl, factoryType); ManagedJobFactoryPortType factoryPort = ManagedJobFactoryClientHelper.getPort(factoryEndpoint); ClientSecurityDescriptor secDesc = new ClientSecurityDescriptor();
           secDesc.setGSSCredential(cred);
((Stub) factoryPort)._setProperty(Constants.CLIENT_DESCRIPTOR, secDesc); GetResourcePropertyResponse response = factoryPort.getResourceProperty(ManagedJobConstants.RESOURCE_KEY_QNAME);
           SOAPElement[] any = response.get_any();
QName q = (QName) ObjectDeserializer.toObject(any[0], QName.class);
           System.out.println(q.toString());
                 } catch (MalformedURLException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
       } catch (Exception e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
       }

but i get,

     [run] AxisFault
[run] faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
     [run]  faultSubcode:
     [run]  faultString:
     [run]  faultActor:
     [run]  faultNode:
     [run]  faultDetail:
[run] {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd}InvalidResourcePropertyQNameFault:<ns2:Timestamp xmlns:ns2="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd";>2009-02-07T05:51:30.676Z</ns2:Timestamp><ns3:Originator xmlns:ns3="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd";><ns2:Address xmlns:ns2="http://schemas.xmlsoap.org/ws/2004/03/addressing";>https://gatekeeper.frost.ncar.teragrid.org:8443/wsrf/services/ManagedJobFactoryService</ns2:Address><ns4:ReferenceProperties xmlns:ns4="http://schemas.xmlsoap.org/ws/2004/03/addressing";><ns1:ResourceID soapenv:mustUnderstand="0" xmlns:ns1="http://www.globus.org/namespaces/2004/10/gram/job"; xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>Fork</ns1:ResourceID></ns4:ReferenceProperties><ns5:ReferenceParameters xmlns:ns5="http://schemas.xmlsoap.org/ws/2004/03/addressing"/></ns3:Originator><ns4:Description xmlns:ns4="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd";>{http://www.globus.org/namespaces/2004/10/gram/job}ResourceID</ns4:Description><ns5:FaultCause xmlns:ns5="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd";><ns5:Timestamp>2009-02-07T05:51:30.676Z</ns5:Timestamp><ns5:ErrorCode dialect="http://www.globus.org/fault/stacktrace";> [run] at org.globus.wsrf.impl.properties.GetResourcePropertyProvider.getResourceProperty(GetResourcePropertyProvider.java(Compiled Code)) [run] at sun.reflect.GeneratedMethodAccessor158.invoke(Unknown Source)

error message. What is the problem? I also try to use wsrf-query command to ensure connection is ok

> wsrf-query -s https://gatekeeper.frost.ncar.teragrid.org:8443/wsrf/services/ManagedJobFactoryService -key "{http://www.globus.org/namespaces/2004/10/gram/job}ResourceID"; Fork "//*[local-name()='version']"

<ns1:version xmlns:ns1="http://mds.globus.org/metadata/2005/02";>4.0.7</ns1:version>

and it is working. Any suggestion will be helpful.

Thanks,

--ufuk


Reply via email to