Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:44:55+00:00 2026-05-27T06:44:55+00:00

I use svcutil to generate the following code: //—————————————————————————— // <auto-generated> // This code

  • 0

I use svcutil to generate the following code:

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.239
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace System.Net
{
    using System.Runtime.Serialization;


    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="EndPoint", Namespace="http://schemas.datacontract.org/2004/07/System.Net")]
    [System.Runtime.Serialization.KnownTypeAttribute(typeof(System.Net.IPEndPoint))]
    public partial class EndPoint : object, System.Runtime.Serialization.IExtensibleDataObject
    {

        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;

        public System.Runtime.Serialization.ExtensionDataObject ExtensionData
        {
            get
            {
                return this.extensionDataField;
            }
            set
            {
                this.extensionDataField = value;
            }
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="IPEndPoint", Namespace="http://schemas.datacontract.org/2004/07/System.Net")]
    public partial class IPEndPoint : System.Net.EndPoint
    {

        private System.Net.IPAddress m_AddressField;

        private int m_PortField;

        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public System.Net.IPAddress m_Address
        {
            get
            {
                return this.m_AddressField;
            }
            set
            {
                this.m_AddressField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public int m_Port
        {
            get
            {
                return this.m_PortField;
            }
            set
            {
                this.m_PortField = value;
            }
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="IPAddress", Namespace="http://schemas.datacontract.org/2004/07/System.Net")]
    public partial class IPAddress : object, System.Runtime.Serialization.IExtensibleDataObject
    {

        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;

        private long m_AddressField;

        private System.Net.Sockets.AddressFamily m_FamilyField;

        private int m_HashCodeField;

        private ushort[] m_NumbersField;

        private long m_ScopeIdField;

        public System.Runtime.Serialization.ExtensionDataObject ExtensionData
        {
            get
            {
                return this.extensionDataField;
            }
            set
            {
                this.extensionDataField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public long m_Address
        {
            get
            {
                return this.m_AddressField;
            }
            set
            {
                this.m_AddressField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public System.Net.Sockets.AddressFamily m_Family
        {
            get
            {
                return this.m_FamilyField;
            }
            set
            {
                this.m_FamilyField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public int m_HashCode
        {
            get
            {
                return this.m_HashCodeField;
            }
            set
            {
                this.m_HashCodeField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public ushort[] m_Numbers
        {
            get
            {
                return this.m_NumbersField;
            }
            set
            {
                this.m_NumbersField = value;
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public long m_ScopeId
        {
            get
            {
                return this.m_ScopeIdField;
            }
            set
            {
                this.m_ScopeIdField = value;
            }
        }
    }
}
namespace System.Net.Sockets
{
    using System.Runtime.Serialization;


    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="AddressFamily", Namespace="http://schemas.datacontract.org/2004/07/System.Net.Sockets")]
    public enum AddressFamily : int
    {

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Unknown = -1,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Unspecified = 0,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Unix = 1,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        InterNetwork = 2,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        ImpLink = 3,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Pup = 4,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Chaos = 5,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        NS = 6,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Ipx = 6,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Iso = 7,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Osi = 7,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Ecma = 8,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        DataKit = 9,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Ccitt = 10,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Sna = 11,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        DecNet = 12,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        DataLink = 13,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Lat = 14,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        HyperChannel = 15,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        AppleTalk = 16,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        NetBios = 17,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        VoiceView = 18,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        FireFox = 19,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Banyan = 21,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Atm = 22,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        InterNetworkV6 = 23,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Cluster = 24,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Ieee12844 = 25,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Irda = 26,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        NetworkDesigners = 28,

        [System.Runtime.Serialization.EnumMemberAttribute()]
        Max = 29,
    }
}


[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="IConnectionHost", CallbackContract=typeof(IConnectionHostCallback), SessionMode=System.ServiceModel.SessionMode.Required)]
public interface IConnectionHost
{

    [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IConnectionHost/OpenTunnel", ReplyAction="http://tempuri.org/IConnectionHost/OpenTunnelResponse")]
    bool OpenTunnel(int serverPort);

    [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IConnectionHost/CloseTunnel", ReplyAction="http://tempuri.org/IConnectionHost/CloseTunnelResponse")]
    bool CloseTunnel(int serverPort);

    [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IConnectionHost/DisconnectAtHost", ReplyAction="http://tempuri.org/IConnectionHost/DisconnectAtHostResponse")]
    bool DisconnectAtHost(int serverPort, System.Net.IPEndPoint client);

    [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IConnectionHost/Reply", ReplyAction="http://tempuri.org/IConnectionHost/ReplyResponse")]
    int Reply(int serverPort, System.Net.IPEndPoint client, [System.ServiceModel.MessageParameterAttribute(Name="reply")] byte[] reply1);
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface IConnectionHostCallback
{

    [System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="http://tempuri.org/IConnectionHost/Relay")]
    void Relay(int serverPort, System.Net.IPEndPoint client, byte[] message);

    [System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action="http://tempuri.org/IConnectionHost/DisconnectAtClient")]
    void DisconnectAtClient(int serverPort, System.Net.IPEndPoint client);
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface IConnectionHostChannel : IConnectionHost, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ConnectionHostClient : System.ServiceModel.DuplexClientBase<IConnectionHost>, IConnectionHost
{

    public ConnectionHostClient(System.ServiceModel.InstanceContext callbackInstance) : 
            base(callbackInstance)
    {
    }

    public ConnectionHostClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName) : 
            base(callbackInstance, endpointConfigurationName)
    {
    }

    public ConnectionHostClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, string remoteAddress) : 
            base(callbackInstance, endpointConfigurationName, remoteAddress)
    {
    }

    public ConnectionHostClient(System.ServiceModel.InstanceContext callbackInstance, string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(callbackInstance, endpointConfigurationName, remoteAddress)
    {
    }

    public ConnectionHostClient(System.ServiceModel.InstanceContext callbackInstance, System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(callbackInstance, binding, remoteAddress)
    {
    }

    public bool OpenTunnel(int serverPort)
    {
        return base.Channel.OpenTunnel(serverPort);
    }

    public bool CloseTunnel(int serverPort)
    {
        return base.Channel.CloseTunnel(serverPort);
    }

    public bool DisconnectAtHost(int serverPort, System.Net.IPEndPoint client)
    {
        return base.Channel.DisconnectAtHost(serverPort, client);
    }

    public int Reply(int serverPort, System.Net.IPEndPoint client, byte[] reply1)
    {
        return base.Channel.Reply(serverPort, client, reply1);
    }
}

Then in Mathematica (8) & .NET/Link create an IPEndPoint object:

ep // ClearAll
ep[port_] := NETNew["System.Net.IPEndPoint", NETNew["System.Net.IPAddress", {127, 0, 0, 1}], port_]

retargetedEndPoint=ep@900

and try to call:

.Reply(.,retargetedEndPoint,.)

The problem is the Mathematica IPEndPoint object is of the genuine System.NET.IPEndPoint type whereas the expected one is some serialized representation!

  1. How can I convert the latter?
  2. How do these partial classes svcutil generates behave, do they extend?? the definitions of the real System.NET.IPEndPoint types or merely shadow them as it is assumed C# compilers (not the runtime) will automatically handle the necessary conversions?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:44:56+00:00Added an answer on May 27, 2026 at 6:44 am

    It doesn’t look right that you would generate anything in the System.Net namespace. I think maybe you want to use the /reference:<file path> option of svcutil so that it know where to look for existing types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using svcutil to generate proxy code for the following web service endpoint which
I currently use the Silverlight version of svcutil to generate the .cs file for
Is it possible to generate wsdl with use of SvcUtil or any other tool.
When using svcutil.exe, I noticed this switch, /tcv:Version35. The docs says this: Version35: Use
I was trying to use svcutil.exe to generate proxy classes for a service but
i'll use some sample code to demonstrate my problem... this is an entity public
I am using svcutil to generate a proxy file for use against a service
When I use SvcUtil to generate the client-side class it does not include the
I want to use svcutil to generate only the interface for the service contract,
I'm attempting to use svcutil.exe to generate -only- the service contracts (interfaces) from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.