views:

49

answers:

2

im Consuming a Soap webservice and im calling a method , i want to get the actual xml response is there is any way to get that ?

A: 

If this is for debugging purposes, you can use a tool like fiddler

vc 74
+1  A: 

Warning: This suggestion works, but since WSE 3.0 is not supported anymore, you might wanna look WCF.

By using WSE 3.0 you can manage xml's that are being sent through web service client and server. To do this you need to change your web.config file, add these lines to the beginning of the file under "configuration" tag

<configSections>
    <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</configSections>

Then after "/system.web" add these lines:

<microsoft.web.services3>
    <diagnostics>
        <trace enabled="true" input="InputTrace.webinfo" output="OutputTrace.webinfo"/>
    </diagnostics>
</microsoft.web.services3>

By doing these you will have InputTrace.webinfo and OutputTrace.webinfo files which containt input and ouput SOAP messages in xml.

Numenor
**NEVER USE WSE**!!! WSE is obsolete and should not be used unless you have no other choices at all.
John Saunders
@Jonh: can you suggest an alternative to log input and output SOAP messages that is not absolute? It would be nice to update the knowledge since WSE is obsolete.
Numenor
@Numenor: are you serious? Have you never heard of WCF?
John Saunders
@Stacker: this is exactly the wrong answer. I strongly suggest you remove the mark as answer.
John Saunders
@John Saunders: ye this answer is for .NET 2.0. By the way the answer is right for .NET 2.0 and it works, why do you think its wrong, it works... it might not be the answer for .NET 3.5 but it certainly is if you are not using WCF.
Numenor
@Numenor: the answer is extremely wrong for any release of .NET, as WSE is obsolete and nearly unsupported. Anyone who takes your suggestion will wish they never had taken your suggestion once they realize that you have caused then to use a technology that is worse than a dead end.
John Saunders