# Source code example?

**URL:** <https://forum.loinc.org/t/source-code-example/994>\
**Category:** loinc-fhir-ts\
**Created:** [September 25, 2018, 4:14am UTC](https://forum.loinc.org/t/source-code-example/994 "2018-09-25T04:14:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aerts](https://forum.loinc.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@aerts](https://forum.loinc.org/u/aerts)\
**Post date:** [September 25, 2018, 4:14am UTC](https://forum.loinc.org/t/source-code-example/994/1 "2018-09-25T04:14:45Z")

</div>

Hi Tim,

Any source code example, e.g. using Jersey?  
I tried plain “get” using  
client = ClientBuilder.newClient();  
webTarget = client.target(BASE\_URI);  
webTarget.path(“CodeSystem/$lookup?system=[http://loinc.org](http://loinc.org)&code=4544-3”);  
String answer = webTarget.request().get(String.class);

but this failed.  
As one needs [loinc.org](http://loinc.org) username and password, do I need a “post”. If so, how do I pass username and password as parameters?

Many thanks in advance,  
Jozef Aerts

---

<div class="post-metadata">

**Author:** ![aerts](https://forum.loinc.org/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@aerts](https://forum.loinc.org/u/aerts)\
**Post date:** [September 26, 2018, 4:37am UTC](https://forum.loinc.org/t/source-code-example/994/2 "2018-09-26T04:37:38Z")

</div>

A short update: Tim pointed me to: [https://stackoverflow.com/questions/9210514/unable-to-find-valid-certification-path-to-requested-target-error-even-after-c](https://stackoverflow.com/questions/9210514/unable-to-find-valid-certification-path-to-requested-target-error-even-after-c)

I was a bit puzzled as I do have other client applications that use RESTful web services that run over https with authentication (though over POST) and did run without problems in the past (MedLine-Plus, UMLS-NLM, …). I ran them again at home yesterday night and suddenly they did not run anymore, giving a similar error (handschake problem - these programs still use JAX-RS 1). At work however, where I am currently developing the new LOINC application, they run fine.  
So this contributed to further confusion.  
So, at the moment it looks like it has to do with whether and how certificates are stored in the JRE, how they did get there (I never explicitely added some manually), and how they are maintained when a JRE update takes place.

When I find a solution, I will surely make it available to the broad public. This LOINC service is so immensely important for the medical informatics world … In the mean time, if someone has created a Java client successfully, I am always glad to hear.

---

<div class="post-metadata">

**Author:** ![timbriscoe](https://forum.loinc.org/user_avatar/forum.loinc.org/timbriscoe/32/938_2.png) [@timbriscoe](https://forum.loinc.org/u/timbriscoe)\
**Post date:** [September 26, 2018, 8:48am UTC](https://forum.loinc.org/t/source-code-example/994/3 "2018-09-26T08:48:18Z")

</div>

Jozef,

Thank you for the update and thank you for sharing your findings. We are extremely happy you find this service useful.

Best,  
Tim

---

<div class="post-metadata">

**Author:** ![system](https://forum.loinc.org/uploads/default/original/1X/dbab97ce9b2987d788a376e254fcaae249f3b672.png) [@system](https://forum.loinc.org/u/system)\
**Post date:** [June 23, 2023, 3:36pm UTC](https://forum.loinc.org/t/source-code-example/994/4 "2023-06-23T15:36:41Z")

</div>

Closed on June 23, 2023, 3:36pm UTC


