tcp/ip monitor - eclipse

in eclipse, i have a weblogic server running, and a j2ee application deployed to it.
the application is serving on port 7001.
i want to hook the monitor up to the application, i do not know what ports to use.
i think i know what to put in for the Host Name (localhost:7001), but not sure of what to use for type and Local Port. in the proeferences, what is meant by Local Port.
does it matter if i start the monitor before or after the application is running?
my goal is the watch the traffic as i login, from my local machine via a browser, and surf to other parts of the application.
thanks for any help

if your original url for webservice is say http://abc.xyz:5674/ws/wsdl:linkaction
then do these settings for tcp/ip monitor:
local monitoring port:8888
hostname:abc.xyz
port:5674
type:http
Start it
And change the webservice url to "http://localhost:8888/ws/wsdl:linkaction"
Run your client.java as java application
so your request will go through tcp/ip proxy and you can see the soap messages.

The monitor basically acts as a proxy. The local monitoring port is the port you will send requests to the monitor on. It can be any free port (7002, for example).
The host name, port, and type describe what you want the monitor to proxy to. In your case, it would be localhost, 7001, and HTTP.
Then, you would use your browser to access localhost:7002, and the proxied requests and responses would be displayed in the monitor.

Normal SOAP envelope flows
1. Client ----> SOAP envelope ----> Server:9999
Server:9999 ----> SOAP envelope ---> Client
To intercept SOAP envelope, you can host another server (“TcpMonitorServer”) in between client and server, see new flows :
Client ----> SOAP envelope ----> TcpMonitorServer:8888
TcpMonitorServer:8888 --> SOAP envelope ---> Server:9999
Server:9999 ----> SOAP envelope ---> TcpMonitorServer:8888
TcpMonitorServer:8888 ----> SOAP envelope ---> Client
Source

Related

Application Request Routing (ARR) to save Data in nodes (in Web Farms)

I Created Socket Client Server Application.
Socket Server in MVC Application and Deployed on IIS port 80.
Socket Server Listener is 88. (Note: Application on IIS port and socket listener is different because port 80 is already in use and in block range and cant use twice at a time.)
The Client Server Communication work Fine.
Problem Statement
Now I want Socket Client Application Send Data/request on ARR port, ARR forward it to Node (in web farm), Node Save the Data/ or Socket Listener respond back.
My ARR Environment is:
ARR Machine (Routing Request)
Node1 (Application (Socket Listener))
Client Machine (Client Application)
How to make it Possible?

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.

Freeswitch server getting INVITE request in ngrep but nothing in fs_cli

I am trying to route the call from opensips server to freeswitch server. My freeswitch server is actually a container which i have created using 'lxc/lxd' and it is running CentOS.
When I route the call from opensips server to freeswitch server container i got the INVITE requests sip log in 'ngrep' but getting nothing in Freeswitch log as in nothing in fs_cli and my call is failing with the disposition 'SIP 408 - Request Timeout'
I have tried with routing the call from opensips server to other freeswitch server which is actually having a physical ip and not the container server and when I tried that, i am able to get the logs in freeswitch as in fs_cli.
Sip profile parameters auth-calls, auth-all-packets, aggressive-nat-detection set to true, there is no firewall or iptable rule between opensips and freeswitch servers. i can access the osips server from freeswitch server and vice versa.
So, what am i missing here. please suggest me something.
In fs_cli, sofia status will show you on which IP address the SIP profile is bound. Probably it's not the address you're sending invites to.
Your freeswitch server is not listening on the port with interface on
which you are sending. Just check out freeswitch profile on which
port and interface they are listening.

Outbound HTTP request from bluemix runtime

can a NodeJS application running on Bluemix make outside HTTP requests ? What address does the receiving end see ? There is a proxy that stops traffic from unknown servers on the other end, so we need to declare the origin IP. What is it for Bluemix ?
Any application running on IBM Bluemix can make outgoing HTTP requests (or any other outgoing TCP/UDP request).
Outgoing requests will come from the IP address of the DEA running the container with this application instance. If you have multiple instances, requests can come from any of these instances.
For details on the environment variables exposing these parameters, see this page:
http://docs.run.pivotal.io/devguide/deploy-apps/environment-variable.html
Yes a NodeJs application running on Bluemix can make outgoing requests.
The receiving end will see the IP address of the Bluemix gateway rather than the IP address of the DEA running the container. You can work out what the IP address is by doing a nslookup of your the app url, but the IP address(es) used is/are not currently documentation so could change.

Fiddler for website running on remote machine

I need to monitor a http request and response for web site running on remote web server. The web server makes lot of web service call and would like to trace them.
If the web site was running locally, Fiddler traces every web service call request and provides me with a report. Could someone please help me with how the same is possible
*e.g.
If the web application is running locally and calls two web services fiddler shows the total time on statistics. However, if the web application is running on web server hosted on different web server hosted internally (intranet) and I ran fiddler on my machine, I don't get the statistics for each web service call. All I can see is the total time for the aspx page.*
So question is how (if possible) can I trace the statistics of each web services invoked by web application that's running on different machine and fiddler is running on my machine.
Thanks.
You could always use WireShark http://www.wireshark.org/ to catch all the packets, if you are on the same network as the server, that is.
Say you're running a website on port 80 of a machine named WEBSERVER. You're connecting to the website using Internet Explorer Mobile Edition on a Windows SmartPhone device for which you cannot configure the web proxy. You want to capture the traffic from the phone and the server's response.
0.)Start Fiddler on the WEBSERVER machine, running on the default port of 8888.
1.)Click Tools | Fiddler Options, and ensure the "Allow remote clients to connect" checkbox is checked. Restart if needed.
2.)Choose Rules | Customize Rules.
3.)Inside the OnBeforeRequest handler, add a new line of code:
if (oSession.host.toLowerCase() == "webserver:8888") oSession.host = "webserver:80";
5.) navigate to http://webserver:8888
Requests from the SmartPhone will appear in Fiddler. The requests are forwarded from port 8888 to port 80 where the webserver is running. The responses are sent back through Fiddler to the SmartPhone, which has no idea that the content originally came from port 80.
You can setup Fiddler in your machine and set it as a proxy in the web application you want trace. Easy inside a network, not so easy accross the interwebs.