PHP sabun aramak için ASP kullanabilir miyim?

4 Cevap php

My customer has a PHP web service, that they want me to use. It's PHP-based, while my web is ASP-based.

ASP kod şöyle görünür:

Dim soapclient

WSDL_URL = "http://xxx.xxxx.xx/index.php?Action=service"

set soapclient = Server.CreateObject("MSSOAP.SoapClient30")

soapclient.ClientProperty("ServerHTTPRequest") = True

hata özgeçmiş sonraki

Burada soapclient.mssoapinit WSDL_URL 'hatası

ASP PHP tabanlı bir sabun hizmeti çağırmak mümkün mü?

veya

Ne ayarlamak gerekir?

Thanks a lot!

4 Cevap

Biz bu soruyu çözmek için bir yol web hizmeti sormak için "MSSOAP.SoapClient30" kullanabilirsiniz, ama "Msxml2.ServerXMLHTTP.4.0" değil bulmak.

Bu gibi Örnek kod:

url = "http://xxx.xxx.xx/xxx.php"

SoapRequest="<?xml version="&CHR(34)&"1.0"&CHR(34)&" encoding="&CHR(34)&"utf-8"&CHR(34)&"?>" "<soap:Envelope xmlns:xsi="&CHR(34)&"http://www.w3.org/2001/XMLSchema-instance"&CHR(34)&" xmlns:xsd="&CHR(34)&"http://www.w3.org/2001/XMLSchema"&CHR(34)&" xmlns:soap="&CHR(34)&"http://schemas.xmlsoap.org/soap/envelope/"&CHR(34)&"><soap:Body><getList></getList></soap:Body></soap:Envelope>"

Set xmlhttp = Server.CreateObject ("Msxml2.ServerXMLHTTP.4.0")

Xmlhttp.open "POST", url, yanlış

xmlhttp.setRequestHeader "Content-Type", "text / xml; charset = utf-8"

xmlhttp.setRequestHeader "Content-Length", LEN (SoapRequest)

xmlhttp.send (SoapRequest)

Response.Write xmlhttp.responseText

Set xmlhttp = Nothing

Web hizmetleri ve SOAP bütün mesele bu does not matter hangi dil hizmeti çalışır hangi donanım ve işletim sistemi ve uygulanan olmasıdır.

Orada bir hata web hizmeti olan veya (daha büyük olasılıkla) Eğer yanlış bir şekilde diyorlar ya.

Iletişim biçimi XML olduğunu, çünkü ben, ASP bilmiyorum ben PHP biliyorum ama başka bir dilde PHP web hizmetlerine erişimde hiçbir sorun olmalıdır. XML: Her iki uygulama, bir üçüncü, aracı dili kullanarak iletişim olacaktır. Tüm ince olmalıdır.

Yeni başlayanlar için size (ve sonrası) görebilirsiniz böylece hata alıyoruz 'sonraki hata özgeçmiş' kaldırmanız gerekir.