views:

751

answers:

3

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?

A: 

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).

EFrank
It's the other way around. I want Navision to talk to a SOAP Web Service. This is why I built this.
Bent Rasmussen
And WCF is, by the way, not an option. WSDL.exe and SvcUtil.exe or not compatible w/ the WSDL in question.
Bent Rasmussen
+1  A: 

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.

Cheeso
A: 

Perhaps this MSDN article may be of use, it describes NAV/COM interop.

Alex Peck