This is the exception:
System.Web.Services.Protocols.SoapException: WSDLOperation: Executing
method Logon failed
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(Soa
pClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at LogonService.Logon(String ServiceName, String UserName, String
Password) in
C:\dev\Sandbox.CDMS\Sandbox.CDMS.Core\LogonService.cs:line 38
at Sandbox.CDMS.Core.Program.Main(String[] args) in
c:\dev\sandbox.cdms\sandbox.cdms.core\program.cs:line 18
I'm not sure how to look at the XML generated. In the LogonService
class (which was generated by wsdl.exe), the method Logon calls into
the parent class SoapHttpClientProtocal's Invoke method. From there,
to me it's a black hole. I'm sure there are ways of looking at the
XML but I'm not sure how.
I'm not sure if code is revelant, its a fairly simple test class. I
suspect any issues would have to be in the LogonService code, or the
web service itself. Is this at least true? And since the
LogonService code is generated by thw wsdl.exe utility using the web
service's wsdl document, then, doesn't this also make sense that
something is wrong with the web service?
string token = null;
LogonService logon = new LogonService;
try
{
token = logon.Logon("UserName", "Password");
}
catch (SoapException ex)
{
Console.Writeline(ex.ToString());
}
Thanks for looking at this...
Brian
Brian,
What I mean by a trace is to look at the XML that is output and sent
to the web service.
What is the exception that is being thrown, btw?
I guess I just don't understand why it doesn't work. This is how
I've done web services before and never had any problems.
When you say run a trace, I'm not clear what that means. It is a
very simple web service, I'm passing a username and password and I
get back a token string. I've stepped through the code up until the
point it goes into the System.Web.Services assembly and the
exception is being generated inside there, so I don't know how I
can look to see what is going on.
Thanks,
Brian
Brian,
It is correct. When you invoke the method, the url that is called
is reconstructed from that base URL (with the WSDL) and then a
request
is sent to that.
You might want to consider running a trace, to see what output you
are generating, and send it to the vendor exposing the web service
(if
you think it is correct).
Hope this helps.
I am working on a new program that uses a SOAP interface. I have
written a few of these before, but this time it is giving me
trouble. I suspect there is a problem with on the SOAP handler
side, but since I'm not an expect I cannot be sure.
The vendor has provided me a url to the WSDL document for the
soap service. Using the .Net WSDL utility, I generate a c# proxy
class. When I'm trying to use the methods of the soap service, I
get an error saying the method could not be executed.
What I find strange is, looking at my generated soap proxy class,
the URL points back to the WSDL URL, not a URL to a asmx or other
page. Does this make sense. How can a WSDL document handle soap
requests?
I asked the vendor and they said that it is correct...
Thanks for any help...
Brian