0

I'm coding a .Net web service that will replace an old one. In order not to break existing clients, I must not change the interface. That means no WSE to access this web service.

The "old" web service was accessing directly to database.

The "new" one don't access database directly, it use another web service to do that. That other web service is used by a some other applications already.

So, basically, I'm writing a (public) web service in front of another (private) web service.

Let call the new public web service "Front", and the existing private web service "Back".

The problem is that "Back" requires WSE2 authentication, while "Front" needs to be reachable without WSE2.

How do I configure that in web.config? I have the microsoft.web.services2 section and and soapExtensionTypes sections like that:

<microsoft.web.services2>
  <diagnostics>
     <trace enabled="true" input="InputTrace.log" output="OutputTrace.log" />
  </diagnostics>
  <policy>
     <cache name="policyCache.config" />
  </policy>

  <webServices>
     <soapExtensionTypes>
        <add type="Microsoft.Web.Services2.WebServicesExtension, Microsoft.Web.Services2, Version=2.0.0.0,  [.....] />
     </soapExtensionTypes>
  </webServices>

I need those to conform to "Back", but then the clients calling "Front" need to conform to WSE2 too, witch I do not want.

Any help?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Johnny5
  • 6,664
  • 3
  • 45
  • 78
  • WSE is obsolete. WSE2 is even more obsolete. Do not use it. Any clients dependent on WSE2 need to be updated immediately, as WSE2 is not only obsolete - it also uses non standard protocols. – John Saunders Jun 23 '11 at 14:35
  • Well, thank you but that's not the question, and I'm not the one making these decisions. But what do you suggest, WSE3 ? – Johnny5 Jun 23 '11 at 14:48
  • No, not WSE at all. Use WCF for all new web service or client development. – John Saunders Jun 23 '11 at 15:06
  • Since WCF stands for "Windows Communication Foundation", I doubt this is standard protocols. But still out of subject. – Johnny5 Jun 23 '11 at 15:22
  • WCF is the replacement for all other web service technologies from Microsoft, and absolutely supports the standard WS-* protocols. WSE was an interim product to gain such support on top of ASMX web services. The protocols implemented by WSE2 were not yet final. You will have increasing trouble using WSE2 because some of the protocols it uses were replaced with the final versions. WCF implements the final versions and is designed to stay up to date (which WSE could not do). – John Saunders Jun 23 '11 at 15:32

1 Answers1

2

Finally found the answer myselft, it's in the policy file. I had to define different endpoints for different policies. Something like that :

<?xml version="1.0" encoding="utf-8"?>
<policyDocument xmlns="http://schemas.microsoft.com/wse/2003/06/Policy">
  <mappings xmlns:wse="http://schemas.microsoft.com/wse/2003/06/Policy">
     <!-- calls to this web services will use wse -->
     <endpoint uri="http://the.service.that.needs.wse2.asmx">
        <defaultOperation>
           <request policy="#Sign-Username" />
           <response policy="" />
           <fault policy="" />
        </defaultOperation>        
     </endpoint>
    <!-- no policies for other endpoints -->
    <defaultEndpoint>
      <defaultOperation>
      </defaultOperation>
    </defaultEndpoint>
  </mappings>
  <policies [...]>
    [...]
  </policies>
</policyDocument>

Now I would like to find how to dynamically configure the endpoint uri, but that will be possibly another question.

Johnny5
  • 6,664
  • 3
  • 45
  • 78
  • I doubt that WSE can dynamically configure endpoints, but good luck. You should get over your skepticism about WCF, considering that it can do exactly what you're looking for. BTW, it's been out for almost five years now. – John Saunders Jun 23 '11 at 15:33
  • I'll probably check WCF next time I build a web service from scratch, but that's just not an option by now to change existing web services. – Johnny5 Jun 23 '11 at 15:39