Difference between revisions of "C Sharp client - OpenKM 5.1"
From OpenKM Documentation
Line 18: | Line 18: | ||
} | } | ||
</source> | </source> | ||
+ | |||
+ | |||
+ | == Create all webservices in one library package == | ||
+ | Create some file called openkm.wsdl with this content: | ||
+ | <source lang="xml"> | ||
+ | <wsdlParameters xmlns="http://microsoft.com/webReference/"> | ||
+ | <nologo>true</nologo> | ||
+ | parsableerrors>true</parsableerrors> | ||
+ | <sharetypes>true</sharetypes> | ||
+ | <documents> | ||
+ | <document>http://demo.openkm.com/OpenKM/OKMAuth?wsdl</document> | ||
+ | <document>http://demo.openkm.com/OpenKM/OKMDocument?wsdl</document> | ||
+ | <document>http://demo.openkm.com/OpenKM/OKMFolder?wsdl</document> | ||
+ | <document>http://demo.openkm.com/OpenKM/OKMMail?wsdl</document> | ||
+ | <document>http://demo.openkm.com/OpenKM/OKMRepository?wsdl</document> | ||
+ | <document>http://demo.openkm.com/OpenKM/OKMPropertyGroup?wsdl</document> | ||
+ | </documents> | ||
+ | <webReferenceOptions> | ||
+ | <verbose>false</verbose> | ||
+ | <codeGenerationOptions>properties newAsync enableDataBinding</codeGenerationOptions> | ||
+ | <style>client</style> | ||
+ | </webReferenceOptions> | ||
+ | </wsdlParameters> | ||
+ | </source> | ||
+ | |||
+ | Execute from windows terminal: | ||
+ | wsdl.exe /par:openkm.wsdl /out:OKMWebservice.cs /n:OpenKM.ws | ||
+ | |||
+ | That will generate a OKMWebservice.cs with namespace OpenKM.ws. For more information about wsdl.exe option refer to [[http://msdn.microsoft.com/en-us/library/7h3ystb6%28v=vs.80%29.aspx]] | ||
+ | |||
[[Category: Webservices Guide]] | [[Category: Webservices Guide]] | ||
[[Category:OKM Network]] | [[Category:OKM Network]] |
Revision as of 18:23, 21 October 2011
.Net framework comes with wsdl.exe utility ( possible it's not in your default path)
wsdl.exe http://localhost:8080/OpenKM/OKMAuth?wsdl /out:OKMAuthService.cs
Pay attention in public OKMAuthService class, it'll be generated some OKMAuthService() constructor that you would like to change to take advantatge of host variable
public OKMAuthService() {
this.Url = http://127.0.0.1:8080/OpenKM/OKMAuth;
}
change to (or create another method with this parameter):
public OKMAuthService(String host) {
this.Url = host;
}
Create all webservices in one library package
Create some file called openkm.wsdl with this content:
<wsdlParameters xmlns="http://microsoft.com/webReference/">
<nologo>true</nologo>
parsableerrors>true</parsableerrors>
<sharetypes>true</sharetypes>
<documents>
<document>http://demo.openkm.com/OpenKM/OKMAuth?wsdl</document>
<document>http://demo.openkm.com/OpenKM/OKMDocument?wsdl</document>
<document>http://demo.openkm.com/OpenKM/OKMFolder?wsdl</document>
<document>http://demo.openkm.com/OpenKM/OKMMail?wsdl</document>
<document>http://demo.openkm.com/OpenKM/OKMRepository?wsdl</document>
<document>http://demo.openkm.com/OpenKM/OKMPropertyGroup?wsdl</document>
</documents>
<webReferenceOptions>
<verbose>false</verbose>
<codeGenerationOptions>properties newAsync enableDataBinding</codeGenerationOptions>
<style>client</style>
</webReferenceOptions>
</wsdlParameters>
Execute from windows terminal:
wsdl.exe /par:openkm.wsdl /out:OKMWebservice.cs /n:OpenKM.ws
That will generate a OKMWebservice.cs with namespace OpenKM.ws. For more information about wsdl.exe option refer to [[1]]