# Unable to initialize JazzRootServicesHelper class with webContextUrl for RM and OSLC constants from OSLC4Net

**URL:** <https://forum.open-services.net/t/unable-to-initialize-jazzrootserviceshelper-class-with-webcontexturl-for-rm-and-oslc-constants-from-oslc4net/469>\
**Category:** OSLC4NET\
**Created:** [February 19, 2021, 6:32am UTC](https://forum.open-services.net/t/unable-to-initialize-jazzrootserviceshelper-class-with-webcontexturl-for-rm-and-oslc-constants-from-oslc4net/469 "2021-02-19T06:32:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spatil64](https://forum.open-services.net/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@spatil64](https://forum.open-services.net/u/spatil64)\
**Post date:** [February 19, 2021, 6:32am UTC](https://forum.open-services.net/t/unable-to-initialize-jazzrootserviceshelper-class-with-webcontexturl-for-rm-and-oslc-constants-from-oslc4net/469/1 "2021-02-19T06:32:57Z")

</div>

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:

```auto
//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/.](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

```auto
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);
}

```

---

<div class="post-metadata">

**Author:** ![andrew](https://forum.open-services.net/user_avatar/forum.open-services.net/andrew/32/28_2.png) [@andrew](https://forum.open-services.net/u/andrew)\
**Post date:** [February 19, 2021, 9:42am UTC](https://forum.open-services.net/t/unable-to-initialize-jazzrootserviceshelper-class-with-webcontexturl-for-rm-and-oslc-constants-from-oslc4net/469/2 "2021-02-19T09:42:25Z")

</div>

Hi @spatil64,

First of all, welcome to the forum!

OSLC4Net has not been maintained for many years now (I think 8-10 years is more precise). I moved it from CodePlex which was shut down many years ago and put it on [GitHub - OSLC/oslc4net](https://github.com/OSLC/oslc4net) but there have been no releases since. We are looking for enough community demand to start looking into it. At this point, I can only recommend you dig into the problems yourself and contribute back suggested fixes.

Regarding your problem, [https://JazzRootServicesHelper.cs#L170](https://github.com/OSLC/oslc4net/blob/master/OSLC4Net_SDK/OSLC4Net.Client/Oslc/Jazz/JazzRootServicesHelper.cs#L170) seems like a good place to start with a breakpoint. I also see exceptions with async there, and there is only one async call in that method at [JazzRootServicesHelper.cs#L171](https://github.com/OSLC/oslc4net/blob/master/OSLC4Net_SDK/OSLC4Net.Client/Oslc/Jazz/JazzRootServicesHelper.cs#L171). This makes me think that you are not even getting HTTP response properly even before you get a chance to parse it. I would strongly suggest something like [https://mitmproxy.org/](https://mitmproxy.org/) or [https://goreplay.org/](https://goreplay.org/) to check what goes on on the wire.

If you can, I strongly recommend to use Lyo OSLC Client in Java, which is the only supported OSLC client we know of in 2021.

Best regards,  
Andrew

---

<div class="post-metadata">

**Author:** ![spatil64](https://forum.open-services.net/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@spatil64](https://forum.open-services.net/u/spatil64)\
**Post date:** [February 19, 2021, 11:05am UTC](https://forum.open-services.net/t/unable-to-initialize-jazzrootserviceshelper-class-with-webcontexturl-for-rm-and-oslc-constants-from-oslc4net/469/3 "2021-02-19T11:05:21Z")

</div>

Hi Andrew,

Thanks for your quick help.  
Will check and let you know .

Thanks,  
Sachin.
