views:

30

answers:

1

I am attempting to call a Web Service (created in PHP) from my C# application. I have successfully added the Web Reference in Visual Studios, however I cannot figure out exactly how to invoke the call to the web service. I have been following this tutorial: http://sanity-free.org/article25.html however when I try and compile I get a "The type or namespace name 'SimpleService' could not be found". My C# code is as follows:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace inVision_OCR
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void translateButton_Click(object sender, EventArgs e)
        {
            // We need to snap the image here somehow . . .

            // Open up the image and read its contents into a string
            FileStream file = new FileStream("\\Hard Disk\\ocr_images\\test.jpg",     FileMode.Open);
            StreamReader sr = new StreamReader(file);
            string s = sr.ReadToEnd();
            sr.Close();

            // Using SOAP, pass this message to our development server
            SimpleService svc = new SimpleService();
            string s1 = svc.getOCR("test");
            MessageBox.Show(s);
        }
    }
}

Any help would be appreciated.

A: 

The SimpleService is probably in a different namespace, look at the properties of the web reference you added and see what namespace the proxy class SimpleService is being generated in, then add a using statement in your code to reference that namespace.

Sijin
I came to this conclusion earlier. However, it seems that no matter what I do I cannot get the namespace correct. Where can I locate this information? I used Object Browser to view my namespaces, but there was no mention of SimpleService.
Louis