Needing to consume a Web Service defined by a .wsdl file for v11SP9, I read the KnowledgeBase Article http://community.aras.com/en/knowledgebase/consume-web-service-server-method/ which says : “Assuming .NET 2.0 and Visual Studio 2003”, so I had some issues. The steps listed in the article are still valid, but where to find wsdl.exe, csc.exe on a Windows 10 machine? And how to find out what classes are exposed in the resulting dll?
Where is Wsdl.EXE?
It is not in Windows\Microsoft.NET\Framework64, but a Windows Search found it in C:\Program Files (x86)\Microsoft SDKs\Windows\ both v7.0A\Bin and v10.0A\bin\NETFX 4.6 Tools.
I used tried both and they both produced a .cs file using:
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\Wsdl.exe" web_service_name.wsdl /o:web_service_name.cs pause
Where is CSC.EXE?
It is at C:\Windows\Microsoft.NET\Framework64\v4.0.30319
And web_service_name.cs was compiled using:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /t:library /out:web_service_name.dll web_service_name.cs /reference:System.dll,System.Web.dll,System.Web.Services.dll,System.XML.dll /optimize pause
what classes are exposed
It turns out that web_service_name.cs generated code has a compliler directive to compile for .Net 2.0, so it works fine for Aras Methods. I was confused by the fact that was no .Net namespace in the code, how to find out what types to use in a Method? Browsing for web_service_name.dll in ObjectExplorer in Visual Studio reveals what’s in the dll. Use the class names from ObjectExplorer in your Method.
SETTing UP Aras
Copy your dll to Innovator/Server/bin, and edit Innovator/Server/method_config.xml.
I needed to add the following to <ReferencedAssemblies> in method_config.xml:
to <Template name=”CSharp”>
Using web service classes in a Method and Syntax checking yields:
Checking syntax... OK: 2BDAA2BFAFC343549A731F6E11605BF7.
Bingaloo! If you need any other using statements in method_config templates, the Syntax Checker will be sure to let you know.