Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by EatingPeopleIsFun · Oct 17, 2013 at 05:26 AM · networkservicewcf

How to solve NotImplementedException during using WCF Duplex net.tcp binding?

Full exception message:

NotImplementedException: The requested feature is not implemented. System.ServiceModel.DuplexClientBase`1[TChannel].CreateChannel () System.ServiceModel.ClientBase`1[TChannel].get_InnerChannel () System.ServiceModel.ClientBase`1[TChannel].Open () Assets.ClientProxies.Test.Start () (at Assets/ClientProxies/Test.cs:23)

Appears after i'm trying to open connection.

Simple WCF service without duplex, works perfectly, please help me to make duplex work, the same code on .NET works fine.

Code listing:

 using System;
 using System.ServiceModel;
 using UnityEngine;
 
 namespace Assets.ClientProxies
 {
     public class Test : MonoBehaviour, IMyServiceCallback
     {
         private GameObject _obj;
         // Use this for initialization
         void Start ()
         {
             Debug.Log("START");
                
             var client = new MyServiceClient(new InstanceContext(this),
                                          new NetTcpBinding(SecurityMode.None),
                                          new EndpointAddress(string.Format("net.tcp://localhost:9000/MyService/Main")));
 
             client.Open(); //<- Error here
             Debug.Log(client.GetNumber());
             Debug.Log("FINE");
         }
     
         // Update is called once per frame
         void Update () {
     
         }
 
         public void Hello()
         {
             throw new NotImplementedException();
         }
 
         public IAsyncResult BeginHello(AsyncCallback callback, object asyncState)
         {
             throw new NotImplementedException();
         }
 
         public void EndHello(IAsyncResult result)
         {
             throw new NotImplementedException();
         }
     }
 }
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Baumkuchen · Dec 19, 2016 at 06:10 PM 0
Share

Hi, how did you get the async $$anonymous$$ehtods in Unity to run?

I know that it have to be without using Task class, because unity don't allow it.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by frabeth · Nov 23, 2013 at 03:01 PM

Hi,

I was facing the same problem, until I copy another version of System.ServiceModel.dll and System.Runtime.Serialization.dll in my Unity Asset (or plugin) folder. You can find these assemblies here : https://www.dropbox.com/sh/z05gp6zsqhshvpx/S-Wywb7NDh

Have a good day !

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ahmadhp · Dec 05, 2013 at 12:32 PM 0
Share

Thanks .. that's works .

avatar image brennan_unity708 · Oct 05, 2021 at 02:26 PM 0
Share

This worked for me on a different but related issue. I was trying to build a Unity app using WCF and was getting an error whenever I tried to call any of the methods in my proxy class.

 System.NullReferenceException: Object reference not set to an instance of an object.
   at System.ServiceModel.ClientBase`1[TChannel].get_Channel


I couldn't for the life of me figure out what was wrong with the code until I randomly came across your comment here. Before I was using the System.ServiceModel.dll that can be found in this Unity installation folder (C:\Program Files\Unity\Hub\Editor\2020.1.8f1\Editor\Data\MonoBleedingEdge\lib\mono\2.0-api) but it was throwing the above error. Then I switched to the one you posted above and it worked perfectly. What is the difference???

avatar image
0

Answer by Baumkuchen · Nov 15, 2016 at 10:31 PM

Hello can anybody tell me how I could implement Async methods for a WCF service? Like in the solution from EatingPeopleIsFun:

  public IAsyncResult BeginHello(AsyncCallback callback, object asyncState)
  {
        throw new NotImplementedException();
  }

I get many errors in Unity ... and when I import a Mono libery with Task sutff for example Unity says that Tasking isn't allowed (only Coroutines allowed)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

what protocol to use for open connection in unity3d? 1 Answer

Consume wcf service with netTcpBinding in unity 1 Answer

MySQL Connection From Android Platform 0 Answers

headless mode only pro? 1 Answer

Photon Network Muzzleflash 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges