Web services

stiqma

New Member
i have this error message.
what's my problem ? i check Nameserver and WSA's log file but i dot't saw any problem.

The remote server returned an error: (500) Internal Server Error.
konum: System.Net.HttpWebRequest.GetResponse()
konum: Service..ctor() c:\Documents and Settings\Esra\Belgelerim\Visual Studio 2010\WebSites\WebSite5\App_Code\Service.cs içinde: satır 92


System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: Failed to connect to the target machine actively refused it 127.0.0.1:8080



This code

using


System;

using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Net;
using System.IO;
using System.Windows.Forms;
using System.Text;
using System.Configuration;
 
[
WebService(Namespace = "http://serverip:8080/wsa/wsa1")]
[
WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
private string ServerIP;
private string UserID;
private string Password;
public Service(string ServerIP, string UserID, string Password)
{
this.ServerIP = ServerIP;
this.UserID = UserID == null ? "administrator" : UserID;
this.Password = Password == null ? "987654321" : Password;
}
public Service()
{
string content = @"<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Body>
<test xmlns='http://serverip:8080/wsa/wsa1' />
</soap:Body>
</soap:Envelope>"
;

string url = @"http://serverip:8080/wsa/wsa1";
string contentType = @"text/xml; charset=utf-8";
string method = "POST";
string header = "SOAPAction: \'http://serverip:8080/wsa/wsa1/test\'";
 
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);


ASCIIEncoding ascii = new ASCIIEncoding();
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(content);
req.Credentials =
new NetworkCredential(UserID, Password);
req.KeepAlive =
false;
req.Method = method;
req.ContentLength = bytes.Length;
req.ContentType = contentType;
req.UserAgent =
"Mozilla/3.5 (compatible; My Browser/1.0)";
req.PreAuthenticate =
true;
req.ProtocolVersion =
HttpVersion.Version10;
req.ContentLength = content.Length;
//req.Proxy = System.Net.WebProxy.GetDefaultProxy();
req.AllowAutoRedirect = true;
req.MaximumAutomaticRedirections = 10;
req.Timeout = (
int)new TimeSpan(0, 0, 60).TotalMilliseconds;
req.Headers.Add(header);

req.Timeout=1000000;

try
{
Stream strReguest = req.GetRequestStream();

strReguest.Write(bytes, 0, bytes.Length);
strReguest.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
try
{
HttpWebResponse reps = (HttpWebResponse)req.GetResponse();
Stream strResponse = reps.GetResponseStream();
StreamReader sr = new StreamReader(strResponse, Encoding.UTF8);
Console.WriteLine(sr.ReadToEnd());
sr.Close();
}
catch(Exception ex) {
MessageBox.Show(ex.ToString());
}
 


}


[WebMethod]
public string test()
{
WebReference.
ReklamAppService rek = new WebReference.ReklamAppService();

string pout = "ok";

return rek.test("name", out pout);


}


}
 

rstanciu

Member
http server is down/bussy or the firewal fire the port 8080 or application service is down
try .... telnet serverip 8080 in command line
 

rstanciu

Member
telnet serverip 8080 ... in a command line , if the server is down he say connection refused
type "head" to force the https server to say something ...

here an example:

Code:
arret@rs#: telnet www.progresstalk.com 80
Trying 207.7.90.53...
Connected to www.progresstalk.com.
Escape character is '^]'.
<head>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.</p>
<hr>
<address>Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 PHP/5.3.6 Server at fast4gl.net Port 80</address>
</body></html>
Connection closed by foreign host.
arret@rs#: 

[FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]


after you type:
firefox http://serverip:8080/wsa/wsa1
have to give you:
[h=1]WSA Web Services[/h] Status:wsa1:OK:111


and ...
firefox http://serverip:8080/wsa/wsa1/wsdl?

have to give the listing of services like:

[h=1]Progress Web Services Adapter[/h]
WSTKRPCEncodedWSTKRPCEncoded.wsdlurn:prgs:RPCEncoded
WSTKRPCLiteralWSTKRPCLiteral.wsdlurn:prgs:RPCLiteral
WSTKDocLiteralWSTKDocLiteral.wsdlurn:prgs:DocLiteral

Web Services Adapter Deployed Applications
NameWSDL FileTarget URL






 

stiqma

New Member
telnet serverip 8080 ... in a command line , if the server is down he say connection refused
type "head" to force the https server to say something ...

here an example:

Code:
arret@rs#: telnet www.progresstalk.com 80
Trying 207.7.90.53...
Connected to www.progresstalk.com.
Escape character is '^]'.
<head>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.</p>
<hr>
<address>Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 PHP/5.3.6 Server at fast4gl.net Port 80</address>
</body></html>
Connection closed by foreign host.
arret@rs#: 

[FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]


after you type:
firefox http://serverip:8080/wsa/wsa1
have to give you:
[h=1]WSA Web Services[/h] Status:wsa1:OK:111


and ...
firefox http://serverip:8080/wsa/wsa1/wsdl?

have to give the listing of services like:

[h=1]Progress Web Services Adapter[/h]
WSTKRPCEncoded
WSTKRPCEncoded.wsdl
urn:prgs:RPCEncoded
WSTKRPCLiteral
WSTKRPCLiteral.wsdl
urn:prgs:RPCLiteral
WSTKDocLiteral
WSTKDocLiteral.wsdl
urn:prgs:DocLiteral
of course.. i write in firefox "http://100.3.45.101:8080/wsa/wsa1/wsdl?" i see Progress Web Services Adapter. but i can't the adapter on .Net.



 

rstanciu

Member
you have to take a look to the appServer side logs ... to get more details
also .. get from Internet "soapUI" ... is a good tool for debugging
 
Top