URGENT: Method with WCF service address as parameter?
-
Hi, I have a little bit strange task that never saw so far. The solution contains 2 projects: Project 1: Client application that calls some external WCF service as following:
ExtService client = new ExtService();
// The address of WCF service that I should write in Project 2
string Url = "http://MyHost/Service.svc";
string param1 = "abcd";string content = client.Method1(Url, param1);
Project 2: WCF service that should be at this address:
and it should look as following:
public Message SetData(Message requestXml)
{
// Do something with requestXml, which is actually
// SOAP XML string created in Project 1
}Message is raw SOAP message. As you can see Method1 in Project 1 get the address of my service in Project 2, doing something and getting some SOAP XML string as a result of that operation. I should get that SOAP XML in some way in my WCF service. This is unusual scenario for me and I'm wondering if this is possible to make it work? The key point is how can I get that SOAP XML in my WCF service?
-
Hi, I have a little bit strange task that never saw so far. The solution contains 2 projects: Project 1: Client application that calls some external WCF service as following:
ExtService client = new ExtService();
// The address of WCF service that I should write in Project 2
string Url = "http://MyHost/Service.svc";
string param1 = "abcd";string content = client.Method1(Url, param1);
Project 2: WCF service that should be at this address:
and it should look as following:
public Message SetData(Message requestXml)
{
// Do something with requestXml, which is actually
// SOAP XML string created in Project 1
}Message is raw SOAP message. As you can see Method1 in Project 1 get the address of my service in Project 2, doing something and getting some SOAP XML string as a result of that operation. I should get that SOAP XML in some way in my WCF service. This is unusual scenario for me and I'm wondering if this is possible to make it work? The key point is how can I get that SOAP XML in my WCF service?
Are you looking for the SOAP message at client side? If yes, use
IClientMessageInspector
. Implement this interface in your own class. Then you need to implementIEndPointBehavior
interface. In theApplyClientBehavior
method, add this interceptor to clientRuntime object. In theBeforeSendRequest
method in interceptor class, you can get the request as string."Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[^]