Question

I have a project in VS2010 that includes a Service Reference to a GP Web Services. I can access all classes and methods for GP Web services and I have a Class Library project around it to use it. Everything works fine but when I generate a new dll and include this dll on a web folder in order to be used by an aspx web application, when accessing the GP web service I get the following error message: Could not find default endpoint element that references contract 'GP.DynamicsGP' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. Any thoughts?

Was it helpful?

Solution

So you included a seperate assembly as a project in your application, which would allow you to access the classes and whatnot.

The problem is that it needs access to an endpoint address. The app.config file in your referenced DLL would have that information, however, The application configuration file of the current executing program is the one that gets used, so you'll need to copy the xml from the app.config file in your referenced assembly to your current project.

This is the block of code you're looking for.

    <client>
        <endpoint address="WebServiceAddress"
            binding="wsHttpBinding" bindingConfiguration="GPWebService"
            contract="DynamicsGP.DynamicsGP" name="GPWebService">
            <identity>
                <userPrincipalName value="crm@emailaddress" />
            </identity>
        </endpoint>
    </client>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top