Ben bir C # ASP.Net Web Uygulama bir web hizmeti kullanmak çalışıyorum. Hizmet PHP inşa olup benim kontrolüm altında biraz uzak sunucuda bulunan yüzden ben bunun içine meta veri veya başka bir şey eklemek için değiştirebilirsiniz olamaz.
When I use the "Add Web Reference" option in Visual Studio 2008, I receive the following error:
The HTML document does not contain Web service discovery information.
aşağıdaki web hizmeti eklemek için çalışırken.
https://subreg.forpsi.com/robot2/subreg_command.php?wsdl
Web servis fonksiyonları maruz kalan ve Visual Studio 2008 görüntülenir. Ancak ben ASP.Net Uygulama kullanım için kendisine başvuru eklemek olamazdı.
t3Service "Açıklama
Methods __construct ( )
create_contact ()
get_contact ()
get_domain_info ()
get_last_error_code ()
get_last_error_msg ()
get_NSSET ()
get_owner_mail ()
login ()
register_domain ()
register_domain_with_admin_contacts ( )
renew_domain ()
request_sendmail ()
send_auth_info ()
transfer_domain ()
Ben de xml alınıyor ve bir wsdl dosyasına kopyalayarak ve bir proxy sınıf üreterek wsdl.exe yöntemi denedi. Ama wsdl çıktı uyarıları içerir ve oluşturulan proxy sınıfı maruz fonksiyonlarını atlar ve böyle bir şey üretir:
// CODEGEN: The operation binding 'create_contact' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_contact' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_domain_info' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_last_error_code' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_last_error_msg' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_NSSET' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'get_owner_mail' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'send_auth_info' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'transfer_domain' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'request_sendmail' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'login' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'register_domain' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'register_domain_with_admin_contacts' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type. // CODEGEN: The operation binding 'renew_domain' from namespace 'urn:t3' was ignored. Each message part in an use=encoded message must specify a type.
Edit:
Elimi kodlu sınıf için bu kod parçası çalıştı.
public String makeWebRequest(String methodName)
{
// Create the web request
HttpWebRequest request = WebRequest.Create("https://subreg.forpsi.com/robot2/subreg_command.php/") as HttpWebRequest;
// Add authentication to request
request.Credentials = new NetworkCredential("foo@mydomain.com", "bar");
request.Method = "POST";
request.ContentType = "text/xml";
request.Headers.Add("SOAPAction: https://subreg.forpsi.com/robot2/subreg_command.php/" + methodName);
// Get response
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
// Get the response stream
StreamReader reader = new StreamReader(response.GetResponseStream());
// Console application output
//Console.WriteLine(reader.ReadToEnd());
return reader.ReadToEnd();
}
}
Ben yanıt almak çalıştığınızda ama sonra döndürür
(500) Internal Server Error: Uzak sunucu hata döndürdü.