0

I've spent a while looking at this but am struggling to get any useful answers.

Basically I have a SoapHttpClientProtocol that I've compiled from a WSDL previously. I then get the MethodInfo for my particular method from the clientProtocol and Invoke it using the standard Invoke method.

What you get back is just the response from the web service cast as an object. What I want to do is get the actual SOAP response that is passed back so I can get into the actual XML. I have seen a non-thread safe way of doing this but that is no help in this case. Does anyone know a way of doing this. Maybe some form of proxy?

Would be extremely grateful if anyone could help.

Assembly assembly = GetLoadedAssembly(@"C:\Assembly.dll");
SoapHttpClientProtocol instanceType = (SoapHttpClientProtocol)assembly.CreateInstance("MyMethod");

MethodInfo method = instanceType.GetType().GetMethod(methodName);
object[] objParameters = {"a parameter"};
object response = method.Invoke(instanceType, objParameters);
4

1 に答える 1

0

このリンクは役に立つかもしれません:

http://orbinary.com/blog/2010/01/getting-the-raw-soap-xml-sent-via-soaphttpclientprotocol/

提供されている例は、発信リクエストを取得するためのものですが、レスポンスにも適用できるようです。

それが機能しない場合 (反映しているため)、おそらくこのメソッドは SoapExtension を追加するために機能する可能性があります。

http://blog.gatosoft.com/2005/07/31/ProgramaticallyRegisteringSoapExtensionsRedux.aspx

Microsoft には、SoapExtension 自体の例があります。

http://msdn.microsoft.com/en-us/library/bb552923(VS.90).aspx

于 2011-02-04T00:01:42.590 に答える