I am working on Apache Tomcat 6 and Axis2 for web services.
I want to monitor SOAP messages which are exchanged with client and server and save the data into a file.
How can I do it?
Storm is a test client for SOAP services.
To capture the traffic between your client and the server, you could use a proxy like Fiddler.
There is an example in modules samples (in samples/userguide) describing this case.
Personally I found simpler just to add a logging code in my generated <...MessageReceiverInOut> class. Just dumping out input/output envelopes for my particular service.
Related
In the beginning I have to warn that I'm not familar with web services, I want to simply generate what I need, and learn the basics of usage.
I recived .wsdl and .xsd files (stored localy). I have generated java code using Apache CXF WSDL2Java tool (I have generated a client). I also have an endpoint (as url without '?WSDL' on the end - whatever this endding means). How can I set this endpoint?
If I use:
Blachblach_Service ss = new Blachblach_Service(new URL(recived_url));
Blachblach port = ss.getBlachblachSOAP();
I get an exception. When I use soapUI to send XMLs to web services, everything works fine.
At first you need to initialize your web service client. See my answer over here how to make this work.
?WSDL ending means that you can see the web service WSDL file in your browser, you can access the web service through SOAP protocol by providing it with some valid request.
If you need to create your web service client using Spring. Here is very good example how to do this.
Yes usually we set params like end point URL on Service class object and retrieve port from it. and from port we invoke web service methods. can you please give details of exception you are getting?
I'm using WCF services in the client application for transfering data from client to server and vice-versa. I'm looking for a mechanism to log the data sent to server into the log file on client machine. I looked into the WCF library but could not find any code which serializes the WCF requests. Logging no issues, I use N-Log for that but I don't find any built in function which gives the webrequest data.
My question is, is there any built in support for getting the webrequest details?
The built in option is called Message logging but this option uses its own way to log messages using standard .NET trace listeners.
If you want custom message logger you have to implement your own logging endpoint behavior with IClientMessageInspector.
I need to capture and run realtime analysis on messages being exchanged between various web services implemented in Java and client apps. The server code and config can not be modified and is hosted on various servers.
Is it possible to build a proxy layer that will take all calls from the client app and route them to actual web services.
So it needs to do the following:
Accept a config file containing endpoints for various web services that need to be proxied
For each end point, generate a proxy URL
The client apps will point to these proxy URLs
The proxy layer will listen to traffic on these proxy URLs, and route them to real end points.
Track all SOAP traffic in between the client and services and run the necessary analysis.
I considered SoapUI but it does not seem to provide enough control that I need for realtime analysis.
You should start with WCF Routing service. Once you have working communication you can add some custom message processing through custom behaviours or channels to grab SOAP messages and do your analysis.
I am developing a wcf service (basicHttpBinding) that should also be consumed by non .net clients (e.g. Java clients). But now I wonder how the client can define his client config file. Or is this file only needed for .net-clients? (I am thinking of configurations like maxReceivedMessageSize or maxItemsInObjectGraph for example).
Each development platform (call it as you want: SOAP stack, Framework, API) has its own way to configure communication. You don't need to bother with it. You just need to expose correct WSDL and client's developer will be responsible for configuring the client application based on his needs.
If you want to extend documentation of your service in WSDL you can use wsdl:documentation. WCF doesn't offer it by default but you can use this technology sample to extend WCF. You can use such documentation for example to describe that service operation can return large amount of data. Another approach to add wsdl:documentation is using WCF Extras.
From the sound of it, the client shouldn't have access to those configuration options. For instance, why should a client to the WCF service be able to specify the maxReceivedMessageSize?
What you probably want to do is define these configuration options on the server-side. If a client makes a call and there is a conflict with one of your options (i.e. the client exceeds maxReceivedMessageSize), you'll want to throw a SoapException back to the client.
If you want to let the client have access to the configuration settings before he or she sends a request, you can always implement a simple web service method that sends back the values.
I have a WCF service that I pass a lit of objects down from the server to the client, what I would like to do is to know what exactly is getting passed down to the client.
How can I see the unecrypted serialized payload that is sent over the wire?
WCF has very extensive tracing support which allows you to capture and later view and analyze all messages going over the wire.
Check out the MSDN docs and other sources for great information:
Configuring WCF Tracing
WCF Service Trace Viewer Tool
WCF Tracing FAQ
WCF Tracing and Message Logging
Use Fiddler on the client machine. It acts as a local proxy and allows you to inspect the HTTP traffic.
Note that there are some limitations with HTTPS traffic, but since you are testing your own WCF service, you can temporarily switch to HTTP for inspection of the packets payload, even if you intend to deploy it as HTTPS in production.