Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Web Service in Navisworks API

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
JohnHon
761 Views, 3 Replies

Using Web Service in Navisworks API

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

Tags (2)
3 REPLIES 3
Message 2 of 4
xiaodong_liang
in reply to: JohnHon

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? 

Message 3 of 4
JohnHon
in reply to: xiaodong_liang

Hi Xiaodong,

 

Thanks for your reply,Smiley Wink
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

Message 4 of 4
xiaodong_liang
in reply to: JohnHon

Cool! thank you JohnHon

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report