Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

i have issue when i call rest api in my context in TEDA Application iam using infosphere streams V(4.0.1)

50G2CBPYNS gravatar image
Question by khloud  (13) | Nov 09, 2018 at 07:01 PM streamsdevstreamsinfosphere streamsteda

iam using TEDA aApplication in my context i call rest url to call java adapter to post data i have this error , any support to solve this issue : javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? at com.ibm.jsse2.a.c(a.java:67) at com.ibm.jsse2.a.a(a.java:275) at com.ibm.jsse2.as.a(as.java:3) at com.ibm.jsse2.as.i(as.java:822) at com.ibm.jsse2.as.a(as.java:392) at com.ibm.jsse2.as.startHandshake(as.java:507) at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:184) at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:21) at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:100) at rechargeplatformgrouping.context.custom.RTMWrapper.process(RTMWrapper.java:169) at com.ibm.streams.operator.internal.runtime.api.OperatorAdapter.processTuple(OperatorAdapter.java:1465) at com.ibm.streams.operator.internal.runtime.api.OperatorAdapter$1.tuple(OperatorAdapter.java:803) at com.ibm.streams.operator.internal.runtime.api.OperatorAdapter$1.tuple(OperatorAdapter.java:796) at com.ibm.streams.operator.internal.network.DeserializingStream.tuple(DeserializingStream.java:76) at com.ibm.streams.operator.internal.network.DeserializingStream.processRawTuple(DeserializingStream.java:65) at com.ibm.streams.operator.internal.runtime.api.InputPortsConduit.processRawTuple(InputPortsConduit.java:100) at com.ibm.streams.operator.internal.jni.JNIBridge.process(JNIBridge.java:316) Exception: Unrecognized SSL message, plaintext connection?

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

3 answers

  • Sort: 
120000BW1S gravatar image

Answer by BryanMiller (309) | Nov 09, 2018 at 07:41 PM

Can you post your code or a snippet? What libraries are you using to support REST inside Streams? It is almost impossible to tell without seeing some code.

I typically use:

 use com.ibm.streamsx.inet.http::HTTPPost ;
 use com.ibm.streamsx.inet.http::HTTPResponse ;
Comment

People who like this

  0   Show 3   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
50G2CBPYNS gravatar image khloud (13)   Nov 12, 2018 at 10:10 AM 0
Share

use this classes in my java adapter ? and how import this toolkit com.ibm.streamsx.inet in my teda project ? please check my question in the url : https://developer.ibm.com/answers/questions/478970/view.html

270003PPNM gravatar image Mark-OliverHeger (266) khloud (13)   Nov 14, 2018 at 03:58 AM 0
Share

how to add toolkits to ITE application is described here: https://www.ibm.com/support/knowledgecenter/en/SSCRJU_4.2.1/com.ibm.streams.toolkits.doc/spldoc/dita/tk$com.ibm.streams.teda/tk$com.ibm.streams.teda$131.html

50G2CBPYNS gravatar image khloud (13)   Nov 17, 2018 at 05:05 PM 0
Share

@BryanMiller where i should use this use com.ibm.streamsx.inet.http::HTTPPost ; use com.ibm.streamsx.inet.http::HTTPResponse ; in my context ?

120000BW1S gravatar image

Answer by BryanMiller (309) | Nov 17, 2018 at 09:28 PM

I am using HTTPResponse() to post to Cloundant on Bluemix like this:

 (stream<HTTPResponse> Post) as PostToCloudantDB = HTTPPost(EvictTS_6_out0 as
             inPort0Alias)
         {
             param
                 url :
                     "https://url-secret-bluemix.cloudant.com/greatoutdoors" ;
                 authenticationType : "basic" ;
                 headerContentType : "application/json" ;
                 authenticationProperty :
                     "userid=my-secret-bluemix",
                     "password=anothersecret" ;
             config
                 tracing : info ;
         }

I'll see if I have a pure REST example as well.

Comment

People who like this

  0   Show 7   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
50G2CBPYNS gravatar image khloud (13)   Nov 18, 2018 at 11:41 AM 0
Share

@BryanMiller Ok thanks a lot, i am waiting your Rest example , can i use the above code in my context in teda application ?

120000BW1S gravatar image BryanMiller (309) khloud (13)   Nov 18, 2018 at 04:11 PM 0
Share

Is your teda application running in Streams? If so, yes, you can use the above code.

120000BW1S gravatar image BryanMiller (309) BryanMiller (309)   Nov 18, 2018 at 04:22 PM 0
Share

This page has an example of using REST to call a web service and retrieve a JSON payload:

https://developer.ibm.com/streamsdev/docs/example-using-rest-apis-chart-streaming-data/

50G2CBPYNS gravatar image khloud (13)   Nov 19, 2018 at 12:02 PM 0
Share

@BryanMiller if i use the above code the receiver server will receive json request by using this headerContentType : "application/json" ; ? if no how send json data in HTTPPost operator

120000BW1S gravatar image BryanMiller (309) khloud (13)   Nov 19, 2018 at 12:36 PM 0
Share

Yes, it will send JSON data.

If you want to experiment you can download a free VM of Streams Studio and upload your SPL files to Streams on Bluemix to test them out. It is a good method of quickly testing out ideas.

50G2CBPYNS gravatar image khloud (13) BryanMiller (309)   Nov 19, 2018 at 03:18 PM 0
Share

@BryanMiller after my run my application the below error appeared how solve this ??

{data="java.lang.ClassCastException: java.lang.String cannot be cast to org.json.simple.JSONAware",errorMessage="",responseCode=500,dataSize=333}

Show more comments
120000BW1S gravatar image

Answer by BryanMiller (309) | Nov 19, 2018 at 04:34 PM

@khloud You will need to convert your data payload to JSON before calling POST.

Since you have not shared any details of what you are attempting I can only make guesses. You can either convert your data manually to JSON or you can use some of the existing libraries to convert to JSON. Here is one set of libraries I have used for Java and Python tuple data:

 com.ibm.streamsx.json::JSONToTuple ;
 com.ibm.streamsx.json::TupleToJSON ;

Comment

People who like this

  0   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
50G2CBPYNS gravatar image khloud (13)   Nov 20, 2018 at 02:33 PM 0
Share

@BryanMiller iam usin version 4.0.1 this version cannot support this toolkit com.ibm.streamsx.json i am using the below code and i have the above error also how solve this issue

rstring jsonString={\"extKeys\":{\"customerKey":\"111111\"}};

(stream Post) as PostTrtim = HTTPPost(jsonString as SMSStreamPort) { param url : "httpUrl"; authenticationType : "basic" ; headerContentType : "application/json" ; authenticationProperty : "userid=test", "password=2018" ;

Follow this question

154 people are following this question.

Answers

Answers & comments

Related questions

how solve this problem in ITE application in TEDA in infosphere stream 2 Answers

in infosphere streams i used two servers when i make streamtool stopinstance then some of resources on the second server stopped and not complete the remaining resources on the first server 2 Answers

i have a problem after the infosphere streams installation when i startinstance this problem appeared 2 Answers

Im using Streams 4.0. I have 2 node/resources when i use streamtool getresourcestate i have one of the resources not running 0 Answers

i have a problem in ITE application in TEDA 1 Answer

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges