What's the problem with Delphi Rest Client components - rest

I'm trying to consume a simple API just for test, but it doesn't work using Delphi Rest Clients components.
Call to API works using browser and Postman without any configuration. The URL is https://api.cartolafc.globo.com/mercado/status
First I've tried use the tool "Rest Debugger" and it returns nothing.
So I tried to use the trio of REST CLIENT components by doing the following steps:
Created a new project;
Added TRestClient, TRestRequest and TRestResponse components;
Configured BaseURL from TRestClient as "https://api.cartolafc.globo.com/mercado/status"
Clicked the right mouse button on the TRESTRequest component
Hit Execute... command
It returns the following error:
Error receiving data: (12152) the server returned an invalid or unrecognized response
Did I do something wrong?

Related

JSP handshake failure with REST endpoint

I am creating a web API that returns JSON. Currently I am able to call the endpoint with jquery and php curl but I am not able to do so using JSP HttpsURLConnection.
It gives me a handshake_failure exception. Is there anyway that this can be solved without having to install a file in the jsp server ? I am doing a REST service so it doesn't make sense for all my users to install a file to call it.
Will this also affect the calling ?

Redirects issue in ngrinder groovy-Eclipse plugin

I am facing an issue when I am scripting the redirects in nGrinder (Script written in Groovy in Eclipse; Eclipse integrated with Groovy plugin) for the URL: https://winterfell-sbo-sbo-test-cso-web-mta.cfapps.sap.hana.ondemand.com/sites
Attached is the Eclipse log (Page #11, #12, #13) for your reference and below is the explanation on the issue.
Step#1
I fire a HTTP GET request on https://winterfell-sbo-sbo-test-cso-web-mta.cfapps.sap.hana.ondemand.com/sites.
This automatically follows redirects and then lands on to the Login Page: https://winterfell.authentication.sap.hana.ondemand.com/login
Step#2
I fire another HTTP GET request on 'https://winterfell.authentication.sap.hana.ondemand.com/saml/discovery?returnIDParam=idp&entityID=winterfell.canary&idp=winterfell-metadata&isPassive=true
This doesn't automatically redirect to "Location" header -> https://winterfell.authentication.sap.hana.ondemand.com/saml/login/alias/winterfell.canary?disco=true&idp=xs2security.accounts400.ondemand.com
Refer to the screenshot for more information.
Instead it gets redirected to https://winterfell.authentication.sap.hana.ondemand.com/login
We tried to capture and set the csrf cookie for the GET request of https://authentication.sap.hana.ondemand.com/saml/discovery?returnIDParam=idp&entityID=winterfell.canary&idp=winterfell-metadata&isPassive=true -> but still it isn't working as expected
Colleague was able to make this work in JMeter. So we are trying to simulate this in nGrinder by setting "followRedirects" to true and it isn't working as expected.
Since in Step#2, it is not picking up the location of the response header and redirecting back to "/login" page, what could be the possible reasons for this behavior?
we checked if xsuaa is working fine. On executing the request in Postman, everything worked as expected. Curl works well.

Email/Password Authentication Mongodb-stitch Android API

This seems to be on a very new topic because the "stitch" or "mongodb-stitch" tags do not exist yet.
I have a mongodb altas cluster on cloud.mongodb.com. The page https://docs.mongodb.com/stitch/auth/email-auth/ only teaches how to do things with JS but I don't have server side JS on hand. Instead I tried to figure out how to do things with the StitchClient on the Android API.
I was able to register an email/password pair using StitchClient.register(email,pwd) and got an email from no-reply+stitch#mongodb.com with the token/tokenId. I copied them and used StitchClient.emailConfirm(token, tokenId) but failed. The error was:
Unexpected response code 404 for https://stitch.mongodb.com/api/client/v1.0/app/APP-ID/auth/local/userpass/confirm
which sounds strange! I opened a browser and paste that in the URL and got 404 too. I even did
curl --data "token=432...345&tokenId=435..334" https://stitch.mongodb.com/api/client/v1.0/app/APP-ID/auth/local/userpass/confirm
and still got 404.
Is this a bug or an outage of the stitch.mongodb.com server?

Jmeter SOAP/ XML-RPC request default URL

I am trying to test web service for my project. The Web service accepts a SOAP request and gives appropriate response.
In JMeter I have chosen SOAP/ XML-RPC request. It works completely fine for me and gives me correct response. However, I have more than 100s of web services in my scope of testing and I have to test them in different environments. It is very cumbersome work to change the URL value from the SOAP/ XML-RPC sample to point it to different env. Do we have something like HTTP Request Default for SOAP/XML-RPC requests?
I have also tried a bean shell sampler where I am setting the value of a variable and then retrieve it in the SOAP sampler URL parameter. However it did not work for me. Below is the code.
Bean Shell sampler code:
vars.put("baseURL","http://localhost:9191/ws/soap");
SOAP/ XML-RPS Sampler URL value:
${__BeanShell(vars.get("baseURL"))}
Any suggestions? I read in JMeter docs that this can be done via http sampler, however, I want to avoid using the same if possible.
You should avoid using SOAP/XML-RPC in favor of pure Http Sampler.
Use the "Templates..." (menu) > Building a SOAP Webservice Test Plan:
This way you can use HTTP Request Default if you want.
But note from what you describe, using a CSV Data Set Config would allow you to variabilize the URL.
Use JMeter Properties to set base url like:
in user.properties file (under /bin folder of your JMeter installation) add one line per property:
baseURL=http://localhost:9191/ws/soap
alternatively you can pass the property via -J command line key as:
jmeter -JbaseURL=http://localhost:9191/ws/soap -n -t /path/to/your/testplan.jmx -l /path/to/results.jtl
Refer the defined property in your test plan using __P() function
${__P(baseURL,)}
You can even provide the default value, i.e. if the property is not set via user.properties file or command-line argument - default value will be used:
${__P(baseURL,http://localhost:9191/ws/soap)}
See Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of setting, overriding and using them.

XDS.b testing with SoapUI

I have to implement a simple client to a XDS.b server (SubmitObjectRequest and RetrieveDocumentSetRequest operations), but I'm struggling to get even a simple example of use to work.
I've tried using Mirth Connect's Channel for XDS.b also, but with no use. I even tried to copy its SOAP envelope to use with SoapUI. Didn't work.
I'm using HIEOS deployed on Glassfish as my XDS.b server.
I'm lost and confused. Could anyone give me a guidance on how to make this work?
If the HIEOS is deployed correctly within the Glassfish the service endpoint provides a wsdl definition where the interface is specified. Check the Glassfish for the wsdl of the service.
http://localhost:8080/my-ws/simple?WSDL
Quelle: docs.oracle.com/cd/E18930_01/html/821-2418/gbiyw.html
The list of provided endpoints you can see here:
https://kenai.com/projects/hieos/pages/WebServices
So to retrieve the wsdl you should use for example:
http://localhost:8080/axis2/services/xdsrepositoryb?wsdl
which applies for the ProvideAndRegisterDocumentSet-b transaction of the XDS Repository actor.
You can use the WSDL definition to create a WS request using SOAP UI at first.
SOAP UI creates a request based upon the wsdl definition which can be used to
test a against your XDS repo.
When you know how a SOAP request must be constructed you can try it using Mirth or
create your own client using Apache CXF http://cxf.apache.org/ for example.
Or you use AXIS2 to create a client from the WSDL. Of course does Visual Studio and C# also offer mechanisms to create a WS client directly from a WSDL definition.