I have deployed an paypal ipn service on my local machine on port 80.From this ipn service i am hitting another service which on asp.net(iis),but http post data is getting being truncated on reaching the iis server.And if i do the the same from another port except 80,it is working without any issue.I am not getting ,why my http post request data is not reaching there just because of using port 80.
Related
I am supporting another vendors legacy application.
This is a J2EE application that runs on Glassfish v3.1.2.2. It has a REST API implemented using JAX-RS. I have limited visibility to the application and source.
The symptoms are:
make an HTTP request to a REST API
application has its own auditing system, this shows a successful request
no errors in GF logs
GF access log notes the request
0 bytes are returned from the request to the caller
This happens for both remote calls as well as from calls made using curl on localhost.
If we make the same requests to a different port over HTTPS they succeed. We are reluctant to move the calls to that other port without knowing a root cause. These failed intermittently last night and now fail constantly today.
A packet capture of the request shows:
- TCP overhead/handshake
- A GET request
- A single ACK from the application back to the caller
- then nothing after that
What would cause Glassfish v3 to successfully handle and process an HTTP request but return no data?
Is there a mechanism in Glassfish v3 to flush or reset an HTTP listener and its associated thread pool?
Since this happens on a curl request on the same server to localhost I think I can rule out the network being the issue.
The ports being used communicate directly with Glassfish. There is no proxy (like Apache or Nginx) between the caller and the app server.
Are there logging or monitoring settings I should be enabling in Glassfish to observe what the HTTP listener is doing relative to the application and the network stack?
I have obfuscated some examples that show the symptoms:
Glassfish Access log:
"0:0:0:0:0:0:0:1" "NULL-AUTH-USER" "25/Oct/2018:11:21:02 -0500" "GET /api/obfuscated/by/me HTTP/1.1" 200 9002
Curl response for that same call:
* Trying OFBBFUSCATED
* Connected to hostname.local (OFBBFUSCATED) port 11080 (#0)
> GET /api/obfuscated/by/me HTTP/1.1
> Host: hostname.local:11080
> User-Agent: curl/7.43.0
> Accept: */*
> Authorization: Basic asdfdsfsdfdsfsdafsdafsdafw==
>
* Empty reply from server
* Connection #0 to host hostname.local left intact
UPDATE I changed a timeout setting for the HTTP network listener. I bumped it from 30 to 35 seconds because I was seeing a packet capture where the app was sending a FIN after 30 seconds. After making this change it started to work again.
It is not clear if this somehow flushed or reset something or if I had some kind of race condition.
The apparent root cause was high I/O on the system running these services. The applications normally used 50MB/sec, a new process drove that usage to 250MB/sec. Once the I/O problem was resolved all of the HTTP errors went away and haven't come back.
I am new to developing client/server interfaces.
I have a client facing app which sends a GET request to server based on an action. I currently have this running on the localhost setup by apache. I created my own directory in /var/www and made changes to the config files.
I have a server running that I have written in Java. It is listening on port 8888. Now when I type http://localhost:8888 - my server crashes with a NumberFormatException For input string: "Host: localhost:8888"
What is it I need to do in order to run my client on the specific port? Why am I receiving a get request when I haven't sent anything?
I've tried searching for similar questions and made edits to the config files by changing the default port 80 to 8888 both in ports.conf and 000-default.conf followed by a restart. This however causes both localhost and localhost:8888 result in nothing.
It seems that your server is treating the HTTP headers wrong: when you enter http://localhost:8888 in your browser, you will receive (among other things) a header like this:
Host: localhost:8888
Apparently, you server is trying to convert this line into a number.
I just have a jsp file, print
request.getRemoteIp();
request.getRemotePort();
And I can get the real client ip, but the port is always wrong.
The Server Environment is IBM Websphere and IBM HTTP Server (IHS60)
From the iptrace, I get the packet data..
From the Client to Server, the port is 13944 to 80 (http port is 80). So the client port is 13944.
Then via HTTP, in the jsp, I invoke an API on another server, the port is 48186 to 9082.
Actually,
request.getRemoteIp(); I really get the client ip.
but
request.getRemotePort(); I get the port number is 48185, it seems be IHS port.
How can I get my real client port, please?
Thanks very much.
The error I am getting are in a few forum posts, but all the scenarios seem slightly different than mine.
I am writing a JAX-WS web service client to communicate to a soap-based web service that uses basic authentication (http level only). I generated the client using wsimport on the wsdl.
There are two versions of the web service available to me for testing:
Port 8080 - no authentication
Port 80 - requires basic http level authentication
What the web service does:
This is just a simple web service that lets me send an base64 encoded xml payload into it.
I verified the following:
I can correctly send both web services (80/8080) using SOAPUI from my localhost
I can correctly send both web services using a test JAVA application from my localhost
What fails:
As soon as I try to deploy my web service client as a .war on jboss5.1... only the port 8080 web service works. When I try the web service on port 80, I get this error.
10:36:51,467 ERROR [CommonClient] Exception caught while (preparing for) performing the invocation:
javax.xml.ws.soap.SOAPFaultException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:84)
at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:107)
The Core Code for my test client:
Service service = Service.create(url, qname);
ImportLoan port = service.getPort(ImportLoan.class);
BindingProvider bp = (BindingProvider) port;
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, properties.getProperty("username"));
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, properties.getProperty("password"));
ImportLoanRequestType requestType = new ImportLoanRequestType();
requestType.setData(strEncodedPayload);
ImportLoanResponseType responseType = port.importLoanApp(requestType);
What I'm Hoping For
I just need some ideas to triage here. I assume I am getting some invalid SOAP response back that cannot be parsed correctly. I just find it odd that it only happens when sending the service from JBoss (my app server), so it must be something on my end. SOAPUI works fine. The exact same code written in a standalone test.java file works fine as well.
Update... later in the evening
Of course I would find the answer the same day I ended up posting the question. I watched the http traffic and realized the HTTP500 error response (with the soap eof prolog error) came back after half the data was sent. Apparently JBoss chunks the data. That worked fine against the 8080 service, but the port 80 service didn't support chunking for some reason. I assumed it was an authentication error, but appears to be that the web service doesn't support chunking. I modified the standard-jaxws-client-config.xml (jbossws.deployer/META-INF folder) on my server. Set the chunksize from 2048 to 0, and voila... problem solved. Hope this helps somebody else out there someday.
I was just curious , currently the address in my WSDL SOAP File is
<wsdl:port name="MyPort" binding="tns:MyBinding">
<soap:address location="http://localhost:87/SomeMethod"/>
</wsdl:port>
Now since SOAP response is passed along with the HTTP response , Will i have to change the port from 87 to 80 while deploying the service ??
(The reason why i think this should be done because since SOAP is being tagged along with HTTP and HTTP is only available at port 80
I would appreciate it if someone could explain how this would work I know i am wrong here... )
Also Incase of rest i am testing my REST application using
curl http://localhost:6517/JerseyServer/rest/contacts
since REST runs over http ? How is it running over 6517 port ?? Is Tomcat acting as a proxy ? I am using Jersey??
Http is a protocol. You can run it on any available port, it does not have to be 80 but 80 is just the default port used for http.
It is possible to run any service on any port--it's a matter of telling the service/application which port to listen to. 80 is the default port for HTTP. You could run email on ports 12345, HTTP on 443, FTP on 80, and HTTPS on 21... since these are not the default ports for the protocols, you will need to explicitly specify the port to connect to.
As fas mentioned, default ports are just a convention to avoid having to specify what port to go to when visiting google.com (or stackoverflow.com).