SoapClient can not open local WSDL (nginx, php7-fpm) - soap

I'm running nginx and php7-fpm and have problems with the SoapClient accepting local wsdl files. I use a local file (like /api/backend/server/reservation/reservation_v012.wsdl) but I get a 502 Bad Gateway error. When I use "file:/" I get an error "failed to load external entity".
__getTypes() is not delivering any types. The 502 Bad Gateway error occurs exactly at this position, when __getTypes() is called.
Any idea why it's not running like it does with PHP 5.3 before?

Related

HTTP DCV Local http vs https Caching Error

I'm trying to run AutoSSL to renew or issue a new SSL certificate on my domain. When I run it however I get the following issues on my domain.
I'm running cPanel 106.0.4 and i've tried re-installing both litespeed and cPanel itself. I'm also running CPhulk and ConfigServer Security & Firewall - csf v14.17
I try and delete the .well-known directory and AutoSSL recreates the pki=validation folders in the correct location /home/domain/public_html/.well-known/pki-validation/
I've tried rebuilding IP Address pools, pinging the domain locally to check the IP Address resolves correctly from the server to the server itself, rebuilding the Zone file for the domain.
1:04:07 PM Performing HTTP DCV (Domain Control Validation) on 31 domains …
1:04:07 PM WARN Local HTTP DCV error (mydomain.co.uk): The system queried for a temporary file at “http://mydomain.co.uk/.well-known/pki-validation/45DE0ED1146497E5E2019A467A25C8D6.txt”, but the web server responded with the following error: 404 (Not Found). A DNS (Domain Name System) or web server misconfiguration may exist.
What am i missing here?
Thanks
UPDATE 1
When I pull up http://mydomain.co.uk/.well-known/pki-validation/ I seem to get a different set of files than when I look up the https 443 version https://mydomain.co.uk/.well-known/pki-validation/ however this occurs on multiple devices and browsers implying its a server side caching issue perhaps?

How to connect to a SVC endpoint?

Given a URL that ends with .svc and that is supposed to run a SOAP web service, how can I get some data from it?
I tried:
to access it via a web browser
to access it via the Python's library Zeep
to access it via the Microsoft utilitary svcutil.exe
In all cases, I get a timeout error:
Failed to establish a new connection: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time.
Does it mean that the web service does not work, or that I do things the wrong way?
Importantly - there is a big distinction between "service not active" (and by that I mean no listener on port 80), and "port not open in firewall".
If the problem were simply that you didn't have a service listening on port 80, you would have gotten something like "connection reset" or "connection rejected" as an error.
Instead, you appear to have gotten a timeout, which implies that either the SYN from the client doesn't reach the server, or the SYN/ACK from the server doesn't reach the client. [ You could verify this by doing a packet capture for port 80 on both client and server ]
I would be tempted to check any firewall in front of the server to see that it's letting port 80 traffic through from your client.
Diagnosing Connectivity Issues
Without more details it is difficult to say, but given your timeout error:
Failed to establish a new connection: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time.
This indicates a network connectivity error at the TCP level, so it is likely web service is not active on the port your are using (default of 80 for http, 443 for https).
In a comment you said you pinged the URL and it responded normally - I assume this means you pinged the hostname. If this is responding normally it means the server is active, but that doesn't tell you anything about the availability of the web service on that server.
telnet %hostname% %port%
where %port% is 80 for http or 443 for https, or something else if there is a port number in the URL you are using (e.g. http://somehost.somewhere.com:port/path.scv)
If ping works and telnet does not connect, then the service is not active.
I suspect this is the case. If the service was active and it was simply that you requesting the data incorrectly, I believe you'd get a different error message - e.g. a valid HTTP response with status code 500 or 404 or similar.
Getting Data from a Web Service
As to your original question as to how to get data from it - once you verify that the service is active, the method to get the data will depend on the specification of the service - i.e.:
which HTTP methods (GET, POST, etc.) does it support
what parameters it requires
what format it requires the parameters in
are the parameters in the query string or POST body.
To interact with a web service there are many command line tools that can be used, as well as the options you have tried, including:
POSTMan Google Chrome Plugin
curl
wget
In windows Powershell, the Invoke-WebRequest
Getting Data from a SOAP Web Service
As you have said it is a SOAP web service, if you have the URL for the wsdl, you can often interract with it using Powershell SOAP WebService Proxies.
The wsdl location varies, but is often at a URL that looks something like.
http://host/path.svc?wsdl
http://host/path.svc/?wsdl
http://host/path/?wsdl
Also if it's configured correctly, just loading the URL in a browser will present a page with a link to the wsdl.
The general idea is:
$URI="http://hostname/path.svc?wsdl"
$Proxy = New-WebserviceProxy $URI –Namespace X
$Proxy | get-member -MemberType Method
This will return a list of methods on the proxy that you can invoke as powershell methods. Any types defined in the wsdl that are needed for arguments, or returned from methods will be available within the namespace X. Invoking the methods will proxy the request to the service, taking care of serializing parameters and serializing results into powershell objects.

JNLP server returned 503 error

I found some posts on this error but i can't get my JNLP to work.
I try to access a JNLP located on server by the command :
javaws http://:8081/jnlp/Composer.jnlp
The problem is that the server keeps returning 503 error even though my collegue is accessing it with not problem.
I understood that 503 error is a temporary unavailability of the server, but the previous point shows that the server is running fine (we tried several times).
The exact encapsulated error is :
java.io.IOException: Server returned HTTP response code: 503 for URL: http:///jnlp/Composer.jnlp
What i tried to do is
allow the adress of the server in the exception sites
use the option to use IPV4 adress by default for JVM (i saw a post saying that there can be a bug using jre7 if u dont set the option -Djava.net.preferIPv4Stack=true)
restart server
disable firewall.
My problem is that as my collegue can access it, it looks like a client configuration bug, not server.
Does somebody have an idea?
Thanks for your support.

HTTP error 508 from PERL script during redirection of requests from secure to non-secure server

I am getting a strange error in my file upload application.
1) Server 1: It is secure web server on port 443, which is accessible to public hosting a perl script
2) When this server get a request for cgi-bin directory, it will simple redirect the request to other web server (Server 2) running on port 80
3) The perl script in Server 2 will save the file in disk
Issue:
Above mechanism worked for a couple of hours later it has thrown Http error code:508
Observations:
If I directly hit Server2 on port 80, perl script successfully saving the files to disk. But If I directly hit Server1 on port 443, I am getting 508 error
When I first got the issue, I have restarted both webservers and it worked. But when I get the same issue second time, restart of servers did not help. The call to Server1 is throwing 508 error and requests are getting timed out.
ulimits and open files are in control.
If you experience this type of issue, please share your thoughts.
This strange issue has been resolved after moving dynamic service to other Virtual machine. This issue is no longer reproducible after changing the node.

"connection refused" when my play app makes http call to itself

I am implementing a heartbeat endpoint/route using play 2.2.1 built with Scala 2.10.2 (running Java 1.7.0_45). When
the heartbeat endpoint is called, I want the controller to make http calls to localhost. If all of those
calls are ok, then the heartbeat endpoint will return an OK http response.
When I execute the following url from curl, I get the expected 200 response:
http://localhost:9000/oauth2/token. I am also able to telnet to localhost 9000.
I am also able to use WS successfully with an external URL:
WS.url("http://www.example.com").withHeaders("Content-Type" -> "application/json").get()
However, when I execute it from within my play app, I get a 500 tcp_error response.
WS.url("http://localhost:9000/oauth2/token").withHeaders("Content-Type" -> "application/json").get()
WS.url("http://127.0.0.1:9000/oauth2/token").withHeaders("Content-Type" -> "application/json").get()
WS.url("http://HostName:9000/oauth2/token").withHeaders("Content-Type" -> "application/json").get()
Here is the exact error message I receive:
Network Error (tcp_error)
A communication error occurred: "Connection refused"
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
For assistance, contact your network support team.
Do I need to configure something to allow a play application to make calls to itself? Is this a network problem on
my box? If so, why do curl and telnet work? If a network issue, then it must be a jvm specific networking issue?
Could it be a security problem with play calling to itself? Not sure where to go next.