Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

c# - Visual Studio 2010 SOAP service reference returns only null values

A client generated using Visual Studio 2010's 'Add Service Reference' tool returns a null value for calls to any remote function.
The server is a Perl CGI script (SOAP::Transport::HTTP::CGI) that I know is functioning correctly through testing with other clients. I used POD::WSDL to generate the WSDL file that the 'Add Service Reference' requires.

I have confirmed that the server is getting messages from the client and returning the appropriate results which has lead me to conclude that there is some flaw in either the client configuration or in .NET's XML parser. No errors are thrown and I don't try anything tricky in the application that invokes the client.

Has anyone had this problem before? Or know how to get at debugging information for XMLSerializer? Could the WSDL file be describing the means to send correctly but not how to interpret the response?

Service.ServiceHandlerClient client = new Service.ServiceHandlerClient("ARMService", "https://domain/server_soap");
string wut = client.cat_test("a", "b"); // should return "a b"
Console.WriteLine("results: " + wut ); // is always null!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

What a miserable solution I've found for this:

In the 'Add Service Reference' wizard there is a button at the bottom 'Add Web Service' that spawns another utility that worked immediately. This only leaves the question of why the other wizard would produce a proxy that works for most of the functionality but not all of it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...