Ask a Question related to ASP.NET Web Services, Design and Development.
-
Rui via DotNetMonster.com #1
Not Solving "System.Net.WebException"
Hi all,
I am coding a web service for the company I am working for. It supposes to
talk to a third-party web service, via WSDL. The web reference which I am
using is:
[url]http://xml.nig.ac.jp/wsdl/SRS.wsdl[/url]
My code to test the web service is the following: (VS.net2003 C#)
private string QuerySRS(string queryString)
{
SRS search = new SRS();
string query = "[swissprotrelease-AllText:"+queryString+"]";
string param = "-f ID";
try
{
string results = search.searchSimple(query);
……………………………
}
catch
{
}
}
Trying to run this class, I got the error in below:
System.Net.WebException: The underlying connection was closed: An
unexpected error occurred on a receive. at
System.Web.Services.Protocols.WebClientProtocol.Ge tWebResponse(WebRequest
request) at
System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebResponse
(WebRequest request) at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters) at
EBIResearch.jp.ac.nig.xml.SRS.searchSimple(String query)
And,
string results = search.searchSimple(query).ToString();
is the line causing the problem, which means I got no response back from
the remove web service.
I have tried to add the following function in the Reference.cs, but still
got the same problem.
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}
I knew this is a common asked question, but any suggestions are welcome.
Thanks
Rui
Rui via DotNetMonster.com Guest
-
CFINPUT type="radio" w/ "value" requires "label"
On a Flash form, when you specify type='radio' and value='whatever', the value of the 'value' attribute will be displayed as a label if no 'label'... -
system("clear"); vs. system("cls");
Using ActiveState Perl 5.8.0, system("clear"); raises an error on Win2k Pro: "clear is not recognized as an internal or external command, operable... -
Lsass.exe System error "object name not found". System keeps rebooting
When trying to install the drivers for the PCI modem in my laptop, prompted for the driver CD. Installed the driver without any errors but asked... -
"Start" "Program" "Menu" list is empty
For what ever reason my list of installed programs in my "Start" "Programs" menu is empty. Anyone know how to restore the list. Thanks for your... -
Since when UNIX is the "real" system that runs the "real" machines?
*CROSS POSTED TO comp.unix.solaris In article <o3FNa.611731$vU3.43623@news1.central.cox.net>, David Janes <djanes@cox.net> wrote: Yes, Unix... -
GuyV #2
Re: Not Solving "System.Net.WebException"
I've test your Web service on framework 1.1.4322 with C#, console
application. (without VS.NET)
first, I made proxy class for your WSDL and compile. (wsdl.exe util in SDK
dir)
and code:
SRS search = new SRS();
string query = "[swissprotrelease-AllText:]";
string results = search.searchSimple(query);
Console.WriteLine(results);
I can't see any error/Exception([results' is empty value).
I think there're no prob in Web service.
Check your vs.net application.
----------------------------
GuyV
"Rui via DotNetMonster.com" <forum@nospam.DotNetMonster.com> wrote in
message news:e1f7371d039e4f999e588024efd0681e@DotNetMonste r.com...> Hi all,
> I am coding a web service for the company I am working for. It supposes to
> talk to a third-party web service, via WSDL. The web reference which I am
> using is:
> [url]http://xml.nig.ac.jp/wsdl/SRS.wsdl[/url]
>
> My code to test the web service is the following: (VS.net2003 C#)
> private string QuerySRS(string queryString)
> {
>
> SRS search = new SRS();
>
> string query = "[swissprotrelease-AllText:"+queryString+"]";
> string param = "-f ID";
>
> try
> {
> string results = search.searchSimple(query);
> …………………………?
> }
> catch
> {
> }
> }
>
> Trying to run this class, I got the error in below:
>
> System.Net.WebException: The underlying connection was closed: An
> unexpected error occurred on a receive. at
> System.Web.Services.Protocols.WebClientProtocol.Ge tWebResponse(WebRequest
> request) at
> System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebResponse
> (WebRequest request) at
> System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
> methodName, Object[] parameters) at
> EBIResearch.jp.ac.nig.xml.SRS.searchSimple(String query)
>
> And,
> string results = search.searchSimple(query).ToString();
>
> is the line causing the problem, which means I got no response back from
> the remove web service.
>
> I have tried to add the following function in the Reference.cs, but still
> got the same problem.
>
> protected override System.Net.WebRequest GetWebRequest(Uri uri)
> {
> System.Net.HttpWebRequest webRequest =
> (System.Net.HttpWebRequest) base.GetWebRequest(uri);
> webRequest.KeepAlive = false;
> return webRequest;
> }
>
> I knew this is a common asked question, but any suggestions are welcome.
>
> Thanks
> Rui
GuyV Guest



Reply With Quote

