jde bssv consumer xml/json

As Brian says, you should be able to do this all within the BSSV code:

It is in the Java code inside of the BSSV where you have to


Our software (LynX Business Integrator) can do both inbound and outbound web service calls into/from E1 without java and/or C-BSFNs.
 
"should" is a difficult place to start. Any working examples?

Ideally with basic authentication
 
Well I am close. I am using https://maps.googleapis.com/maps/api/geocode/json for testing. I have the code written and I can successfully execute the code (call the WS and get a valid response) from within JDeveloper as just a simple java process. However when I deploy the BSSV to the integrated weblogic server I am getting a SSL error (see the stack trace below) when I invoke the BSSV from a BSFN. I have imported the endpoint certificates into the weblogic keystores using info I found here http://idmoim.blogspot.com/2014/03/javaxnetsslsslhandshakeexception.html thinking that might be the problem. I either, a) didn't import correctly or to the wrong keystore(s), or b) that wasn't the problem. Anyway, if someone knows how to resolve my SSL issue I think from a POC standpoint calling a RESTful based web service in a BSSV is doable...

stack trace error:
Code:
com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
	at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)
	at com.sun.jersey.api.client.Client.handle(Client.java:648)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.method(WebResource.java:621)
	at oracle.e1.bssv.J5900201.proxy.MapsGoogleapisCom$MapsApiGeocodeJson.getAsJsonCharsetUTF8(MapsGoogleapisCom.java:287)
	at oracle.e1.bssv.J5900201.AddressGeocoder.getMapInfoForAddress(AddressGeocoder.java:56)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at oracle.e1.bssvfoundation.impl.jdenet.CallSBFHandler.callSBF(Unknown Source)
	at oracle.e1.bssvfoundation.impl.jdenet.CallSBFMsgHandler.process(Unknown Source)
	at oracle.e1.bssvfoundation.impl.jdenet.SBFServerJavaKernel.process(Unknown Source)
	at com.jdedwards.system.net.ProcessKernel.run(Unknown Source)
Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
	at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1362)
	at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:513)
	at sun.security.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.java:1177)
	at sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:1149)
	at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:469)
	at weblogic.security.SSL.jsseadapter.JaSSLEngine$1.run(JaSSLEngine.java:68)
	at weblogic.security.SSL.jsseadapter.JaSSLEngine.doAction(JaSSLEngine.java:732)
	at weblogic.security.SSL.jsseadapter.JaSSLEngine.wrap(JaSSLEngine.java:66)
	at weblogic.socket.JSSEFilterImpl.wrapAndWrite(JSSEFilterImpl.java:716)
	at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:107)
	at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:75)
	at weblogic.socket.JSSEFilterImpl.write(JSSEFilterImpl.java:448)
	at weblogic.socket.JSSESocket$JSSEOutputStream.write(JSSESocket.java:93)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
	at java.io.FilterOutputStream.flush(FilterOutputStream.java:140)
	at weblogic.net.http.HttpURLConnection.writeRequests(HttpURLConnection.java:192)
	at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:433)
	at weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:37)
	at weblogic.net.http.HttpURLConnection.getResponseCode(HttpURLConnection.java:1075)
	at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:249)
	at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
	... 14 more
Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1683)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:278)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1341)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:153)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
	at sun.security.ssl.Handshaker$1.run(Handshaker.java:808)
	at sun.security.ssl.Handshaker$1.run(Handshaker.java:806)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1299)
	at weblogic.socket.JSSEFilterImpl.doTasks(JSSEFilterImpl.java:205)
	at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:111)
	... 26 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
	at sun.security.validator.Validator.validate(Validator.java:260)
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:107)
	at weblogic.security.SSL.jsseadapter.JaTrustManager.checkServerTrusted(JaTrustManager.java:128)
	at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:827)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1328)
	... 34 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)
	at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
	... 42 more
 
Other than the API Key that you have to get from google, no. I think my issue is with the Weblogic keystore.
 
Yes. If you go to the api guide from google for this call there will be a link where you can get one generated.
 
Ok I figured out all my Weblogic keystore issues I got everything to work - very confident that you can consume RESTful webservices from JDE. I still need to parse the returned JSON to value objects but that shouldn't be an issue. I will work on that next just so I have a complete end-to-end test.

Just to summarize my steps.
1. I used SOAPUI to test the end point and create a WADL file.
2. Generate the code necessary to consume the WS using the JDev 12c wizard "RESTful Client and Proxy" and the WADL file.
3. ToDo: need to parse the returned JSON to value objects and finally to internalVO which gets returned to the calling BSFN.
 
Ok I figured out all my Weblogic keystore issues I got everything to work - very confident that you can consume RESTful webservices from JDE. I still need to parse the returned JSON to value objects but that shouldn't be an issue. I will work on that next just so I have a complete end-to-end test.

Just to summarize my steps.
1. I used SOAPUI to test the end point and create a WADL file.
2. Generate the code necessary to consume the WS using the JDev 12c wizard "RESTful Client and Proxy" and the WADL file.
3. ToDo: need to parse the returned JSON to value objects and finally to internalVO which gets returned to the calling BSFN.

this is very good to know.

Here is the product we are looking to integrate with at some point

https://docs.oracle.com/cloud/latest/salescs_gs/FAAPS/Authentication.html

All of the authentication is in the http header. correct me if i'm wrong, but we would need to roll our own way to manipulate the http header in the bssv before the payload is delivered.
 
Brian,

Thanks for the effort and sharing of your results. Excellent work! Was there anything "special" needed to get over the weblogic keystore issue? or just understanding the configuration.

thanks
Craig
 
I don't think the keystore issue was specific to REST, I think I would have encountered the issue even with SOAP. Our previous SOAP based calls that we had done I don't believe were using SSL which is why I don't think we ran into the issue. The integrated weblogic server comes with two Demo Keystores that are used for development (DemoIdentity.jks and DemoTrust.jks). Based on the errors I was getting and everything I read I determined I needed to add the endpoint certs to DemoTrust.jks. I did this but was still getting the errors. All the documentation I read stated that Weblogic was using DemoTrust.jks but I don't think it was - I even deleted DemoTrust.jks and the server still came up just fine and even logged that it loaded the trusted sites certs. I finally changed the default configuration in the Weblogic admin console to use the jdk keystore (cacerts). I added the google keys to cacerts as well. I was supposed to configure a new Indentity keystore as part of this config change but just re-used DemoIdentity.

One of the 10,000 links I looked at yesterday just to get you started:
http://docs.oracle.com/cd/E24329_01...skhelp/security/ConfigureKeystoresAndSSL.html

I will also attach screenshots of the WL admin console where I made changes. I still have some errors with DemoIdentity in the logs when the server is started that I need to fix, but for the purposes of this exercise everything is working all the way from the C BSFN and back.
 

Attachments

  • WebLogicKeyStoreConfig_1.JPG
    WebLogicKeyStoreConfig_1.JPG
    90.9 KB · Views: 41
  • WebLogicKeyStoreConfig_2.JPG
    WebLogicKeyStoreConfig_2.JPG
    126.5 KB · Views: 37
the case i opened got an enhancement request

Bug 24680331 - CONSUME 3RD PARTY RESTFUL JSON AIPS

even got a doc

E1: BSSV How to Consume 3rd party restful APIs (Doc ID 2183597.1)
 
Great, maybe they will create official documentation on how to do it. I don't believe there really needs to be any enhancement in terms of JDE tools, APIs, etc. so I think it is really just Oracle documenting the proper steps. And officially supporting it I guess... not that that really means a whole lot.

My guess is that there are a bunch of people all ready doing this (REST has been more popular than SOAP for quite some time), they just don't read jdelist/this thread or are just choosing to remain silent.
 
Back
Top