POST wcf Service.svc calls fail even with explicit verbs allowed - wcf

I have a .net CF proxy that issues a POST like so:
POST http://192.168.0.172:8080/MIS.WOService/Service.svc HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: http://tempuri.org/IWOService/LogIntoServer
Content-Length: 276
Connection: Keep-Alive
Expect: 100-continue
Host: 192.168.0.172:8080
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><LogIntoServer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/"><emp_pin>55555</emp_pin></LogIntoServer></s:Body></s:Envelope>
The calls always fail with the server returning:
HTTP/1.1 404 Not Found
Date: Thu, 09 Dec 2010 16:07:14 GMT
Server: Microsoft-IIS/6.0
X-AspNet-Version: 4.0.30319
Cache-Control: private
Content-Length: 0
However if, in fiddler I change the POST to a GET it works...
I have the configuration for the website to allow ALL verbs on the svc extension and the " verify file exist" is un-checked.
Does anyone know what could be causing this behavior by IIS 6 ?
When I inspect the IIS logs, it shows:
#Date: 2010-12-09 16:24:34
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs- username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
2010-12-09 16:24:34 W3SVC1793831887 192.168.0.172 POST /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 404 0 0
2010-12-09 16:25:14 W3SVC1793831887 192.168.0.172 POST /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 404 0 0
2010-12-09 16:25:27 W3SVC1793831887 192.168.0.172 POST /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 404 0 0
2010-12-09 16:25:48 W3SVC1793831887 192.168.0.172 GET /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 200 0 0
2010-12-09 16:27:16 W3SVC1793831887 192.168.0.172 POST /MIS.WOService/Service.svc - 8080 - 192.168.200.67 - 404 0 0
Apparently I needed to put the name as url as such:
http://192.168.0.172:8080/MIS.WOService/Service.svc/basic
and then the server started allowing the svc to receive the soap messages...
Thanks
Greg

I watched in fiddler what the wcfTestClient sent as requests...
http://192.168.0.172:8080/MIS.WOService/Service.svc/basic
and then the server started allowing the svc to receive the soap messages...

Related

Net Core 3.1: Soap Request returns 403 Unauthorized

I have the following question. We are using net core 3.1.
We make a soap request (HttpWebRequest) to a external webservice where they only allow a whitelist of IP addresses into the portal. Our VPN Ipadress is in the whitelist.
But when i send a request (Via Visual studio debugger) it get rejected by de external webservice: 403 Unauthorized.
But when starting Fiddler and then sending the same request again, via Visual studio debugger, we get a 200 OK.
The same is with Postman. When fiddler is not running the request gets rejected. When Fiddler
is running the request is accepted and the response is 200 OK.
I dont understand what is happening, How to solve this.
NOT VIA Fiddler:
Status: 500 Internal Server Error
Version HTTP/1.1
Transferred 408 B (233 B size)
Referrer Policy strict-origin-when-cross-origin
Request Priority Highest
Response Headers:
Content-Type: application/json
Date: Thu, 28 Jul 2022 08:42:32 GMT
Server: Kestrel
Transfer-Encoding: chunked
X-Powered-By: ASP.NET
VIA Fiddler:
Status 200 OK
Version HTTP/1.1
Transferred 1.57 KB (1.41 KB size)
Referrer Policy strict-origin-when-cross-origin
Request Priority Highest
Content-Type text/plain; charset=utf-8
Date Thu, 28 Jul 2022 09:01:24 GMT
Server Kestrel
Transfer-Encoding chunked
X-Powered-By ASP.NET

Error 503 Service Unavailable - Varnish Cache

Setup Varnish cache on LAMP
When visiting my website -> www.arintoker.com getting the error below.
Error 503 Service Unavailable
Service Unavailable
Guru Meditation:
XID: 529248319
when I run varnishlog I get the following output
132 FetchError - http first read error: -1 11 (Resource temporarily unavailable)
133 BackendClose - default
132 VCL_call - error
132 VCL_return - deliver
132 VCL_call - deliver
132 VCL_return - deliver
132 TxProtocol - HTTP/1.1
132 TxStatus - 503
132 TxResponse - Service Unavailable
132 TxHeader - Server: Varnish
132 TxHeader - Content-Type: text/html; charset=utf-8
132 TxHeader - Retry-After: 5
132 TxHeader - Content-Length: 418
132 TxHeader - Accept-Ranges: bytes
132 TxHeader - Date: Sat, 27 Aug 2016 20:07:36 GMT
132 TxHeader - X-Varnish: 529248853
132 TxHeader - Age: 17
132 TxHeader - Via: 1.1 varnish
132 TxHeader - Connection: close
132 Length - 418
132 ReqEnd - 529248853 1472328439.180813074 1472328456.191231966 0.000165224 17.010340691 0.000078201
132 SessionClose - error
When I setup Varnish Cache I followed the guide on DigitalOcean(link)
*Let me know what other reports/resources could be helpful for resolving this issue. Thanks in advance for any help!
Old post but I manage to solve this error by increasing the timeout.
sudo nano /etc/varnish/default.vcl
and having the following config settings:
backend default {
.host = "127..0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
Although 600s as timeout is probably too much, you can have much lower setting which can work for you. For further help read this thread.
PS: I am on Ubuntu 14.04.
I guess Varnish can not talk to your backend. Maybe this can help:
http://www.technoreply.com/solving-dreaded-varnish-503-error/
I was actually able to solve this. My website is a WordPress website so it often that the system receives a brute force attack on the /wp-admin panel. But this time I also noticed the same memory and CPU > 90% alerts from New Relic.
So I ran netstat -natp | grep varnishto figure out which IP was attacking me.
then proceeded to permanently block the IP with my server firewall.
This resolved the issue. Hope this helps someone!

Apache2 proxypass does NOT work for POST request

I'm using Apache2 to route incoming requests to backend python flask web service and Splunk web service, there are running on the same server. I need to use POST to upload my file.
Here's my apache proxy setup:
ProxyPass /api/ http://10.68.57.166:5000/api/
ProxyPass / http://10.68.57.166:8000/
The test shows POST request has not been successfully routed, GET request is working fine although, the message says the method is not allowed, because my python flask only allows POST and OPTIONS.
Please help give me some thoughts of how to get it fixed ? very appreciated.
Gent79 tmp $ curl -v -X POST http://10.68.57.166/api/upload
Trying 10.68.57.166...
Connected to 10.68.57.166 (10.68.57.166) port 80 (#0)
> POST /api/upload HTTP/1.1
> Host: 10.68.57.166
> User-Agent: curl/7.45.0
> Accept: */*
>
< HTTP/1.1 400 BAD REQUEST
< Date: Fri, 15 Jul 2016 02:28:28 GMT
< Server: Werkzeug/0.9.6 Python/2.7.9
< Content-Type: text/html
< Content-Length: 192
< Connection: close
<
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p>
* Closing connection 0
Gent79 tmp $ curl -v -X GET http://10.68.57.166/api/upload
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 10.68.57.166...
* Connected to 10.68.57.166 (10.68.57.166) port 80 (#0)
> GET /api/upload HTTP/1.1
> Host: 10.68.57.166
> User-Agent: curl/7.45.0
> Accept: */*
>
< HTTP/1.1 405 METHOD NOT ALLOWED
< Date: Fri, 15 Jul 2016 02:28:41 GMT
< Server: Werkzeug/0.9.6 Python/2.7.9
< Content-Type: text/html
< Allow: POST, OPTIONS
< Content-Length: 178
<
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
* Connection #0 to host 10.68.57.166 left intact*

HAproxy 1.5 fails to proxy properly to backend

I'm puzzled why this FE doesn't seem to connect me to the BE through my HAproxy:
defaults
mode http
log global
option httplog
option dontlognull
source 0.0.0.0 usesrc clientip # transparent proxy mode
frontend fe-kb
bind :8081 ssl crt /etc/haproxy/ssl/ssl-key.pem
default_backend be-kb
backend be-kb
server afnB afnB:1080 check
I get this in HA http log:
Jan 9 17:25:04 localhost haproxy[17266]: <ip redacted>:51396 [09/Jan/2016:17:24:44.544] fe-kb~ be-kb/afnB 31/0/-1/-1/20036 503 212 - - cC-- 0/0/0/0/3 0/0 "GET / HTTP/1.1"
I can connect fine from HAproxy CLI (selinux is disabled):
[root#hapA ~]# telnet afnB 1080
Trying 10.45.69.14...
Connected to afnB.
Escape character is '^]'.
GET / HTTP/1.0
HTTP/1.1 200 OK
Server: nginx/1.9.9
Date: Sat, 09 Jan 2016 16:40:44 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Wed, 09 Dec 2015 15:05:19 GMT
Connection: close
ETag: "5668432f-264"
Accept-Ranges: bytes
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
...
Figured it out, the default route wasn't through my HAproxy and as I was trying to do transparency of the source IPs well ;)
Thanks for watching!

bad request 400 with Telnet

'm trying to use the If-Modified-Since command in Telnet. I want to get a 304 Not modified statut code. I tried this but it don't work, I get a 400 bad request error
telnet lemonde.fr 80
GET /index.html HTTP/1.1
User-Agent: Mozilla/5.0
From: yahoo.com
Accept: text/html,text/plain,application/*
Host: www.lemonde.fr
If-Modified-Since: Wed, 19 Oct 2015 10:50:00 GMT
<linefeed>
I got as a result
HTTP/1.0 400 Bad request Cache-Control: no-cache Connection: close
Content-Type: text/html
You need to define the HTTP port. So try:
telnet lemonde.fr 80
The default telnet port is 23. So you won't be able to communicate with the HTTP server.