Get WSE WSDL

I recently did some work with WSE2 XML Messaging and KerberosToken. There were times where i just quickly needed the auto-generated WSDL of my SoapService (same as WSE2WSDL but without creating the proxy class)…this code was my friend:

using System;
using Microsoft.Web.Services2;
using Microsoft.Web.Services2.Messaging;

public
class GetWsdlProxy : SoapClient
{
 
public GetWsdlProxy(string TargetUri) : base(new Uri(TargetUri)) {}

  public string GetWsdl()
  {
    SoapEnvelope env =
base.SendRequestResponse(“http://schemas.microsoft.com/wse/2003/06/RequestDescription”, new SoapEnvelope());

  return env.Body.InnerXml;
  }
}

 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment