BUG: ???? ???? ?? ???????? ?? ???? Soapsuds DLL ???? ??????? ??????? ?? ???? ?? ??? ???????

?????? ????????? ?????? ?????????
???? ???????: 828987 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

??? ??? ???? ?? ?????? DLL ???? ?????? Soapsuds (Soapsuds.exe) ???? ?????? ??????? ??????? ?? ???? ?? ??? ???????. ?? ????? ????? ??? ?????? ?????? ????? ???????:
??????? ??? ??????: System.Runtime.Remoting.RemotingException: ??? ??? ?????? ??? soap: TestClass http://schemas.microsoft.com/clr/nsassem/EchoExeTest/ServerExe%2C%20Version%3D0.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull. ???? ?????? ??????: ?? System.Runtime.Remoting.Activation.ActivationListener.Activate(IConstructionCallMessage ctorMsg) ?? System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) ?? System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

???? ??????

??????? ?????? ??? ??? ??????? ?? ???? ??? ?????? ? ???? ??????? ???????:
  1. ????? ????? "?????? ??????? ?? ????" ?????? ?? ?????? ???????? ????? ??????: soapsuds
    soapsuds -url:<ServerUrl?wsdl> -oa:serverexe.dll
  2. ????? ???? ??????? ?? ????.
    1. ????? ??? ?????? ???????? ????? ??????: soapsuds
      soapsuds -url:<ServerUrl?wsdl> -gc
    2. ???? ??? .cs ???? Soapsuds.exe ????? ????? SoapType ?? ????? ??? ?? ????? ??????.
    3. ??? ?????? ?????? ?? ?? ?????? Soapsuds.exe.

      ?????? ??? ?? ??? ????? ???? ??????? ?? ???? "? ???? ?????? ??? Soapsuds.exe ?? ?? ???? ?????? ????????? ???????? ??????.

?????

???? Microsoft ?? ??? ??? ?? ?????? Microsoft ??????? ?? ????? ??? ???????.

??????? ????

????? ????? ????? ???????

  1. ?????? "???????" ?????? ??? ???. ?? ???? ???????? ???????? ??????? ?? ?????:
    <configuration>
      <system.runtime.remoting>
        <application name="ServerExe">
        
          <channels>
            <channel port="9998" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting,Version=1.0.5000.00, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
              <serverProviders>
                   <provider ref="wsdl" metadataEnabled="true" remoteApplicationMetadataEnabled="true" />
                   <formatter ref="soap" typeFilterLevel="Full" />
                   <formatter ref="binary" typeFilterLevel="Low" />
              </serverProviders>
            </channel>
            <channel port="9999" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting,Version=1.0.5000.00, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
          </channels>
       </application>
      </system.runtime.remoting>
    </configuration>
  2. ?? ???? ????? ???? C:\ServerChannels.config.
  3. ?????? "???????" ?????? ??? ??? ????. ?? ???? ???????? ???????? ??????? ?? ?????:
    <configuration>
      <system.runtime.remoting>
        <application>
    
          <service>
            <activated type="EchoExeTest.TestClass, ServerExe" />
          </service>
    
        </application>
      </system.runtime.remoting>
    </configuration>
    
  4. ?? ???? ????? ???? C:\ServerCao.cfg.
  5. ?????? "???????" ?????? ??? ??? ????. Paste the following code in the file:
    using System;
    using System.Runtime.Remoting;
    using System.Runtime.Remoting.Metadata;
    using System.Runtime.Remoting.Metadata.W3cXsd2001;
    
    namespace EchoExeTest{
        [Serializable]
        public class testObject 
        {
            public int x;
            public int y;
        }
        [Serializable]
        public struct testStruct
        {
            public int x;
            public int y;
        }
        public class Server {
    
            public static int Main(string [] args) {
        
                Server servObj = new Server();
                servObj.Initialize(args);
                System.Console.WriteLine("Press ENTER to exit.");
                System.Console.ReadLine();
                return 0;
            }
    
            public void Usage() {
                Console.WriteLine(" Usage : ServerExe -chan:channel.config -mode:mode.config");
            }
    
            public  int Initialize(string[] args) {
                int ret=0;  
    
                if (args.Length == 0) 
                    Usage();
                for (int i=0;i<args.Length;i++) {
                    if (
                        String.Compare(args[i],"HELP", true) == 0 ||
                        String.Compare(args[i],"?", true) == 0 ||
                        String.Compare(args[i],"/h", true) == 0 ||
                        String.Compare(args[i],"-h", true) == 0 ||
                        String.Compare(args[i],"-?", true) == 0 ||
                        String.Compare(args[i],"/?", true) == 0
                    ) {
                        Usage();
                        return -1;
                    }
    
    
                    String arg = args[i];   
                    String value = null;
    
                    if (args[i][0] == '/' || args[i][0] == '-'){   
                        int index = args[i].IndexOf(':');
                        if (index != -1) {
    
                            arg = args[i].Substring(1, index-1);
                                //Make sure that a colon (:) is not the last character.
                            if (index == (args[i].Length - 1))
                                throw new Exception("Argument cannot be empty -> " + args[i]);
                            value = args[i].Substring(index+1);
                        }
                        else        
                            arg = args[i].Substring(1);     
                    }
    
                    //Process the input sources.
                    if (String.Compare(arg, "chan", true) == 0) {
                        RemotingConfiguration.Configure(value);
                    }
                    else if (String.Compare(arg, "mode", true) == 0) {
                        RemotingConfiguration.Configure(value);
                    }   
                }   
                ret=100;
                return ret;
            }
    
        }
    
        
        public class TestClass : MarshalByRefObject {
        
            public int EchoInt(int intval) {    
                Console.WriteLine("Method Called");
                return intval;
            }     
            public string EchoString(string strval) {    
                Console.WriteLine("Method Called");    
                return strval;
            }
            public DateTime EchoDateTime(DateTime dval) {
                return dval;
            }
            public void voidFunc(){
                return;
            }
            public int EchoParam(int intval) {
                return intval;
            }
            public void SendParam(int intval) {
                return;
            }
            public int GetParam() {
                return 10;
            }
            public int EchoRefParam(ref int intval) {
                intval++;
                return 100;
            }
            public void SendRefParam(ref int intval) {
                intval++;
                return;
            }
            public void OutParam(out int intval) {
                intval=100;
            }   
            public testStruct echoStruct(testStruct ts) {
                return ts;
            }
            public testObject echoObject(testObject to) {
                Console.WriteLine("Method Called");
                return to;
            }
            public int[] echoArray(int[] intArray) {
                return intArray;
            }
            
        }
    
    }
    
  6. ?? ???? ????? ???? ServerExe.cs.
  7. ?????? "???????" ?????? ??? ??? ????. ?? ???? ???????? ???????? ??????? ?? ?????:
    <configuration>
      <system.runtime.remoting>
        <application name="ClientExe">
        
          <channels>
            <channel port="0" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting,Version=1.0.5000.00, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <channel port="0" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting,Version=1.0.5000.00, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
          </channels>
    
        </application>
      </system.runtime.remoting>
    </configuration>
  8. ?? ???? ????? ???? C:\ClientChannels.config.
  9. ?????? "???????" ?????? ??? ??? ????. ?? ???? ???????? ???????? ??????? ?? ?????:
    <configuration>
      <system.runtime.remoting>
        <application >
    
           <client url="http://localhost:9998/" >
            <activated type="EchoExeTest.TestClass, ServerExe" url="http://localhost:9998/TestClass.soap" />
           </client>
        </application>
      </system.runtime.remoting>
    </configuration>
  10. ?? ???? ????? ???? C:\HttpCaoClient.cfg.
  11. ?????? "???????" ?????? ??? ??? ????. Paste the following code in the file:
    using System;
    using System.Runtime.Remoting;
    using EchoExeTest;
    
    public class ClientExeClass
    {
        public static int Main(String[] args)
        {
            const int PASS = 0xABBA;
            int parint = 12, outInt;
            string parstring = "hello";
            DateTime pardatetime = DateTime.Now;
            testStruct tStruct = new testStruct();
            tStruct.x = 100 ; tStruct.y = 200;
            testObject tObject = new testObject();
            tObject.x = 100 ; tObject.y = 200;
    
            Console.WriteLine("Start initiating the object.");
            ClientExeClass cec = new ClientExeClass();
            cec.Initialize(args);
            TestClass tClass = new TestClass();
            if(tClass == null){
                Console.WriteLine("Object not activated.");
                return 0;
            }
    
            try{        
                Console.WriteLine("Calling methods on the object.");
                
                int retInt = tClass.EchoInt(parint);
                if(retInt != parint)
                    throw new Exception("Failure in EchoInt method.");
                
                String retString = tClass.EchoString(parstring);
                if(retString != parstring)
                    throw new Exception("Failure in EchoString method.");
    
                DateTime retDval = tClass.EchoDateTime(pardatetime);
                if(retDval != pardatetime)
                    throw new Exception("Failure in EchoDateTime method.");
    
                tClass.voidFunc();
                tClass.SendParam(parint);
                retInt = tClass.GetParam();
                if(retInt != 10)
                    throw new Exception("Failure in GetParam method.");
    
                tClass.SendRefParam(ref parint);
                if(parint != 13)
                    throw new Exception("Failure in SendRefParam method.");
    
                retInt = tClass.EchoRefParam( ref parint);
                if((retInt != 100) || (parint != 14))
                    throw new Exception("Failure in EchoRefParam method.");
    
                tClass.OutParam(out outInt);
                if(outInt != 100)
                    throw new Exception("Failure in OutParam method.");
    
                testStruct retStruct = tClass.echoStruct(tStruct);
                if( (retStruct.x != tStruct.x) ||
                    (retStruct.y != tStruct.y))
                    throw new Exception("Failure in echoStruct method.");
    
                testObject retObject = tClass.echoObject(tObject);
                if( (retObject.x != tObject.x) ||
                    (retObject.y != tObject.y))
                    throw new Exception("Failure in echoObject method.");
    
                int[] parArray = new int[2];
                parArray[0]=1;
                parArray[1]=2;
    
                int[] retArray = tClass.echoArray(parArray);
                if( (retArray[0] != parArray[0]) ||
                    (retArray[1] != parArray[1]))
                    throw new Exception("Failure in echoArray method.");             
    
            }catch (Exception e) {
                Console.WriteLine(e);
                return 0;
            }
    
            return PASS;
        }
        
        public void Usage() {
            Console.WriteLine(" Usage : ClientExe -chan:Client.config -mode:wko/cao?client.config");
        }
    
        public  void Initialize(string[] args) {
            int ret=0;  
    
            if (args.Length == 0) 
            Usage();
            for (int i=0;i<args.Length;i++) {
            if (
                String.Compare(args[i],"HELP", true) == 0 ||
                String.Compare(args[i],"?", true) == 0 ||
                String.Compare(args[i],"/h", true) == 0 ||
                String.Compare(args[i],"-h", true) == 0 ||
                String.Compare(args[i],"-?", true) == 0 ||
                String.Compare(args[i],"/?", true) == 0
            ) {
                Usage();
                return;
            }
    
    
                String arg = args[i];   
            String value = null;
    
            if (args[i][0] == '/' || args[i][0] == '-'){   
                int index = args[i].IndexOf(':');
                if (index != -1) {
    
                arg = args[i].Substring(1, index-1);
                    //Make sure that a colon (:) is not the last character.
                if (index == (args[i].Length - 1))
                    throw new Exception("Argument cannot be empty. -> " + args[i]);
                value = args[i].Substring(index+1);
                }
                else    
                arg = args[i].Substring(1); 
            }
    
            //Process the input sources.
            if (String.Compare(arg, "chan", true) == 0) {
                Console.WriteLine(value);
                RemotingConfiguration.Configure(value);
                    }
            else if (String.Compare(arg, "mode", true) == 0) {
                Console.WriteLine(value);
                RemotingConfiguration.Configure(value);
            }   
            }   
            return;
        }
    
    }
    
  12. ?? ???? ????? ???? C:\ClientExe.cs.
  13. ?????? "???????" ?????? ??? ??? ????. ?? ???? ???????? ???????? ??????? ?? ?????:
    csc ServerExe.cs
    start serverexe -chan:serverchannels.config -mode:servercao.cfg
    soapsuds -url:http://localhost:9998/remoteapplicationmetadata.rem?Wsdl -oa:serverexe.dll
    csc /r:serverexe.dll clientexe.cs
    clientexe -chan:clientchannels.config -mode:httpcaoclient.cfg
    
  14. ?? ???? ????? ???? c:\Build.bat.
  15. ?? Visual Studio .NET 2002 ? ???? ??? ???? ? ???? ??? ???????, ??? ??? Microsoft Visual Studio .NET ? ??? ??? ????? .NET Visual Studio ? ?? ???? ??? ???? ??????? .NET Visual Studio.

    ?? Visual Studio .NET 2003 ? ???? ??? ???? ? ???? ??? ???????, ??? ??? Microsoft Visual Studio .NET 2003 ? ??? ??? ????? .NET Visual Studio ? ?? ???? ??? ???? ??????? 2003 .NET Studio Visual.
  16. ?? ???? ???????? ???? C: ?? ?? ???? ??????? ENTER.
  17. ???? Build.bat ?? ?? ???? ??????? ENTER.
  18. ????? ????? ?????? ??????? ?? ???? ????? ?????? ??????? ?? ????.

    ?? ????? ????? ????? ???????? ?? ??? "???????" ?? ??? ???????.

?????

????? ?? ????????? ??? Soapsuds.exe ?? ?????? ???? Microsoft ??? ??? Network(MSDN) ?????? ???????:
http://msdn2.microsoft.com/en-us/library/xd176a6c(vs.71).aspx

???????

???? ???????: 828987 - ????? ??? ??????: 02/???? ??????/1428 - ??????: 2.4
????? ???
  • Microsoft .NET Framework 1.1
????? ??????: 
kbmt kbproxydev kbcominterop kbremoting kbbug KB828987 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????828987

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com