Non ho conoscenza dei servizi web, perché sono nuovo su questo argomento. Ho creato il servizio WCF con C # per inserire dati nel database MS Sql. ora ho bisogno di printingre il contenuto della tabella del database usando php. come posso fare questo. Questo è il mio progetto scolastico.
Service1.svc.cs
public class Service1 : IService1 { public string GetData(int value) { return string.Format("You entered: {0}", value); } public DataSet SelectUserDetails() { SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=Registration;Integrated Security=True"); conn.Open(); SqlCommand cmd = new SqlCommand("Select * from RegistrationTable", conn); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); sda.Fill(ds); cmd.ExecuteNonQuery(); conn.Close(); return ds; } }
test.php
<?php /* Initialize webservice with your WSDL */ $client = new SoapClient("http://localhost:23995/Service1.svc?wsdl"); /* Invoke webservice method with your parameters, in this case: Function1 */ $response = $client->__soapCall("SelectUserDetails", arrays()); /* Print webservice response */ print_r($response); ?>
Produzione :
stdClass Object ( [SelectUserDetailsResult] => stdClass Object ( [schema] => [any] => [email protected] [email protected] [email protected] [email protected] ) )
come posso printingre questo risultato in una tabella html. è questo il modo corretto per connettere WSDL con PHP.please aiutami a printingre table content.table hanno 4 colonne