문제

I am trying to dynamically modify XML data in SOAP requests to ASMX services.

I overrided GetWebRequest() method in SoapHttpClientProtocol class in order to read and modify XML data that the RequestStream contains.

The problem is, the request seems to be empty, there is no data in it whatsoever. Is this because the SOAP data hasn't yet been generated and serialized or am I doing something wrong?

도움이 되었습니까?

해결책

What you need is a SoapExtension. You could hook into the SoapMessageStage.AfterSerialize stage in ProcessMessage to modify your soap message. I've done this in the past to add WSSE headers in situations where I couldn't add a dependency on Microsoft's WSE library (since it isn't available for Mono).

Complete tutorial here: http://msdn.microsoft.com/en-us/magazine/cc164007.aspx

GetWebRequest is too early for your purpose, GetWebResponse is too late.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top