Logging soap requests in a web service client

G

Guest

Hello, I want to log the soap requests (and responses) in my C# webservice
consumer. I have extended my class with the SoapExtension, but the debugger
don't step into the overridden methods. The WSClient class is running as part
of a console application as administrator.

Why doesn't the debugger step into my methods?
Here is my code.

Thank You
Joachim

public class WSClient : SoapExtension{

public WSClient() {
// ...
}

public string callMethod() {
WebReference1.Service1 myService = new
WebReference1.SSODivaServiceService();
string myValue = myService.getResult();
return myValue;
}

public override void ProcessMessage(SoapMessage message){
string mess = message.ToString();
}

public override object GetInitializer(System.Type type){
return @"C:\temp\log1.txt";
}

public override void Initialize(object o){
string name = o.ToString();
}

public override object GetInitializer(LogicalMethodInfo methodInfo,
SoapExtensionAttribute attribute) {
return @"C:\temp\log2.txt";
}

}
 
G

Guest

The soap extension will only be fired if you're invoking the service via
soap, not via http get. If you use the browser test form to invoke your
method then you're using http get, not soap, so you'll need another client.

Try to create a simple ASPX page. That should work.

Markus
 
G

Guest

Hi, what kind of client do i need to invoke the service via soap? Or is there
another way to log the soap requests when using http get?

Thank you
Joachim
 
Joined
Nov 12, 2013
Messages
2
Reaction score
0
Hi,

Use Soap Extensions to log the outgoing and incoming XML.

You must add the SoapExtension attribute to the proxy class of the Web Service

Look at this site, that explain how presicion as using SoapExtension,
hope will be helpful. :thumb:

www . systemdeveloper . info / 2013 / 11 / trace - soap - requestresponse-xml-with. html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top