Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lyo » OSLC DXL services example
OSLC DXL services example [message #1704871] Mon, 10 August 2015 09:08 Go to next message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Hi,

I note OSLC has some limitations to get certain information from DOORS 9.5. For instance, a ServiceProviderCatalog (SPC) could be the DOORS DB, a Project or a folder. However, using OSCL, I cannot know what type of DOORS element is a SPC.

Therefore, I think to use OSLC DXL services to request to DOORS the information I cannot get from pure OSLC.

I found an example on IBM Knowledge Center, but the shown example uses pure REST commands.

Has someone worked on OSLC DXL using OSLC4J? Do you have some example to show how it works?

Thanks for your help.

Carlos

[Updated on: Mon, 10 August 2015 09:33]

Report message to a moderator

Re: OSLC DXL services example [message #1705125 is a reply to message #1704871] Wed, 12 August 2015 10:27 Go to previous messageGo to next message
Romain Barth is currently offline Romain BarthFriend
Messages: 7
Registered: September 2014
Junior Member
Hi Carlos,

Here is an article about OSLC DXL services : http:/doors9sharp.blogspot.co.uk/2015/06/oslc-dxl-services.html

I don't really understand what do you mean by OSLC DXl using OSLC4J... OSLC DXL services are basic webservices hosted by DWA to query DOORS using DXL. You can call those services like REST or SOAP services.

Can you clarify your question ?

Thank you

Romain
Re: OSLC DXL services example [message #1713082 is a reply to message #1705125] Fri, 30 October 2015 16:24 Go to previous messageGo to next message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Hi Romain,

Thanks for your answer. Sorry for my delay... I'm taking the topic again.

So, I'm using OSLC4J to exchange information with DOORS 9.5 using the OSLC interface.

I want to use OSLC4J to request OSLC-DXL services because the authentication process was already done and I don't want to re-code the work already made in OSLC4J.

Therefore, I register the DXL script on the DOORS server as it is mentioned in the IBM Knowledge Center. Now, I want to use the OSLCClient to access to the OSLC-DXL service. I use the method getResource() to get the help information about the script:

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:doors="http://jazz.net/doors/xmlns/prod/jazz/doors/2.0/" >
<rdf:Description rdf:about="http://doors-server:port/dwa/rm/dxl/helloWorld">
<doors:help rdf:parseType="Literal"></doors:help>
<rdf:type rdf:resource="http://jazz.net/doors/xmlns/prod/jazz/doors/2.0/DxlServiceResult"/>
</rdf:Description>
</rdf:RDF>

However, when I use updateResource() to invoke the OSLC-DXL service, DOORS responds that is "Unauthorized". I'm executing updateResource() as follows:

client.updateResource(dxlServiceUrl, putBody, OSLCConstants.CT_RDF, OSLCConstants.CT_RDF);

where:
dxlServiceUrl = http://doors-server:port/dwa/rm/dxl/helloWorld
putBody = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:doors=\"http://jazz.net/doors/xmlns/prod/jazz/doors/2.0/\"><doors:Arguments><doors:arguments>English</doors:arguments></doors:Arguments></rdf:RDF>"

Could you give me an idea about the problem of my solution?

Thanks!!!
Re: OSLC DXL services example [message #1714427 is a reply to message #1713082] Thu, 12 November 2015 15:29 Go to previous messageGo to next message
Romain Barth is currently offline Romain BarthFriend
Messages: 7
Registered: September 2014
Junior Member
Hi Carlos,

I observed the same behavior you described.

In the DWA log file, when the GET request is performed it is possible to see the OAuth authentication but not with the PUT request.

I don't know yet if the problem is related to DWA or Lyo. I'd guess that OSLC4J has not been built included this possibility to consume OSLC DXL services.

I will ask people from Lyo to get more informations.

Regards

Romain
Re: OSLC DXL services example [message #1714467 is a reply to message #1714427] Thu, 12 November 2015 21:00 Go to previous messageGo to next message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Hello Romain,

Thanks for your answer. In fact, I tested using only http and oauth commands, and it works. Then, I reviewed the authentication code on DoorsOauthSample.java and I think some oauth info is not present. Although, the code works.

I will do some experiments to confirm my intuition.
Re: OSLC DXL services example [message #1715281 is a reply to message #1714467] Fri, 20 November 2015 22:28 Go to previous messageGo to next message
Jim Ruehlin is currently offline Jim RuehlinFriend
Messages: 73
Registered: July 2009
Member
Carlos, have you been successful yet with creating a requirement using OSLC? Have you validated that the PUT in DoorsOauthSample.java is authenticating? It seems to be using the correct authenticated client (I'm looking at line 209).

DXL is an extension that DOORS created for OSLC, so the RM sample code might not handle that. The issue might also be unrelated to authentication - it's possible that the team member you're using in the DOORS project has permission to read requirements but not write them. I'd think that would show up in the log or via the HTTP return code, but it should be easy to check.

If you verify that the Lyo code is incorrect with authentication please create a bugzilla entry for it and I'll look into it.
Re: OSLC DXL services example [message #1748627 is a reply to message #1715281] Fri, 25 November 2016 12:33 Go to previous messageGo to next message
Carlos Gomez is currently offline Carlos GomezFriend
Messages: 63
Registered: October 2010
Member
Hi Jim,

I'm sorry about my delay. I solve the problem using the same process to update a requirement.

When I get the DXL service, I get the etag:
ClientResponse clientResponse = connector.getClient().getResource(dxlUrl, OslcMediaType.APPLICATION_RDF_XML);
String etag = clientResponse.getHeaders().getFirst(OSLCConstants.ETAG);

Then, I build the RDF with the information to execute the DXL service and then I execute an update using the given etag:
ClientResponse response = connector.getClient().updateResource(dxlUrl, putBody, OSLCConstants.CT_RDF, OSLCConstants.CT_RDF, etag);

putBody is the buit RDF.

Once I get the response, I process it:
Model model = ModelFactory.createDefaultModel();
model.read(response.getEntity(InputStream.class), dxlUrl);
Property spcPredicate = model.createProperty("http://jazz.net/doors/xmlns/prod/jazz/doors/2.0/", "result");
Selector select = new SimpleSelector(null, spcPredicate, (RDFNode) null);
StmtIterator listStatements = model.listStatements(select);

List<String> result = new ArrayList<String>();

while (listStatements.hasNext()) {
	Statement spcStatement = listStatements.nextStatement();
	RDFNode node = spcStatement.getObject();
	String nodeStr = node.asLiteral().getValue().toString();
	result.add(nodeStr);
}

I hope it helps to someone who is blocked with this service.

BR,

Carlos
Re: OSLC DXL services example [message #1836648 is a reply to message #1748627] Mon, 11 January 2021 09:24 Go to previous messageGo to next message
Ignacio Lumbreras is currently offline Ignacio LumbrerasFriend
Messages: 1
Registered: January 2021
Junior Member
Thank you Carlos. I replicated your sample but I still get "dxlServiceResult: uninitialised" when calling to helloWorld

I noticed that when calling client.getResource method , I get a http message 200, which is good, but when I try to get the etag, this one is null.

I guess that this is the reason why client.updateResource fails to call the dxlService correctly. How did you manage to get a valid etag in your sample?

I see that you use an object called connector in your sample. In my case , I just use an authorized OAuthClient called client (this eway of doing is taken from DoorsOauthSample) and then I call client.getResource

I would appreciate some help since i am blocked







Re: OSLC DXL services example [message #1836662 is a reply to message #1836648] Mon, 11 January 2021 14:15 Go to previous message
Romain Barth is currently offline Romain BarthFriend
Messages: 7
Registered: September 2014
Junior Member
If you get "dxlServiceResult: uninitialised", the problem usually is the DXL code.

If you run DWA on Windows, check the interop window, you should see a DXL error in it.
Previous Topic:unable to get Resourceshape in 9.6.1 doors version
Next Topic:MOVING TO ANOTHER FORUM
Goto Forum:
  


Current Time: Tue Mar 19 02:35:51 GMT 2024

Powered by FUDForum. Page generated in 0.02578 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top