Groups | Blog | Home
all groups > dotnet web services > october 2007 >

dotnet web services : WCF - Client dll not working


C Downey
10/2/2007 11:40:37 AM
I have created a WCF Service hosted in IIS. In my web.config it has its =
endpoint configured like so:
<service behaviorConfiguration=3D"JobServiceConfig" =
name=3D"MyTest.JobService">
<endpoint address=3D"" binding=3D"basicHttpBinding" =
contract=3D"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. =20
In the app.config it has its end point configured like so:
<client> >

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

binding=3D"basicHttpBinding" =
bindingConfiguration=3D"BasicHttpBinding_JobService"

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

</client>



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

public XmlElement GetJobTypeList()

{

XmlElement jobTypeList =3D null;

using (JobProxy.JobServiceClient jobServiceClient =3D new =
JobProxy.JobServiceClient())=20

{=20

jobTypeList =3D 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 =3D new JobService();

XmlElement jobServiceList =3D 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 =
Andrian
10/7/2007 10:42:01 PM
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.

--=20
Andrian
[quoted text, click to view]
I have created a WCF Service hosted in IIS. In my web.config it has =
its endpoint configured like so:
<service behaviorConfiguration=3D"JobServiceConfig" =
name=3D"MyTest.JobService">
<endpoint address=3D"" binding=3D"basicHttpBinding" =
contract=3D"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. =20
In the app.config it has its end point configured like so:
<client> >

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

binding=3D"basicHttpBinding" =
bindingConfiguration=3D"BasicHttpBinding_JobService"

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

</client>



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

public XmlElement GetJobTypeList()

{

XmlElement jobTypeList =3D null;

using (JobProxy.JobServiceClient jobServiceClient =3D new =
JobProxy.JobServiceClient())=20

{=20

jobTypeList =3D 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 =3D new JobService();

XmlElement jobServiceList =3D 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 =
AddThis Social Bookmark Button