Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2007

Tip: Looking for answers? Try searching our database.

WCF - Client dll not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
C Downey - 02 Oct 2007 18:40 GMT
I have created a WCF Service hosted in IIS.  In my web.config it has its endpoint configured like so:
   <service behaviorConfiguration="JobServiceConfig" name="MyTest.JobService">
       <endpoint address="" binding="basicHttpBinding" contract="MyTest.JobService"/>
   </service>

I have a class library that will act as my client.  For now, my class library is named JobServiceClient  It has a service reference to my service http://localhost:2269/MyTest/Service.svc

This project has a class that I will be using to act as a wrapper for the proxy, and with some of my logic in it.  
In the app.config it has its end point configured like so:
<client> >

<endpoint address="http://localhost:2269/MyTest/Service.svc"

binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_JobService"

contract="JobServiceClient.JobProxy.JobService" name="BasicHttpBinding_JobService" />

</client>

This "wrapper" class is called JobService and has a method in it like:

public XmlElement GetJobTypeList()

{

XmlElement jobTypeList = null;

using (JobProxy.JobServiceClient jobServiceClient = new JobProxy.JobServiceClient())

{

jobTypeList = jobServiceClient.GetJobTypeList();

}

return jobTypeList;

}

I have a unit test in JobServiceClient that runs correctly and actually returns me a list of job types.

My problem is when I have another application  (Web app) try to consume this DLL and get a list of jobs by doing this:
JobService jobService = new JobService();

XmlElement jobServiceList = jobService.GetJobTypeList();

I get an error that says "Could not find default endpoint element that references contract ..."

It seems like it is looking in my main app for the end point when it should be just using the GetJobTypeList method that encapsulates all of that for me.... any ideas on how I can get this to work correctly?
Andrian - 07 Oct 2007 13:42 GMT
Colleen,

In the new web application that uses the proxy wrapper dll, does it have the end point configured in the web.config file?

It could be as simple as that.

Signature

Andrian

 I have created a WCF Service hosted in IIS.  In my web.config it has its endpoint configured like so:
     <service behaviorConfiguration="JobServiceConfig" name="MyTest.JobService">
         <endpoint address="" binding="basicHttpBinding" contract="MyTest.JobService"/>
     </service>

 I have a class library that will act as my client.  For now, my class library is named JobServiceClient  It has a service reference to my service http://localhost:2269/MyTest/Service.svc

 This project has a class that I will be using to act as a wrapper for the proxy, and with some of my logic in it.  
 In the app.config it has its end point configured like so:
 <client> >

 <endpoint address="http://localhost:2269/MyTest/Service.svc"

 binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_JobService"

 contract="JobServiceClient.JobProxy.JobService" name="BasicHttpBinding_JobService" />

 </client>

 This "wrapper" class is called JobService and has a method in it like:

 public XmlElement GetJobTypeList()

 {

 XmlElement jobTypeList = null;

 using (JobProxy.JobServiceClient jobServiceClient = new JobProxy.JobServiceClient())

 {

 jobTypeList = jobServiceClient.GetJobTypeList();

 }

 return jobTypeList;

 }

 I have a unit test in JobServiceClient that runs correctly and actually returns me a list of job types.

 My problem is when I have another application  (Web app) try to consume this DLL and get a list of jobs by doing this:
 JobService jobService = new JobService();

 XmlElement jobServiceList = jobService.GetJobTypeList();

 I get an error that says "Could not find default endpoint element that references contract ..."

 It seems like it is looking in my main app for the end point when it should be just using the GetJobTypeList method that encapsulates all of that for me.... any ideas on how I can get this to work correctly?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.