简体   繁体   中英

asp.net webservice how to make compatible with PHP and other languages

I am currently creating a web service in vb.net and I would like to ask the community what is the best way to make this compatible for PHP users and other languages.

An example of my code is as follows:

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 

My question is will this method be compatible with PHP consumption. If not can someone point me to the right direction.

The answer to this can be found here:

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

More importantly the last posting, you would consume your ASP.NET web service by saving the .wdsl file (web service) and doing the following in PHP:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM