WSDL Îĵµ
WSDL Îĵµ½ö½öÊÇÒ»¸ö¼òµ¥µÄ XML Îĵµ¡£
Ëü°üº¬Ò»ÏµÁÐÃèÊöij¸ö web service µÄ¶¨Òå¡£
WSDL Îĵµ½á¹¹
WSDL ÎĵµÊÇÀûÓÃÕâЩÖ÷ÒªµÄÔªËØÀ´ÃèÊöij¸ö web service µÄ£º
ÔªËØ | ¶¨Òå |
---|---|
<portType> | web service Ö´ÐеIJÙ×÷ |
<message> | web service ʹÓõÄÏûÏ¢ |
<types> | web service ʹÓõÄÊý¾ÝÀàÐÍ |
<binding> | web service ʹÓõÄͨÐÅÐÒé |
Ò»¸ö WSDL ÎĵµµÄÖ÷Òª½á¹¹ÊÇÀàËÆÕâÑùµÄ£º
<definitions> <types>definition of types........
</types> <message>definition of a message....
</message> <portType>definition of a port.......
</portType> <binding>definition of a binding....
</binding> </definitions>
WSDL Îĵµ¿É°üº¬ÆäËüµÄÔªËØ£¬±ÈÈç extension ÔªËØ£¬ÒÔ¼°Ò»¸ö service ÔªËØ£¬´ËÔªËØ¿É°ÑÈô¸É¸ö web services µÄ¶¨Òå×éºÏÔÚÒ»¸öµ¥Ò»µÄ WSDL ÎĵµÖС£
ÈçÐèÍêÕûµÄÓï·¨¸ÅÊö£¬Çë·ÃÎÊ WSDL Óï·¨ ÕâÒ»½Ú¡£
WSDL ¶Ë¿Ú
<portType> ÔªËØÊÇ×îÖØÒªµÄ WSDL ÔªËØ¡£
Ëü¿ÉÃèÊöÒ»¸ö web service¡¢¿É±»Ö´ÐеIJÙ×÷£¬ÒÔ¼°Ïà¹ØµÄÏûÏ¢¡£
¿ÉÒÔ°Ñ <portType> ÔªËØ±È×÷´«Í³±à³ÌÓïÑÔÖеÄÒ»¸öº¯Êý¿â£¨»òÒ»¸öÄ£¿é¡¢»òÒ»¸öÀࣩ¡£
WSDL ÏûÏ¢
<message> ÔªËØ¶¨ÒåÒ»¸ö²Ù×÷µÄÊý¾ÝÔªËØ¡£
ÿ¸öÏûÏ¢¾ùÓÉÒ»¸ö»ò¶à¸ö²¿¼þ×é³É¡£¿ÉÒÔ°ÑÕâЩ²¿¼þ±È×÷´«Í³±à³ÌÓïÑÔÖÐÒ»¸öº¯Êýµ÷ÓõIJÎÊý¡£
WSDL types
<types> ÔªËØ¶¨Òå web service ʹÓõÄÊý¾ÝÀàÐÍ¡£
ΪÁË×î´ó³Ì¶ÈµÄƽ̨ÖÐÁ¢ÐÔ£¬WSDL ʹÓà XML Schema Óï·¨À´¶¨ÒåÊý¾ÝÀàÐÍ¡£
WSDL Bindings
<binding> ÔªËØÎªÃ¿¸ö¶Ë¿Ú¶¨ÒåÏûÏ¢¸ñʽºÍÐÒéϸ½Ú¡£
WSDL ʵÀý
ÕâÊÇij¸ö WSDL ÎĵµµÄ¼ò»¯µÄƬ¶Î£º
<message name="getTermRequest"> <part name="term" type="xs:string"/> </message> <message name="getTermResponse"> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="getTerm"> <input message="getTermRequest"/> <output message="getTermResponse"/> </operation> </portType>
ÔÚÕâ¸öÀý×ÓÖУ¬<portType> ÔªËØ°Ñ "glossaryTerms" ¶¨ÒåΪij¸ö¶Ë¿ÚµÄÃû³Æ£¬°Ñ "getTerm" ¶¨ÒåΪij¸ö²Ù×÷µÄÃû³Æ¡£
²Ù×÷ "getTerm" ÓµÓÐÒ»¸öÃûΪ "getTermRequest" µÄÊäÈëÏûÏ¢£¬ÒÔ¼°Ò»¸öÃûΪ "getTermResponse" µÄÊä³öÏûÏ¢¡£
<message> ÔªËØ¿É¶¨Òåÿ¸öÏûÏ¢µÄ²¿¼þ£¬ÒÔ¼°Ïà¹ØÁªµÄÊý¾ÝÀàÐÍ¡£
¶Ô±È´«Í³µÄ±à³Ì£¬glossaryTerms ÊÇÒ»¸öº¯Êý¿â£¬¶ø "getTerm" ÊÇ´øÓÐÊäÈë²ÎÊý "getTermRequest" ºÍ·µ»Ø²ÎÊý getTermResponse µÄÒ»¸öº¯Êý¡£