Dear all,
In the window form, I need to use web service.
After I build the solution, I copy the dll file and dll.config file in the PlugIns folder.
However, an error occurs when running the following statement:
DatabaseCommand.DatabaseCommandServiceClient dbCmd = new DatabaseCommand.DatabaseCommandServiceClient();
Could anyone give me some comment?
Point that may be useful:
My web service is hosted locally.
I have opened the webservice when I open Navisworks.
Reference:
App.Config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IDatabaseCommandService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8732/Design_Time_Addresses/WCF/DatabaseCommandService/"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDatabaseCommandService"
contract="DatabaseCommand.IDatabaseCommandService" name="WSHttpBinding_IDatabaseCommandService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
Error Message:
Could not find default endpoint element that references contract 'DatabaseCommand.IDatabaseCommandService' 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.
Thanks in Advance.
John
Solved! Go to Solution.
Solved by JohnHon. Go to Solution.
Hi,
I am not sure what the matter is, but in theory, I think it should work. have you tried to put the config or other support files to <Navisworks Path>\Dependencies. If you still have the issue, could you provide a small demo project?
Hi Xiaodong,
Thanks for your reply,
I think the reason is the dll.app.config is not recognized by the dll file.
Finally, I included a class, generated by Visual Studio Command Prompt, in the project and it works.
Thanks for advance.
John