ต้องแก้ยังไงหรอครับ แล้วผมเข้าใจถูกไหมครับว่า
1.สร้าง web service ตัวเอง เมื่อ user login เข้ามา ก็ให้ส่งค่า user pass ไปที่ตัว web service
2.จากนั้นก็ให้เรียก web service ตัวนี้ที่ เว็บ [client] เพื่อนำข้อมูลที่ส่งค่าไปใช้
ไม่ได้นะครับ ก็ยังขึ้น error ตัวเดิม เกี่ยวกับ version nusoap ที่ผมใช้อยู่ไหมครับ
ก็อปโค้ดมาด้วยครับ เผื่อใส่อะไรผิด Code (PHP)
<?
require_once("include/_lib/nusoap.php");
//Create a new soap server
$server = new soap_server();
//Define our namespace
$namespace = "http://localhost:81/intranet/WebServiceServer.php";
$server->wsdl->schemaTargetNamespace = $namespace;
//Configure our WSDL
$server->configureWSDL("HelloWorld");
// Register our method and argument parameters
$varname = array(
'strName' => "xsd:string",
'strEmail' => "xsd:string"
);
$server->register('HelloWorld',$varname, array('return' => 'xsd:string'));
function HelloWorld($strName,$strEmail)
{
return "Hello, World! Khun ($strName , Your email : $strEmail)";
}
// Get our posted data if the service is being consumed
// otherwise leave this data blank.
$POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
// pass our posted data (or nothing) to the soap service
$server->service($POST_DATA);
exit();
?>
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Script.Services
Imports System.ComponentModel
Imports System.Dynamic
Imports System.Linq
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
<System.Web.Script.Services.ScriptService()> _
Public Class WL_WebService
Inherits System.Web.Services.WebService
Private Shared Cars As New List(Of Car)() From {New Car() With {.Make = "Audi", .Model = "A4", .Year = "2004", .Doors = 5, .Colour = "Red", .Price = 2995.0F},
New Car() With {.Make = "Ford", .Model = "Focus", .Year = "2008", .Doors = 4, .Colour = "Blue", .Price = 1220.0F},
New Car() With {.Make = "BMW", .Model = "5 Series", .Year = "2010", .Doors = 2, .Colour = "Green", .Price = 99879.0D},
New Car() With {.Make = "Toyota", .Model = "Vios", .Year = "2012", .Doors = 4, .Colour = "White", .Price = 450.0D}
}
<WebMethod()> _
Public Function GetCarsByDoors(ByVal doors As Integer) As List(Of Car)
'Select * From Production_RDBMS Where Condition?
Dim query = From c In Cars
Where c.Doors = doors
Select c
Return query.ToList() 'ResponseFormat:=ResponseFormat.Json
End Function
<Serializable()> _
Public Class Car
Public Property Make As String
Public Property Model As String
Public Property Year As Integer
Public Property Doors As Integer
Public Property Colour As String
Public Property Price As Double
End Class
End Class