# Reading resqml data using fetpapi

**URL:** <https://discourse.f2i-consulting.com/t/reading-resqml-data-using-fetpapi/220>\
**Category:** FETPAPI\
**Created:** [December 21, 2022, 5:29pm UTC](https://discourse.f2i-consulting.com/t/reading-resqml-data-using-fetpapi/220 "2022-12-21T17:29:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sidrah855](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/sidrah855/32/77_2.png) [@sidrah855](https://discourse.f2i-consulting.com/u/sidrah855)\
**Post date:** [December 21, 2022, 5:29pm UTC](https://discourse.f2i-consulting.com/t/reading-resqml-data-using-fetpapi/220/1 "2022-12-21T17:29:40Z")

</div>

Hi @philippeVerney

I have build jar of fetpapi(with fesapi 2.4.1.0 ) and OpenETP docker is also running using these commands

docker-compose run open\_etp\_server\_runtime openETPServer server --init  
docker-compose run -p 9002:9002 open\_etp\_server\_runtime openETPServer server --start

In OpenETP i have loaded resqml data

 ![image](https://discourse.f2i-consulting.com/uploads/default/original/1X/0c03c7054b3bfab1d33e3195bd97fa918dd02c98.png)

Using fetpapiClient i want to read this resqml data from openETP docker’s , in this class

 ![image](https://discourse.f2i-consulting.com/uploads/default/original/1X/fdf1a9f1127015e33016c10ffea447adbc2a5a5a.png)

Could you please help me and provide some example code how to read resqml data from openETP using Fetpapi.

---

<div class="post-metadata">

**Author:** ![hb22301](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/hb22301/32/73_2.png) [@hb22301](https://discourse.f2i-consulting.com/u/hb22301)\
**Post date:** [December 22, 2022, 4:30pm UTC](https://discourse.f2i-consulting.com/t/reading-resqml-data-using-fetpapi/220/2 "2022-12-22T16:30:47Z")

</div>

Hello @philippeVerney,

I want to provide some additional details on this ticket.  
Please see that I am able to query the stats from this ETP Server in command line.

[open-etp-server]$ docker-compose run open\_etp\_server\_runtime openETPServer space -S ws://xx.xxx.xxx.xxx:9002 -u foo -p bar -s demo/Volve --stats  
/usr/local/lib/python3.6/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.  
from cryptography.hazmat.backends import default\_backend  
Removing open-etp-server\_open\_etp\_server\_runtime\_1  
Creating open-etp-server\_open\_etp\_server\_runtime\_run … done  
1 eml20.obj\_EpcExternalPartReference  
89 resqml20.obj\_ContinuousProperty  
85 resqml20.obj\_FaultInterpretation  
7 resqml20.obj\_GeneticBoundaryFeature  
7 resqml20.obj\_Grid2dRepresentation  
15 resqml20.obj\_HorizonInterpretation  
1 resqml20.obj\_LocalTime3dCrs  
1 resqml20.obj\_OrganizationFeature  
103 resqml20.obj\_PolylineSetRepresentation  
6 resqml20.obj\_PropertyKind  
2 resqml20.obj\_StratigraphicColumn  
2 resqml20.obj\_StratigraphicColumnRankInterpretation  
8 resqml20.obj\_StratigraphicUnitFeature  
16 resqml20.obj\_StratigraphicUnitInterpretation  
76 resqml20.obj\_SubRepresentation  
65 resqml20.obj\_TectonicBoundaryFeature  
7 resqml20.obj\_TriangulatedSetRepresentation  
491 TOTAL

Below is the code snippet of FetpapiClient.

```
	DataObjectRepository repo = new DataObjectRepository();
	// host and port are pointing to where ETP Server (docker) is running, target is "/". 
	// not providing any authorization as ETP Server is not running in secure mode (ws, not wss)
	// Question: what is target ?

	MyInitializationParameters initParam = new MyInitializationParameters(host, port, target, repo);
	System.out.println("Connecting to " + host + ":" + port + " path \"" + target +"\" and authorization \"" + authorization + "\"");
	
	PlainClientSession session = fetpapi.createWsClientSession(initParam, authorization);
	// [http] xx.xxx.xxx.xxx [::ffff:xx.xxx.xxx.xxx]:57254 "GET //.well-known/etp-server-capabilities?GetVersion=etp12.energistics.org HTTP/1.1" 404 55 "Boost.Beast /322"

	repo.setHdfProxyFactory(new FesapiHdfProxyFactory(session));
	
	session.run();
	// Error: No Authorization HTTP header (or URL query-string): Connection refused.
	// [error] Handshake ended with HTTP error: 401
	// [fail] WebSocket Connection [::ffff:xx.xxx.xxx.xxx]:57454 v13 "" // 401 websocketpp:27 Connection rejected

	// Can I get dataspeaces ? 
	DataspaceVector dsVector = session.getDataspaces();
	
	// Can I read data from repo like I would do using FESAPI on Resqml files ?
	StringVector allUuids = repo.getUuids();
	for (String uuid : allUuids) {
		AbstractObject obj = null;
		try {
			obj = repo.getDataObjectByUuid(uuid);
		} catch (IllegalArgumentException e) {
		}
	}

	session.close();

```

Questions:

1. Seems like the APIs are expecting authorization. Is there an API that can be used without providing authorization ?
2. It would be great if you could expand this example to show how to read data using FESAPI/FETPAPI
3. Could you please point to any javadoc for the FETPAPI APIs ?
4. At some point I remember seeing a demo video by @philippeVerney in OSDU showing usage of FETPAPI(?), I can’t find it anymore. Could you please point me to any demo/design doc etc. to help me better understand how FESAPI and FETPAPI work together ?

We are evaluating to use FETPAPI to read/write following data types from/to ETP Server:  
Horizons  
Faults  
Well Picks  
Well Logs

Could you please also comment about the stability of FETPAPI APIs and some idea on when first version is likely to be released ?

Thanks,  
Shakir

---

<div class="post-metadata">

**Author:** ![philippeVerney](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/philippeverney/32/29_2.png) [@philippeVerney](https://discourse.f2i-consulting.com/u/philippeVerney)\
**Post date:** [December 22, 2022, 5:16pm UTC](https://discourse.f2i-consulting.com/t/reading-resqml-data-using-fetpapi/220/3 "2022-12-22T17:16:55Z")

</div>

Hi,

> [@hb22301](#):
>
> Seems like the APIs are expecting authorization. Is there an API that can be used without providing authorization ?

No, you must first initiate the ETP session and for that you need "authorization " because you provided one when starting openEtpServer with “-u foo -p bar” parameters. You may try to disable authorization on server side.  
Otherwise, please provide authorization which would be “Basic Zm9vOmJhcg==” based on “-u foo -p bar”

> [@hb22301](#):
>
> It would be great if you could expand this example to show how to read data using FESAPI/FETPAPI

Not enough time for now but this is the plan. And we also encourage contribution.  
The C++ example is more complete but more complex. You may give a look at it [fetpapiClient/src/withFesapi/main.cpp at main · F2I-Consulting/fetpapiClient · GitHub](https://github.com/F2I-Consulting/fetpapiClient/blob/main/src/withFesapi/main.cpp) especially lines 241 to 271 for your particular question.

> [@hb22301](#):
>
> Could you please point to any javadoc for the FETPAPI APIs ?

It is not generated yet. This generation is on the TODO list.

> [@hb22301](#):
>
> At some point I remember seeing a demo video by @philippeVerney in OSDU showing usage of FETPAPI(?), I can’t find it anymore. Could you please point me to any demo/design doc etc. to help me better understand how FESAPI and FETPAPI work together ?

Same answer.  
But basically, the idea is to get the ETP dataobjects which you want from the ETP server and add them into the repository. Then, you use your repository exactly as usual.  
Here is probably the video you talk about: [Cisco Webex Meetings](https://opengroup.webex.com/webappng/sites/opengroup/recording/d1abf6a435d2103b8fadc29b728b9eaf/playback)

> [@hb22301](#):
>
> Could you please also comment about the stability of FETPAPI APIs and some idea on when first version is likely to be released ?

The plan is to make a first release in 2023. I think it will be second semester.  
I don’t expect huge changes in FETPAPI. Cleaning and testing are the main things to do.

---

<div class="post-metadata">

**Author:** ![hb22301](https://discourse.f2i-consulting.com/user_avatar/discourse.f2i-consulting.com/hb22301/32/73_2.png) [@hb22301](https://discourse.f2i-consulting.com/u/hb22301)\
**Post date:** [December 23, 2022, 4:41pm UTC](https://discourse.f2i-consulting.com/t/reading-resqml-data-using-fetpapi/220/4 "2022-12-23T16:41:23Z")

</div>

Thanks for your response @philippeVerney !
