I am trying get the service provider catalog from RM root services with the help of JazzRootServicesHelper class from OSLC4Net library.
When I tried to initialize the JazzRootServicesHelper with below code:
//Step 1
JazzRootServicesHelper helper = new JazzRootServicesHelper(webContextUrl, OSLCConstants.OSLC_RM_V2);
//STEP 2: Create a new Form Auth client with the supplied user/password
JazzFormAuthClient client = helper.InitFormClient(user, passwd);
//STEP 3: Login in to Jazz Server
if (client.FormLogin() == HttpStatusCode.OK)
{
Console.WriteLine("Jazz client login sucessfully ");
//STEP 4: Get the URL of the OSLC RM catalog
String catalogUrl = helper.GetCatalogUrl();
//STEP 5: Find the OSLC Service Provider for the project area we want to work with
String serviceProviderUrl = client.LookupServiceProviderUrl(catalogUrl, projectArea);
}
At Step 1 below Exception occur :
Message “OSLCC003: An error occurred processing the root services document. Server location: https://servername.com:9443/rm/.” string
StackTrace = " at OSLC4Net.Client.Oslc.Jazz.JazzRootServicesHelper.ProcessRootServices() in C:\New folder\OSLC4Net_SDK\OSLC4Net.Client\Oslc\Jazz\JazzRootServicesHelper.cs:line 194\r\n at OSLC4Net.Client.Oslc.Jazz.JazzRootServicesHelper…ctor(String url, String…
From JazzRootServicesHelper class throwing exception :
StackTrace = " at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification)\r\n at System.Threading.Tasks.Task
1.get_Result()\r\n at OSLC4Net.Clien…
Basically it’s breaking while get resource from rootServiceClient
try {
OslcClient rootServicesClient = new OslcClient();
HttpResponseMessage response = rootServicesClient.GetResource(rootServicesUrl, OSLCConstants.CT_RDF);
Stream stream = response.Content.ReadAsStreamAsync().Result;
IGraph rdfGraph = new Graph();
IRdfReader parser = new RdfXmlParser();
StreamReader streamReader = new StreamReader(stream);
using(streamReader) {
parser.Load(rdfGraph, streamReader);
//get the catalog URL
this.catalogUrl = GetRootServicesProperty(rdfGraph, this.catalogNamespace, this.catalogProperty);
//get the OAuth URLs
this.requestTokenUrl = GetRootServicesProperty(rdfGraph, JFS_NAMESPACE, JazzRootServicesConstants.OAUTH_REQUEST_TOKEN_URL);
this.authorizationTokenUrl = GetRootServicesProperty(rdfGraph, JFS_NAMESPACE, JazzRootServicesConstants.OAUTH_USER_AUTH_URL);
this.accessTokenUrl = GetRootServicesProperty(rdfGraph, JFS_NAMESPACE, JazzRootServicesConstants.OAUTH_ACCESS_TOKEN_URL);
try { // Following field is optional, try to get it, if not found ignore exception because it will use the default
this.authorizationRealm = GetRootServicesProperty(rdfGraph, JFS_NAMESPACE, JazzRootServicesConstants.OAUTH_REALM_NAME);
} catch(ResourceNotFoundException e) {
// Ignore
}
}
} catch(Exception e) {
throw new RootServicesException(this.baseUrl, e);
}