1

I have an ASP.NET asmx web service running on IIS.

A client is trying to consume the service, and I can see (after a rebuild) that the Global.asax Application_Start is getting hit from his attempt... but the specific function is not getting hit.

This link Getting RAW Soap Data from a Web Reference Client running in ASP.net gives a "solution" for what I'm trying to do, but it didn't work.

I placed the above link's suggestion in my web.config, but no log file is generated even when I successfully call the service myself.

Community
  • 1
  • 1
adam
  • 2,930
  • 7
  • 54
  • 89
  • 1
    What do you see in [Fiddler](http://fiddler2.com/fiddler2/)? – John Saunders Mar 27 '13 at 19:59
  • Nothing... because unfortunately I don't have authority to install a packet monitor tool on this server, since it transmits sensitive information. – adam Mar 27 '13 at 20:10
  • I mean use Fiddler from a test machine to see what gets sent _to_ the server and what the response is. – John Saunders Mar 27 '13 at 20:11
  • I'm sure you were aware that ASMX is a legacy technology, and should not be used for new development. WCF should be used for all new development of web service clients and servers. One hint: Microsoft has retired the [ASMX Forum](http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/threads) on MSDN. – John Saunders Mar 27 '13 at 20:11
  • Yes I have begun research of WCF services... it's not going as smoothly as I had hoped but we are well on our way. (of the 12 programmers here, 10 code in RPG... so needless to say, technology moves slowly here =p – adam Mar 27 '13 at 20:15
  • 1
    Keep in mind that you only need to worry about the features of WCF which are equivalent to those in ASMX. Also, be sure to use .NET 4.0 or above, as WCF configuration is much simpler there. – John Saunders Mar 27 '13 at 20:19

1 Answers1

0

If you're looking to trap request/response on the client side, you can connect to ASMX webservices using WCF-style generated proxies just by using a "Service Reference" rather than a "Web Reference", then follow the WCF tracing you linked to for raw data, as well as using System.ServiceModel.MessageLogging for SOAP-specific stuff. Keep in mind that:

  1. the maxdatasize attribute for System.Net will truncate the data logged, so pick a bigger number if your request/responses are larger. Use maxSizeOfMessageToLog with System.ServiceModel.MessageLogging.
  2. remove the raw ascii/hex and only show the xml with tracemode="protocolonly" in the <source name="System.Net"> element

But if you want to trap requests on the server side (i.e. from within your ASMX webservice) you can try the suggestion here, which is to just read the data out of the request stream in Application_BeginRequest and probably also the response stream in Application_EndRequest.

Community
  • 1
  • 1
drzaus
  • 24,171
  • 16
  • 142
  • 201
  • And this is another good link: https://msdn.microsoft.com/en-us/library/aa702726(v=vs.110).aspx – drzaus Jul 24 '15 at 14:41