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 8205949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:28:27+00:00 2026-06-07T08:28:27+00:00

I used to code only in databases enviroments. Recent changes in the corp. made

  • 0

I used to code only in databases enviroments. Recent changes in the corp. made me start developing in whole new worlds.
This new project is something like SQL – C# – PHP.

The class I’ve been working on in VS2008 is almost dnoe. It calls all the SQL SPs I need and the info is there in the DataReaders.
When It came to read that info from PHP so I could populate the website I found out it wasn’t that easy. I was recommended into trying several options, the one that suits the best for the project is to create a Web Service and then consume it (please be patient, As I just stated I’m new to most web related programming)
So, I’m trying to WCF/Rest and then consume it from PHP but I haven’t got there yet.

I’ve read and watched several tutorials on WCF and It seems to be smooth, but all I’ve read is:

. Create Interface with its OperationContracts.

. Create Service with DataMembers etc and define the Methods listed in the Interface.

Ok, but what I’d like to do is not to specify any methods there, since all I want is to call C# method I’ve already written.
Should I do that in the Service or in the Interface? And first of all, is this the right the way to approach it?

  • 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-06-07T08:28:30+00:00Added an answer on June 7, 2026 at 8:28 am

    You would want to write service methods that implement an operation contract interface. The service methods can call the C# code that you’ve already written.

    For example, here is a simple service interface:

    [ServiceContract]
    public interface IYourService
    {
        [OperationContract]
        int GetCountOfTransactions(string filter);
    }
    

    And then you would implement this interface in your service class:

    public class YourService : IYourService
    {
        public int GetCountOfTransactions(string filter)
        {
            // Call your existing code
            YourClass yourClass = new YourClass();
            return yourClass.GetCountOfTransactions(filter);
        }
    }
    

    There are plenty of examples out there for setting this up as a REST service, but I think you’re on the right track.

    The trickiest part is usually setting up the binding configuration to make sure all of your consuming client applications can connect.

    Hopefully this helps.

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

Sidebar

Related Questions

When I use this code to download this image (only used for testing purposes),
I used following code, but it displays only 2 digit of ISO country name.
I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in
This code used to return my local ip address as 192.xxx.x.xxx but now it
This code used to work but doesnt any more. i used a breakpoint, and
This code used to work. Then, maybe I changed something, somewhere (or if I
I used this code to print the current page: <form> <input type=button value=Print onClick=window.print();
I used a code: jQuery.fn.MyFunction = function(){ return this.each(function() { attributes = test; return
How can I alter this code so that It only displays one image at
Used code I found on SO to use the COM based Acrobat Reader to

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.