2011-03-23 41 views
1

我目前在vb.net中創建一個web服務,我想問問社區什麼是使PHP用戶和其他語言兼容的最佳方式是什麼。asp.net webservice如何使與PHP和其他語言兼容

我的代碼示例如下:

Public Shared Function GetBasketInfo(ByVal sessionid As String, ByRef ds As DataSet, ByVal attributes  

As String) As DataRow 

If String.IsNullOrEmpty(attributes) Then 
    Throw New ArgumentNullException("Please supply a manufacturer") 
End If 

Dim l As New List(Of String) 

l = _serializer.SplitAttributes(attributes) 


Dim s As String 
Dim p(1) As SqlParameter 
Dim dt As DataTable 

's = "exec MSLStore1_GetOrderInfo @userid, @orderid" 


dt = ExecuteDataTableDT("MSLStore1_GetOrderInfo", _ 
        New SqlParameter("@userid", StoI(l(0))), _ 
         New SqlParameter("@orderid", StoI(l(1))) 
        ) 



    Return dt.Rows(0) 

    End Function 

我的問題是將這種方法與PHP消費兼容。 如果沒有人可以指點我正確的方向。

回答

0

這個問題的答案可以在這裏找到:

http://forums.asp.net/t/887892.aspx/1

更重要的是最後一個帖子,你會通過保存.wdsl文件(Web服務),做消耗你的ASP.NET Web服務按照PHP:

$client = new SoapClient("http://localhost/csharp/web_service.asmx?wsdl"); 

print_r($client->Add(array("a" => "5", "b" =>"2"))); 
+0

另一個問題是可以PHP用戶消費數據集的玉任寫在vb.net Web服務,並希望它accessable到很多開發者儘可能 – rogue39nin 2011-03-23 09:45:28

+0

是的 - 你可以寫在任何一個Web服務語言被任何其他語言消耗掉。這就是Web服務的完美之處,因爲數據是通過SOAP發送的:) – 2011-03-23 09:48:20

+0

所以我不需要擔心將PHP作爲xml返回,他們可以在運行wsdl時使用數據源?在我的web服務結束它不gererate任何屏幕上或文件即時通訊運行vista和iis6 – rogue39nin 2011-03-23 09:57:04

相關問題