Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. URGENT: Method with WCF service address as parameter?

URGENT: Method with WCF service address as parameter?

Scheduled Pinned Locked Moved WCF and WF
wcfxmlquestioncsharp
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tesic Goran
    wrote on last edited by
    #1

    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:

    http://MyHost/Service.svc

    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?

    D 1 Reply Last reply
    0
    • T Tesic Goran

      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:

      http://MyHost/Service.svc

      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?

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      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 implement IEndPointBehavior interface. In the ApplyClientBehavior method, add this interceptor to clientRuntime object. In the BeforeSendRequest 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[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups