soapclient30 replacement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • holder25@hotmail.com

    soapclient30 replacement

    Folks, What is the recommended replacement for the SoapClient30 class
    (C#)?
    The MSDN website states the SoapToolkit SDK 3.0 has been deprecated and
    I should be using the support in the .NET framework.

    That is fine with me, but I am not able to early bind to the the WSDL
    reference at design time. I am trying to do something like the snippet
    below:
    ---------------------------------------------------------------------------

    SoapClient30 sc = new SoapClient30();
    string translateText=t extToTran.Text;
    string wsdl=null;
    try
    {
    if(wsUri==null)
    throw new Exception("Plea se Discover the service first");
    if((new Regex("(wsdl)$" )).IsMatch(wsUr i))
    //check if it's the real WSDL
    wsdl=wsUri;
    else
    wsdl=wsUri+"?ws dl"; //otherwise append WSDL to the service

    sc.MSSoapInit(w sdl, "piglatin", "piglatinSoap", "");
    //specify the service name and port name
    Type type =sc.GetType();

    object []args = {translateText} ; //specified service accepts
    //just one argument (textToTranslat e)
    Response.Write( "Invoking method using MS SOAP SDK ...");
    object ox = type.InvokeMemb er("toPigLatin" ,
    BindingFlags.In vokeMethod,null ,sc,args); //Dynamic Invocation No
    //Proxy class, no web reference
    Response.Write( "Translated String "+ox.ToString() );
    }
    catch(Exception sEx){Response.W rite("Exception occurred "+
    sEx.Message);}} }

    -----------------------------------------------------------

    If I should not be using the SoapClient30 class, what should I replace
    it with?
    thanks for any advice,
    bob

Working...