access at webservice from dll

Hello,

I have to connect at Webservice (codeunit) from a DLL, made in C#, using ChannelFactory<TChannel>. Someone can help me, posting an example.

thanks boys

Comments

  • SeeSharpSeeSharp Member Posts: 19
    What have you tried yourself so far?

    You're writing this library, I assume?
  • massimopasqualimassimopasquali Member Posts: 82
    yes I have witten the library.

    this is the point that I must change

    Digas = new NAV.sg1();
    Digas.Url = linkCodeunit;
    Digas.Credentials = new NetworkCredential(usernameCodeunit, passwordCodeunit);
    }
    byte[] S64 = readByte(responseStream);
    string STR64bit = Convert.ToBase64String(S64);
    Digas.ImportCommunication(STR64bit, NomeFile, SGAteID);

    The project at beginner was a form application and I have used NAV.sg1() that is an object of web reference to NAV, but now I must use a DLL so I can't connect to NAV using a web reference becouse the DLL can't read the config XML of the web reference. So I have read online that using channelfactory it is possible. in Afternoon my collegue is going to send me the project so I will post the code.

    thanks
  • SeeSharpSeeSharp Member Posts: 19
    You can add service references the new solution?

    Else, there's a decent write up on implementing the interfaces and channel factories here.
Sign In or Register to comment.