Pages

Thursday, January 14, 2010

WSDL vs. non-WSDL Modes

พอดีวันนี้ จำเป็นที่จะต้อง consume .net web service using php5 with soap extesion แล้วไปเจอเขากับ article ที่ : http://wso2.org/library/1060
เขาจะพูดเรื่องของ php soap extension แล้วผ่านไปมาเจอกับ web service module 2 แบบ คือ
1. WSDL model
2. non-WSDL model

เลยลองอ่านเพิ่มเติม ประกฏว่าได้เรื่องดังนี้ครับ (ไม่แน่ใจว่าผมเข้าใจถูกหรือเปล่าว)

สำหรับการ implement web service จะมีอยู่ 2 models ด้วยกันคือ
1. Contract First model
2. Code First model

สอง model นี้มันต่างกันยังไง

อันแรก Contact first model จะมี WSDL เป็นตัวที่ใช้อธิบาย detail ของ web service ซึ่งภายในก็จะอธิบายถึงการ implement and consume

อันหลัง Code first model. In the code first model, the code implementing the service is written first. Then in most cases a contract, in other words a WSDL, is generated out of the code. Then the client can use that WSDL, at the time of consuming the service, to take note of the interface of the service. However, the PHP 5's SOAP extension does not have provisions for generating a WSDL out of the code. To cater for this situation, the non-WSDL mode of the SoapServer and SoapClient can be used.

ง่าย ๆ คือ php extension นี้จะไม่มีการ generate wsdl ให้ เหมือนใน nusoap

No comments:

Post a Comment