Creating a library with my web services

T

tshad

I am trying to create a dll that I can call from my web pages. The problem
is that it doesn't work the same way as a web page that calls the web
services.

I created a Library Project and added a web reference: RemoteUser, just like
I do in my Web Page.

I have the following:

******************************************************************
using System;
using MyFunctions.RemoteUser;

namespace MyFunctions
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class NewHire
{
public static int AddNewHire()
{
RemoteUserServiceService remoteUserService = new
RemoteUserServiceService();
RemoteUserDataBean ruDataBean;
ruDataBean = remoteUserService.fetchRemoteUserInfo(
"st",
"sw",
"10.0.0.5",
"C", //Client (employer)
"150");

if (ruDataBean.errorCode == 0)
{
return 0;
}
else
{
return;
}
}
}
}
**************************************************

In my Web Page, I append the reference name with the Namespace
(MyFunctions.RemoteUser). In the Dll, this does not seem to be the case.

The error I get when I try to build is:

C:\VSProjects\ClassLibrary4\NewHire.cs(3): The type or namespace name
'RemoteUser' does not exist in the class or namespace 'MyFunctions' (are you
missing an assembly reference?)

What am I missing here?

This code comes directly from my Web Page.

Thanks,

Tom
 
T

tshad

I got it to work.

But I am confused as to why it works.

It seems I need to use the name the Project was originally named when I
created the Library. I had renamed the namespace and Classes, as you can
see. There is nothing in the Solutions explorer showing the original name,
which is ClassLibrary4.RemoteUser. This makes no sense to me and I only
found it by accident, when I was looking at Object Browser which shows under
newHire:

{}ClassLibrary4
{}ClassLilbrary4.RemoteUser
{}MyFunctions

Very strange.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top