I'm getting the following error intermittently when invoking the webservices over https using Axis2, any suggestions on this please?
org.apache.axis2.AxisFault: Transport error: 302 Error: Found
I have tried almost all options available in internet,i.e, setting up the axis2.xml with configurations etc., but nothing seems to help.
Related
I'm trying to create a new API from a rest service in WSO2 Publisher and I'm getting an error when I try to validate the endpoint:
When I go to log it shows the message:
[2021-03-30 22:09:54,744] ERROR - ApisApiServiceImpl Error occurred while sending the HEAD request to the given endpoint url:
java.net.ConnectException: Connection refused (Connection refused)
What am I doing wrong?
If I progress the creation when I try to test I get another error:
[2021-03-30 22:15:31,311] WARN - SourceHandler I/O error: Received fatal alert: certificate_unknown
[2021-03-30 22:15:31,351] WARN - ConnectCallback Connection refused or failed for : localhost/127.0.0.1:8888
[2021-03-30 22:15:31,353] WARN - EndpointContext Endpoint : CpoExecutorAPI--v1.0.0_APIproductionEndpoint with address http://localhost:8888/cpo-executor/dev will be marked SUSPENDED as it failed
Apart from the certificate issue, another possible cause for this error is network connectivity. Please make sure that there weren't any network issues while invoking the request and the network connectivity was stable. Also, please check whether you can directly connect to the provided endpoint URL and get the responses without any issues.
WARN - SourceHandler I/O error: Received fatal alert: certificate_unknown
With the above-mentioned warning, we can suspect there is an issue with certificates.
Therefore, if you have made any recent certificate changes in your environment can you check whether the required certs are available in the API Manager Keystore?
When I try to create a proxy service with only https transport, I get the following error:
WARNING: EPRs are NULL. Transport configuration may be incorrect
If I add back in the http transport, the error disappears.
Is there something I'm doing wrong or is this related to https://wso2.org/jira/browse/ESBJAVA-1624?
I still consider myself new to Java webservices, and I have hit a real roadblock that I cannot overcome.
I am trying to deploy a #Stateless Web Service and access it's WSDL over https. Whenever I attempt to access it I get the following error in the browser:
Error generating artifacts for the following WSDL https://localhost:8181/TestService/Test?WSDL
Possible causes can be invoking https when the application is not configured for security
The console is showing the following errors:
INFO: parsing WSDL...
WARNING: Invalid request scheme for Endpoint Test. Expected http . Received https
INFO: [ERROR] Premature end of file.
INFO: line 1 of https://localhost:8181/TestService/Test?WSDL
WARNING: Invalid request scheme for Endpoint Test. Expected http . Received https
WARNING: MEX0008:Failed to parse metadata returned from server at https://localhost:8181/TestService/Test?WSDL using protocol SOAP_1_2. Continuing attempts.
WARNING: Invalid request scheme for Endpoint Test. Expected http . Received https
WARNING: MEX0008:Failed to parse metadata returned from server at https://localhost:8181/TestService/Test?WSDL using protocol SOAP_1_1. Continuing attempts.
WARNING: Invalid request scheme for Endpoint Test. Expected http . Received https
WARNING: MEX0008:Failed to parse metadata returned from server at https://localhost:8181/TestService/Test?WSDL/mex using protocol SOAP_1_2. Continuing attempts.
WARNING: Invalid request scheme for Endpoint Test. Expected http . Received https
WARNING: MEX0008:Failed to parse metadata returned from server at https://localhost:8181/TestService/Test?WSDL/mex using protocol SOAP_1_1. Continuing attempts.
INFO: [ERROR] Premature end of file.
Failed to read the WSDL document: https://localhost:8181/TestService/Test?WSDL, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
INFO: [ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):
At least one WSDL with at least one service definition needs to be provided.
INFO: Failed to parse the WSDL.
INFO: Invoking wsimport with https://localhost:8181/TestService/Test?WSDL
SEVERE: wsimport failed
Again, this is ONLY happening when accessing it over HTTPS. Regular HTTP is fine. However, if I were to remove the #Stateless annotation, it works just fine over https. It fails when I add the #Stateless annotation.
I need the #Stateless annotation since I will be working with JMS Queues, and you need it when doing that.
Below is the code for my class:
package service.test;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebService;
#Stateless
#WebService
public class Test
{
public String hello()
{
return "Hello!";
}
#WebMethod
public int addNumbers(int number1, int number2)
{
return number1 + number2;
}
}
So far at this point, I have never needed to utilize any web descriptors. Everything I have done is by default handled in Eclipse automatically. Do I have to do anything special with the descriptor files? If so, which ones?
Thank You
Https uses port 443 by default. If your webservice is listening on port 8181, it won't see the https requests.
Just a wild guess: do you have your servers certs issuer in your truststore? It can be an ugly ssl problem. (although the fact that it works without #Stateless kind of contradicts my theory)
just a guess...
This was an odd issue that I never really figured out the cause of. Oddly enough, this issue worked itself out in the end by not needing #Stateless.
Web service - Service is on WAS v7. Client is on JBoss v5. We recently upgraded to JBossWS 3.3.1. Since then the client is unable to communicate with the service on WAS.
Without any changes to code, we get the below exception
2012-01-19 14:42:15,317 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS]->error#419 (ajp-cwsappdev01%2F205.132.14.29-8109-1)
SOAP request exception java.io.IOException:
Error initializing socket factory SSL context: Can not find truststore url.
Added the following lines of code to the client:
((BindingProvider) impl).getRequestContext().put(StubExt.PROPERTY_KEY_STORE, "/usr/local/jee/.../cacerts"));
((BindingProvider) impl).getRequestContext().put(StubExt.PROPERTY_KEY_STORE_PASSWORD, "*****"));
((BindingProvider) impl).getRequestContext().put(StubExt.PROPERTY_CHUNKED_ENCODING_SIZE, "0");
After making the code change, am getting the below error:
Caused by: org.jboss.ws.WSException: Invalid HTTP server response [404] - Not Found
Any ideas? I added the chunked encoding property, as WAS does not support it properly. Any other incompatibility between JBoss and WebSphere App Server?
Thanks for your help in advance!
==================
I made some code changes and am now getting the below message. I use JBossWS-Native 3.3.1 and JAX-WS 2.1 versions. Does any one know how I can disable chunked encoding in JBoss?
File standard-jaxws-client-config.xml moved into one of JBoss the core JARS - updating it would need me to 'unjar' - edit file - and jar back again.
2012-01-24 10:35:57,930 WARN [org.jboss.ws.core.client.transport.NettyClient]->warn#352 (ajp-cwsappdev01%2F205.132.14.29-8109-4) Can't set chunk size from call properties, illegal value provided!
2012-01-24 10:35:58,001 ERROR [org.jboss.ws.core.CommonClient]->error#419 (ajp-cwsappdev01%2F205.132.14.29-8109-4) Exception caught while (preparing for) performing the invocation:
java.io.IOException: Could not transmit message
at org.jboss.ws.core.client.transport.NettyClient.invokeInternal(NettyClient.java:229)
at org.jboss.ws.core.client.transport.NettyClient.invoke(NettyClient.java:121)
at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:150)
at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:69)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:369)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:181)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:161)
at $Proxy796.getCWSAccount(Unknown Source)
Cause: Although the client had port specified as 8004 in the endpoint URL; when the request hit the service it was coming in for port 443. We moved/"attached" the service to port 443 and the web server was able to map it to the right application. will need to figure out why/where the endpoint was changed fro 8004 to 443..
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"