1
votes

I'm trying to COM interop w/ Navision through a .Net assembly - and specifically using MSXML interfaces. This leads to the following error message:

The assembly "C:\Users\bra\Documents\Visual Studio 2008\Projects\SOAPROXY\SOAPROXY\bin\Release\SOAPROXY.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'SOAPROXY.ISoap.PostEnvelope(#0), SOAPROXY'. Error: Type library exporter cannot load type 'MSXML2.IXMLDOMDocument' (error: System.IO.FileNotFoundException: Could not load file or assembly 'Interop.MSXML2, Version=6.0.0.0, Culture=neutral, PublicKeyToken=fbdb4bb4a7dccef2' or one of its dependencies. The system cannot find the file specified. File name: 'Interop.MSXML2, Version=6.0.0.0, Culture=neutral, PublicKeyToken=fbdb4bb4a7dccef2'). SOAPROXY

The basic interface is defined as

[Guid("some guid")]
[ComVisible(true)]
public interface ISoap
{
    IStatus State { get; }

    IXMLDOMDocument PostEnvelope(IXMLDOMDocument envelope, string action, string endpoint, string print, string store, string location);
}

[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
public class Soap : ISoap
{
     ...
}

Any clues?

2
Your username is bra? how cool is that? Do you know anyone called Pieter Antiessen?Patrick McDonald
That's my email prefix @ work. Nope don't know that dude. I know bra is good in Swedish ;-) Wonder-bra and what have you!Bent Rasmussen
Perhaps this MSDN article may be of use, it describes NAV/COM interop.Alex Peck

2 Answers

1
votes

Have you GAC'd the Interop wrapper on MSXML6 ? Seems like Fusion is failing to load the Assembly, and to solve that you would just GAC it. Or put it on the Fusion load path.

But I don't see why you need MSXML in order to make a request to a SOAP Web service. Why not just use the WebClient ad XmlDocument that is builtin to .NET BCL?

I am assuming from what you wrote above that you want to build a Navision "extension" (maybe not the right word) to connect to an external web service, that speaks XML or maybe more specifically, SOAP. And also assuming that you can build a Navision extension in .NET, but that you cannot use wsdl.exe or svcutil.exe, the tools for the 2 web services stacks built-in to .NET. If that is true, why not use the lower-level HTTP and XML classes that are available in .NET?

You wouldn't need COM interop at all.

0
votes

It seems to me as if you want to talk to Navision via SOAP web services. If you want to do that, you should use the facilities of .NET for web services, namely WCF (Windows Communication Foundation).