WSO2 API Manager - Sample PizzaShackAPI is not working - wso2

I am new to WSO2 API Manager. I followed the Quick Start Guide to learn by deploying sample PizzaShackAPI.
https://docs.wso2.com/display/AM210/Quick+Start+Guide
As I click "Try It Out!", I am not getting the correct response as mentioned in the guide.
I am getting the below response and there is no log in the console initially.
Response Code
0
Response Headers
{
"error": "no response from server"
}
After I added Self Signed Certificate in Firefox as Add Exception, I am getting the below error in the console,
[2017-03-01 15:06:51,309] ERROR - SourceHandler I/O error: An established connection was aborted by the software in your
host machine
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.apache.http.nio.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:371)
I guess it may be a certificate configuration issue. Please help me to resolve this issue.
I tried with creating my own API. Facing the same issue.

Error message "error": "no response from server" on API console is mostly due to CORS error. Could you please check your browser console and see the error there, Most likely you will see error related to cors.
Note: these changes are not advised for production environment, for production environment you want to provide all relevant information instead of allow all (*)
To allow all headers and origin edit repository/conf/api-manager.xml and change values for following:
<Access-Control-Allow-Headers>*</Access-Control-Allow-Headers>
<Access-Control-Allow-Origin>*</Access-Control-Allow-Origin>
Second change to allow all host name and avoid any certificate host name validation.
Edit /repository/conf/axis2/axis2.xml and un comment HostnameVerifier and change value to AllowAll.
<parameter name="HostnameVerifier">AllowAll</parameter>
Restart API Manager and test again.

Related

I have a soap service deployed on wso2 apim 4.0.0. While working with the api I randomly get Error on line 1: Content is not allowed in prolog

I have a soap service deployed on wso2 apim 4.0.0. While working with the api I randomly (rarely) get an error - "Content is not allowed in prolog". Is there any component of the configuration to be tuned to overcome this issue? Another version of the cause of this error, I found out in the article, this might be caused by a consumer that is not able to properly invoke the api. Any hint to find out the root of the problem is appreciated.
Enable wire logs[1] and check whether the backend is sending a corrupted response while you are reproducing the issue.
A corrupted response means such as a chunked response but, the Content-Length header is available in the response.
You can compare the wire logs for both the happy path and the issue scenario.
[1] https://apim.docs.wso2.com/en/latest/integrate/develop/using-wire-logs/

How to fix "Could not get any response" in Postman?

Postman for Linux
Version 6.7.1
Deepin x64
I'm trying to test a get method on postman to test my code, but I always get this error message.
Could not get any response.
There was an error connecting to localhost:3001/blocks.
Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General
I've tried to do almost everything from this topic ("Could not get any response" response when using postman with subdomain) but nothing seems to work.
This is the on the message console.
Postman Console Message
Someone can help me to fix this?
In Postman go to Postman-> Preferences and in the settings tab turn off SSL certificate Verification
my project work try this:
Restart your web server local ex: wamp, postgree, oracle
in postman setting :
Trim keys and values in request body OFF
Use next generation URL processing ON
SSL certificate verification OFF
Always open request in web tab OFF
Send no cache header ON
Send postman token header ON
Retain headers when clicking on links OFF
Automatically follow redirects ON
Send anonymous usage data to postman OFF
It works for me:
Restart your web server like: PostgreSQL, Oracle
it will work

SSRS Server Web Service using 2-Way SSL - Error : HTTP Error 403.7 – Forbidden

I have tried various configuration settings but still no luck
I’m getting the below error when I tried to run a report from SSRS server.
HTTP Error 403.7 - Forbidden
The page you are attempting to access requires your browser to have a Secure Sockets Layer (SSL) client certificate that the Web server recognizes.
processing!ReportServer_0-2!1084!03/26/2015-13:21:18:: e ERROR: An exception has occurred in data set 'DistributionComponents'. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset 'xComponents'. ---> Microsoft.ReportingServices.DataExtensions.XmlDP.XmlDPException: Failed to execute web request for the specified URL.
Forbidden: The remote server returned an error: (403) Forbidden. ---> System.Exception: The remote server returned an error: (403) Forbidden.
Setup:
Configuration:
WCF Service:
In the WCF Service I have bindings configured as Transport, and the pretty much like described in the below article
http://www.codeproject.com/Articles/348595/Use-Mutual-SSL-Authentication-in-WCF
I can browse to the service and view WSDL without no issues. I have also checked the WCF trace and no errors.
SSRS Web Service Configuration:
SSRS Web Service Data Source has been configured to execute the HTTPs WCF Web Service URL.
SSRS also configured to use a valid SSL Certificate.
I can access the ReportsManager URL and View reports successfully using HTTPs URLs.
I have tried many configuration settings, including disabling the firewall and virus scans still no luck. I have also search on the Web but there is no much direction on this particular issue.
Can some please point me to the right direction?
To be more precise I would have said the SSRS installed in the Native mode. Nevertheless I figured it out that this is not supported. In other words 2-Way SSL between SSRS (acting as a Client) and the WCF (Service) is not supported.

I'm getting Error "Server Application Unavailable"

The webservice isthrowing the following error when i browse from IIS:
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note:
An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
In event viewer, I am getting the following message:
Failed to execute request because the App-Domain could not be created. Error: 0x80131509
For more information, see Help and Support Center at http://go.microsoft.com/fwlink events.asp.
I'm not able the understand the the problem actually is and how to resolve this. please help me.
I have found a very good article that worked for me:
https://askgif.com/blog/148/i-m-getting-error-server-application-unavailable-in-iis/
There seems to be a problem with your IIS installation, specifically, the Application Pool associated to your website. This could be because ASP.NET is not installed properly.
Please try the following:
Remove your website and application pool and recreate them
Install ASP.NET - run this command: %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe–i as an Administrator.

rg.apache.axis2.AxisFault: Transport error: 403 Error: Forbidden

I am trying to access a webservices over https, I have the ssl certificates in place. However when I send the webservice request I am getting:
threw exceptionorg.apache.axis2.AxisFault: Transport error: 403 Error: Forbidden
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:296)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
Snooping on the wire show that the client is trying to connect to the server.
I am stumped as to what is causing this, any help would be much appreciated.
Thanks
Try setting this property and it should hopefully resolve the issue:
options.setProperty(HTTPConstants.CHUNKED, "false");
-Jasdeep
As far as I can work out this was due to network errors. The client was configured to do one-way ssl only. Whereas the server was configured for two-way ssl.
if the webservice is in .NET and hosted on IIS , you can try the below
Open IIS console > Right click on Default Web Service - Properties >Uncheck "Http Keep-Alives Enabled"