質問

The root problem I'm trying to solve is why none of the WSDL parsers I try to use (Perl, Python, or Node.js) can generate the stubs for this SOAP service I'm trying to communicate with. The service (written in .NET) says to use svcutil.exe to generate C# code that will be the proxy client. There's only one problem.

I don't know C# at all. Not even a little bit.

So, I whomp up a Windows VM (ievms to the rescue!), install the .NET4.0 framework, and generate a proxy.cs (6000 lines!!) and a proxy.config file (XML to the rescue??). I copy those files over to my Ubuntu host, install mono-complete, and try "gcms proxy.cs". Immediately, I get the following (about 100 times, different line numbers):

proxy.cs(4602,9): error CS0234: The type or namespace name `ServiceModel' does not exist in the namespace `System'. Are you missing an assembly reference?

I have absolutely no idea what I'm doing. All I want to do is trace out exactly what XML is being sent and received under various circumstances so I can replicate that in a normal language. Any and all suggestions are welcome. I'd prefer to stay on Linux, if possible, just so I'm not fighting the SOAP service and my OS.

役に立ちましたか?

解決

You used the wrong command line arguments to compile that generated file and no wonder it failed.

http://linux.die.net/man/1/mcs

-r must be used to tell the compiler which assemblies must be used as references.

As you have no experience of C# programming, you might find it pretty hard to get the command line right. I suggest you first learn about it on Windows and Visual Studio, and then move to Mono and MonoDevelop. By creating a C# project (.csproj) it is easier to compile something, as MSBuild and xbuild will take care of calling the compiler.

You cannot jump too far.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top