SAS/WPS HTTP PROC Basic Authentication - rest

Am trying to get the data from JIRA REST API using WPS. I was using the HTTP PROC to call JIRA rest api.
proc http
method="GET"
url="http://servername:8080/rest/api/2/search?%str(&)fields=project,status%str(&)jql=project=C12395"
webusername="username"
webpassword="password"
ct="application/JSON"
out=resp;
run;
Am getting error/response code as 400.
NOTE: Call to [http://servername:8080/rest/api/2/search?&fields=project,
status&jql=project=C12395] returned [400]
NOTE: Procedure http step took :
real time : 0.628
cpu time : 0.031
Am really not sure what am missing. Same JIRA REST API URL working in JAVA.
Note: WPS version is 3.2
Thanks!
Bharathi

Related

All Tags not replicating from SOAP Endpoint while creating REST Service in WSO2 API-Manager

I am trying to create a REST Endpoint from a SOAP Endpoint using WSO2 API Manager(v3.2.0).
Steps are
Launch API Manager
Create API > I have a SOAP Endpoint
Implementation Type : Generate REST APIs, Input Type : WSDL URL
I enter the WSDL URL and system validates it.
I enter the Name of the API, context, version, endpoint URL and select the Business Plan and click on CREATE.
API is created. Now I click on Resources and a specific post method e.g., createContract. In the in-mediation file, all xml tags present in the SOAP endpoint is not reflected properly.
I have tried to add these tags manually as well but it does not reflect in the REST API.
Kindly help!
TID: [-1234] [] [2021-07-29 09:28:14,972] INFO {org.wso2.carbon.apimgt.keymgt.handlers.DefaultKeyValidationHandler} - org.wso2.carbon.apimgt.keymgt.handlers.DefaultKeyValidationHandler Initialised
TID: [-1234] [] [2021-07-29 09:28:15,120] ERROR {org.apache.synapse.mediators.bsf.ScriptMediator} - {api:admin--FCUBSDEService:v1} The script engine returned an error executing the inlined js script function mediate com.sun.phobos.script.util.ExtendedScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "Jrnl" is not defined. (<Unknown Source>#3) in <Unknown Source> at line number 3
at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledScript.java:68)
at java.scripting/javax.script.CompiledScript.eval(CompiledScript.java:89)

Swagger results with `TypeError: Failed to fetch` for .net core RedirectResult

I have .net core WebApi application setup with swagger. An endpoint that responses with RedirectResult is not handled by swagger ui and shown up as Undocumented: TypeError: Failed to fetch
The redirect result itself contains a SAS url to Azure Storage Blob file.
I've tried to call this endpoint with SoapUI and Postman and the actual file appeared in response with application/octet-stream content type
The endpoint is built in format
Task<IActionResult> DownloadDocument([FromRoute] Guid id)
{
...
return Redirect(blobSasUri)
}
There is support for that or even some workaround or I've missed something?

Error 426 Upgrade required with REST API - PUT method

I am trying to update one of the table using REST API call with the PUT method which is running on my linux server(centos).
Here am sending headers(authorization,accept:"text/csv") with the body having values.
when am hitting with this payload to the linux server am getting "ERROR : 426 with UPGRADE_REQUIRED"
All the above steps am doing with POSTMAN
Please guide on this.
Regards,
navaneeth

How can i get failed http request details in jmeter via mail?

I am trying to send the mail through jmeter for failed http request, I want to know the sampler details like name of http request?
I have added if controller to check the assertion of previously running request sand send a mail if it fails.It gives me error message
"Message from Jmeter thread # Test failed: code expected to match /200/"
But I want to know the name of http request which has been failed so i can know specifically which request is failing?
You can use JSR223 PreProcessor to get the previous sampler details using the following code:
def sampler = ctx.getPreviousSampler()
Example usage:
def previousSamplerName = ctx.getPreviousSampler().getName()
log.info("Failed sampler name: " + previousSamplerName)
vars.put("SamplerName", previousSamplerName)
Demo:
If everything goes fine you will be able to access previous sampler name as ${SamplerName} in the SMTP Request sampler
ctx is a shorthand to JMeterContext class instance, see the JavaDoc for available methods and fields
vars is a shorthand to JMeterVariables class instance, it provides read/write access to all JMeter Variables in scope.
Also check out Groovy Is the New Black guide to get familiarized with using Groovy in JMeter tests.

SoapUI endpoint error randomly

I don't understand something about SoapUI and his mockservice's behaviour.
I'm using the client of SoapUI (testcase) and a Java EE application with JAX-RPC.
My problem is :
when I'm trying to call any webservice, from my Java Client, or the testcase of SoapUI, the mockservice return a well message at first call, and the error below at the second call, with the same call or not.
But if I'm waiting, It works ...
So, I have enabled the option in SOAPui : "close HTTP connection after each SOAP request" and it works all the time...
So my question is :
"Is it a normal behaviour of the mockservice, and how to implement this with my java client ?"
Thank you all.
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Missing operation for soapAction [] and body element [null] with SOAP Version [SOAP 1.1]</faultstring>
</soapenv:Fault>
OK,
I found a solution on the forum of SoapUI : http://www.soapui.org/forum/viewtopic.php?t=5648
It is when you have the settings flag "HTTP Settings/Logs wire content of all mock requests" set to true.
=> Uncheck the flag and it works fine!
Thanks a lot !
I had the same problem, using SoapUI 5.1.2 Pro.
After receiving first asynchronous response to the MockService, the MockService
stopped and could not receive any more responses for the request I sent.
The error message was:
Thu Jul 02 12:59:44 CEST 2015:ERROR:An error occurred [Missing operation for soapAction [XXXX] and body element [null] with SOAP Version [SOAP 1.1]], see error log for details
In SoapUI Settings:
File->Preferences->Http Settings: "Enable Mock HTTP log", uncheck box:
"Logs wire content of all mock requests".
Now I receive several asynchronous responses in a row, and give response back on them.
The same problem may happen when two mock services run with the same endpoint address (including port and path) on SoapUI.