¼Ü¹¹Web Service: ÃèÊöÓë×¢²á£¬·¢²¼Web·þÎñ_WIN2003·þÎñÆ÷ά»¤_ºÚ¿Í·ÀÏßÍø°²·þÎñÆ÷ά»¤»ùµØ--Powered by WWW.RONGSEN.COM.CN

¼Ü¹¹Web Service: ÃèÊöÓë×¢²á£¬·¢²¼Web·þÎñ

×÷ÕߣººÚ¿Í·ÀÏßÍø°²linux½Ì³ÌÍø À´Ô´£ººÚ¿Í·ÀÏßÍø°²linux½Ì³ÌÍø ä¯ÀÀ´ÎÊý£º0

±¾Æª¹Ø¼ü´Ê£º·¢²¼·þÎñ×¢²áÃèÊö
ºÚ¿Í·ÀÏßÍø°²ÍøѶ£º±¾ÎÄÊǼܹ¹Web·þÎñµÄϵÁÐÎÄÕµĵÚÁùƪ£¬Ò²ÊÇ×îºóһƪ£¬Îı¾ÒÔÇ°ÎÄΪ»ù´¡£¬ÔÚÇ°ÎĵÄÓ¦ÓÃʵÀýµÄ»ù´¡ÉÏ£¬¿¼²ìÁË·¢²¼Web·þÎñ½çÃæµÄÕû¸ö¹ý³Ì£ºXML Schema½¨Ä£¡¢WSDL·¢²¼ºÍUDDI×¢²á¡£Í¨¹ý±¾ÎÄ£¬´ó...
±¾ÎÄÊǼܹ¹Web·þÎñµÄϵÁÐÎÄÕµĵÚÁùƪ£¬Ò²ÊÇ×îºóһƪ£¬Îı¾ÒÔÇ°ÎÄΪ»ù´¡£¬ÔÚÇ°ÎĵÄÓ¦ÓÃʵÀýµÄ»ù´¡ÉÏ£¬¿¼²ìÁË·¢²¼Web·þÎñ½çÃæµÄÕû¸ö¹ý³Ì£ºXML Schema½¨Ä£¡¢WSDL·¢²¼ºÍUDDI×¢²á¡£Í¨¹ý±¾ÎÄ£¬´ó¼Ò¿ÉÒÔÏêϸ¾ßÌåµØÁ˽â¸÷¸öXMLºÍWeb ServiceµÄϵÁй淶ÔÚWeb ServiceµÄ·¢²¼Ê±ËùÆðµÄ×óÓÒ£¬¶ÔWeb Service¼¼ÊõÒ²½«ÓÐÒ»¸öÉîÈëµÄÀí½â¡£
ÔÚÇ°ÎÄÖУ¬ÎÒÒѾ­½éÉܹý£¬Web·þÎñÊÇͨ¹ýSOAPÏûÏ¢µ÷Óõģ¬Í¨¹ýWSDL½øÐнçÃæÃèÊöµÄ£¬ÒÔ¼°Í¨¹ýUDDI½øÐй«¹²×¢²á·¢²¼µÄ¡£ÔÚǰһƪÎÄÕÂÖУ¬ÎÒÒѾ­½éÉÜÁËÈçºÎ½øÐÐSOAP APIµÄÏûÏ¢¶¨Ò壬ÄÇôÔÚ±¾ÎÄÖУ¬ÎÒ½«µ¥°Ñsave_categoryÌá³öÀ´£¬¿´¿´ÔÚ¾ßÌåµÄʵÏÖÉÏ£¬Ó¦µ±ÈçºÎ¶ÔÕâ¸öÏûϢʹÓÃW3C XML Schema½øÐн¨Ä££¬Èç¹ûʹÓÃWSDL½«»ùÓÚ¸ÃÏûÏ¢µ÷ÓõÄWeb·þÎñ½øÐй淶ÃèÊö²¢½»¸¶µ÷ÓÃÕߣ¬ÒÔ¼°ÈçºÎ½«Õâ¸öWeb·þÎñÁ¬Í¬ËüµÄWSDL¹æ·¶»¯ÃèÊöÎļþÒ»Æð·¢²¼µ½UDDI×¢²áÖÐÐÄÖÐÈ¥¡£Ï£Íû´ó¼ÒÄÜͨ¹ý±¾ÎĵÄʵÀý½²½â£¬ÔÚ±¾ÏµÁеÄ×îºóÍêÕûµØÁ˽âWeb·þÎñµÄ¹¤×÷Ô­ÀíºÍÏà¹Ø¼¼Êõ¹æ·¶µÄ×÷Óá£

±¾ÎÄËùÒýÓõÄ×ÊÔ´Ö÷Òª°üÀ¨Á½À࣬һÀàÊÇWeb·þÎñµÄ¼¼Êõ×ÊÔ´ÍøÕ¾£¬°üº¬ÁË´óÁ¿Web·þÎñµÄ¼¼ÊõÐÅÏ¢£¬ÁíÒ»ÀàÊÇWeb·þÎñ¡°stack"ϵÁм¼Êõ¹æ·¶£¬ËûÃÇÊÇÒ»¸öÕûÌåµÄ¼¼ÊõÌåϵ£¬°üÀ¨UDDI¡¢SOAP¡¢WSDL¡¢XML Schema, XMLµÈ¡£±¾ÎĵÄ×îºó¸ø³öÁËÕâЩ×ÊÔ´µÄÁ´½Ó£¬ÓÐÐËȤµÄ¶ÁÕß¿ÉÒÔͨ¹ýÕâЩ×ÊÔ´Á´½ÓÕÒµ½ËùÐèµÄÄÚÈÝ¡£

SOAPÏûϢʾÀý

ÒÔÏÂÊÇÒ»¸ösave_categoryµÄµ÷ÓÃÀý×Ó£¬ÔÚÀý×ÓÖÐʹÓÃÁËSOAP HTTP Binding(ʹÓõÄSOAP¹æ·¶µÄ°æ±¾ÊÇ1.2)£¬¼ÙÉèÄ¿±êWeb·þÎñ±»²¿ÊðÔÚwww.sagitta.com£¬¶øµ÷ÓõÄWeb·þÎñµÄÈë¿ÚλÖý«ÊÇhttp://www.sagitta.com/catalog/¡£

ÔÚÕâ¸öÏûÏ¢ÖУ¬½«ÔÚÒ»¸öÏÖÓеÄcategoryÖÐÌí¼ÓÒ»¸öеÄcategoryºÍÒ»¸öеÄproduct¡£


POST /catalog HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length:
SOAPAction: "http://www.sagitta.com/catalog/"
Host: www.sagitta.com

<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xml:env="http://www.w3.org/2001/06/soap-envelope"gt;
<env:Body>
<ave_category xml="http://www.sagitta.com/schema/"gt;
<authInfo>5Az784kJceHCE982elt;/authInfo>
<category categoryKey="cb4e17d1-6100-47f6-a532-cd9cbd30c073" parentCategoryKey="ab4e3de1-7865-f2c1-b49a-beccbd21c072"gt;
<ame>Coumer Electroniclt;/name>
<descriptiogtroduct Category for Coumer Electronics </descriptiogt;
<category categoryKey="quot; parentCategoryKey="cb4e17d1-6100-47f6-a532-cd9cbd30c073"gt;
<ame>ONY Coumer Electroniclt;/name>
<descriptiogtony's Product Category for Coumer Electroniclt;/descriptiogt;
</category>
<roduct productKey="quot; parentCategoryKey=" cb4e17d1-6100-47f6-a532-cd9cbd30c073"gt;
<ame>DSC-S75 Digital Camera</name>
<descriptiogtony's Brand-New Profeional Digital Camera</descriptiogt;
<compliantecBag>
<ecification ecificationKey="Key[U1.1]" />
</compliantecBag>
<featureBag>
<feature>¡­¡­</feature>
<feature>¡­¡­</feature>
</featureBag>
<arameterBag>
¡­¡­
</parameterBag>
</product>
</category>
</save_category>
</env:Body>
</env:Envelope>



¸Ãµ÷ÓÃÏûÏ¢µÄ·µ»ØÏûÏ¢¿ÉÄÜÊÇ£º

HTTP/1.1 200 OK
Content-Type: text/xml; charset="utf-8"
Content-Length:

<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xml:env="http://www.w3.org/2001/06/soap-envelope"gt;
<env:Body>
<categoryList xml="http://www.sagitta.com/schema/"gt;
<category categoryKey="cb4e17d1-6100-47f6-a532-cd9cbd30c073" parentCategoryKey="ab4e3de1-7865-f2c1-b49a-beccbd21c072"gt;
<category categoryKey="8933aa50-3aaf-11d5-80dc-002035229c64" parentCategoryKey="cb4e17d1-6100-47f6-a532-cd9cbd30c073" />
<roduct productKey="89307600-3aaf-11d5-80dc-002035229c64" parentCategoryKey="cb4e17d1-6100-47f6-a532-cd9cbd30c073" />
</category>
</categoryList>
</env:Body>
</env:Envelope>



´ÓÖÐÎÒÃÇ¿ÉÒÔ¿´µ½ÔÚsave_categoryºÍcategoryListÁ½¸öÔªËغóÃ涼´øÁËÒ»¸öxmlµÄÐÞÊÎ"http://www.sagitta.com/schema/"¡£ÕâURIΨһ±íʾÁ˸ÃÔªËؼ°ÆäËùÓÐ×ÓÔªËصĵÄÃüÃû¿Õ¼ä¡£Í¬Ê±Í¨¹ýÕâ¸öURL¿ÉÒÔ»ñµÃÕâЩԪËصÄSchema¶¨Òå¡£

ʹÓÃW3C XML SchemaÃèÊöµÄXMLÎĵµµÄģʽ¶¨ÒåÔÚÕû¸öWeb·þÎñµÄ¼¼ÊõϵÁÐÖд¦ÓÚÒ»¸öÖ§³Ö¹¤¾ßµÄµØλ¡£W3C XML SchemaÊÇÈκÎÀàÐ͵ÄXMLÎĵµµÄ½¨Ä£¹¤¾ß¡£ÔÚWeb·þÎñÌåϵÖУ¬ÎÞÂÛÔÚSOAPÏûÏ¢µÄ±íʾÉÏ£¬»¹ÊÇÔÚWSDLµÄ½çÃæÃèÊöÉÏ£¬XML Schema¶¼ÊDz»¿ÉȱÉÙµÄÖØÒª¹¤¾ßºÍµ×²ãÖ§³Ö¡£

ÏÂÃæÎÒ½«´ÓXML Schema¿ªÊ¼£¬Õë¶Ôsave_categoryÕâ¸öÏûÏ¢(ͬʱҲ¶ÔÓ¦Ò»¸ö·þÎñÈë¿Ú)ÖðÒ»½éÉÜÈçºÎΪÎÒÃǵÄXMLÏûÏ¢½øÐÐXML Schema½¨Ä££¬ÈçºÎʹÓÃWSDL½«save_categoryÕâ¸ö·þÎñÈë¿Ú½øÐнçÃæÃèÊö£¬È»ºó½«Õâ¸öÈë¿Ú·¢²¼µ½UDDI×¢²áÖÐÐÄÖÐÈ¥¡£

XML Schema½¨Ä£

XML SchemaµÄÎļþºó׺ÊÇ.xsdÎļþ£¬Ò»¸öXML SchemaÖеĶ¨Òåͨ³£·ÖΪÁ½²¿·Ö£¬ÐÍ(Type)¶¨ÒåºÍÔªËØ(Element)¶¨Òå¡£ÏÂÃæÎÒÃǽáºÏsave_category¾ßÌåµÄXML Schema¶¨ÒåÀ´ËµÃ÷ÈçºÎʹÓÃXML SchemaÀ´ÊµÏÖģʽ¶¨Òå¡£

ÔÚÏÂÃæµÄXML SchemaÎĵµÖУ¬ÐͶ¨Òå°üÀ¨£ºcompliantecBag£¬featureBag£¬parameter£¬parameterBag£¬productºÍcategoryÁù¸öÀàÐÍ£¬¶øÔªËض¨ÒåΪsave_categoryÕâÒ»¸öÔªËØ¡£

save_categoryµÄXML SchemaÃèÊö¶¨Ò壺(ÍêÕûµÄXML SchemaÎĵµÊÇ£ºsagitta.xsd)


<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xml:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"gt;



ÒÔÉÏÊÇXML SchemaµÄÎļþÍ·¡£


<xs:complexType name="compliantecBag"gt;
<xs:sequence>
<xs:element name="ecificatioquot; minOccurs="0" maxOccurs="uounded"gt;
<xs:complexType>
<xs:simpleContent>
<xs:exteion base="xs:string"gt;
<xs:attribute name="ecificationKey" type="xs:string" use="required"/>
</xs:exteiogt;
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>



ÔÚÕâ¶ÎSchemaÃèÊöÖУ¬ÃèÊöÁËcompliantecBagÕâ¸öÔªËØÀàÐÍ£¬ÈκÎʹÓÃcompliantecBagÀàÐ͵ÄÔªËØ¿ÉÒÔ°üº¬µÄÔªËØÊÇecification£¬Õâ¸öÔªËØ¿ÉÒÔ³öÏÖ0´Îµ½ÎÞÇî´Î(ÎÞÏÞÖÆ£¬ÊÂʵÉϲ»¿ÉÄܳöÏÖÎÞÇî´Î)£¬¶øecificationÕâ¸öÔªËØÖаüº¬Ò»¸öÊôÐÔecificationKey£¬¸ÃÊôÐÔÊDZØÐëµÄ£¬Í¬Ê±ÀàÐÍΪ×Ö·û´®(xs:string)¡£xsÕâ¸öÃüÃû¿Õ¼äÊÇW3C XML Schema 2001µÄÃüÃû¿Õ¼ä(nameace)¡£


<xs:complexType name="featureBag"gt;
<xs:sequence>
<xs:element name="feature" type="xs:string" minOccurs="0" maxOccurs="uounded"/>
</xs:sequence>
</xs:complexType>



ÔÚÕâÀÃèÊöÁËfeatureBagÕâ¸öÔªËØÀàÐÍ£¬ÈκÎʹÓÃfeatureBagÀàÐ͵ÄÎĵµÔªËØ¿ÉÒÔ°üº¬µÄ×ÓÔªËØÊÇfeature£¬¶øfeatureÔªËØÄܹ»³öÏÖ0´Îµ½ÎÞÇî´Î(ÎÞÏÞÖÆ£¬ÊÂʵÉϲ»¿ÉÄܳöÏÖÎÞÇî´Î)¡£¸ÃÔªËصÄÄÚÈݵÄÀàÐÍÊÇ×Ö·û´®(xs:string)¡£


<xs:complexType name="arameter"gt;
<xs:sequence>
<xs:element name="keyName" type="xs:string"/>
<xs:element name="keyValue" type="xs:string"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="arameterBag"gt;
<xs:sequence>
<xs:element name="arameter" type="arameter" minOccurs="0" maxOccurs="uounded"/>
</xs:sequence>
</xs:complexType>



ÕâÀïÊ×ÏÈÃèÊöÁËparameterÕâ¸öÔªËØÀàÐÍ£¬ÈκÎʹÓÃparameterÀàÐ͵ÄÎĵµÔªËØ¿ÉÒÔ°üº¬µÄ×ÓÔªËØÓÐÁ½¸ökeyNameºÍkeyValue£¬ËüÃǶ¼ÊDZØÐë³öÏÖµÄ×ÓÔªËØ£¬Í¬Ê±½ö¿É³öÏÖÒ»´Î¡£ËûÃǵÄÀàÐÍÒ²¶¼ÊÇ×Ö·û´®(xs:string)¡£È»ºóÃèÊöµÄÊÇparameterBagÔªËØÀàÐÍ£¬ÈκÎʹÓÃparameterBagÀàÐ͵ÄÎĵµÔªËØ¿ÉÒÔ°üº¬µÄ×ÓÔªËØÊÇparameter£¬¶øÕâ¸ö×ÓÔªËصÄÀàÐÍÊÇÏÈÇ°¶¨ÒåµÄparameter(ÔÚXML SchemaÖУ¬ÀàÐÍÃûºÍÔªËØÃûµÄÓò¿Õ¼äÊÇÕý½»µÄ£¬²»ÐèÒª¿¼ÂÇÈκεÄÃû×ÖÖظ´ÎÊÌâ)£¬parameterÔªËسöÏֵĴÎÊý¿ÉÒÔÊÇ´Ó0´Îµ½ÎÞÇî´Î¡£


<xs:complexType name="roduct"gt;
<xs:sequence>
<xs:element name="ame" type="xs:string"/>
<xs:element name="descriptioquot; type="xs:string"/>
<xs:element name="compliantecBag" type="compliantecBag"/>
<xs:element name="featureBag" type="featureBag"/>
<xs:element name="arameterBag" type="arameterBag"/>
</xs:sequence>
<xs:attribute name="roductKey" type="xs:string" use="required"/>lt;xs:attribute name="arentCategoryKey" type="xs:string" use="required"/>
</xs:complexType>



ÕâÀïÃèÊöÁËproductÕâ¸öÔªËØÀàÐÍ£¬ÈκÎʹÓÃproductÀàÐ͵ÄÎĵµÔªËØ¿ÉÒÔ°üº¬µÄ×ÓÔªËØÊÇname¡¢description¡¢compliantecBag¡¢featureBag¡¢parameterBag¡£nameºÍdescriptionÔªËصÄÀàÐͶ¼ÊÇxs:string¡£¶øcompliantecBag¡¢featureBag¡¢parameterBagµÄÀàÐÍ´ó¼Òͨ¹ý²é¿´Õâ¶ÏXML Schema¶¨ÒåÒ²¿ÉÒÔºÜÇå³þµØ·¢ÏÖÊÇÒýÓÃÁËÇ°Ã涨ÒåµÄÕâЩÀàÐͶ¨Òå¡£ÈκÎʹÓÃproductÀàÐ͵ÄÎĵµÔªËØ»¹ÓÐÁ½¸ö±ØÐë³öÏÖµÄÊôÐÔproductKeyºÍparentCategoryKey£¬ÕâÊÇÁ½¸ö×Ö·û´®(xs:string)ÀàÐ͵ÄÊôÐÔÖµ£¬·Ö±ð±íʾÁË×ÔÉíÔªËصļüÖµºÍ¸¸±²categoryµÄ¼üÖµ¡£


<xs:complexType name="category"gt;
<xs:sequence>
<xs:element name="ame" type="xs:string"/>
<xs:element name="descriptioquot; type="xs:string"/>
<xs:element name="category" type="category" minOccurs="0" maxOccurs="uounded"/>
<xs:element name="roduct" type="roduct" minOccurs="0" maxOccurs="uounded"/>
</xs:sequence>
<xs:attribute name="categoryKey" type="xs:string" use="required"/>
<xs:attribute name="arentCategoryKey" type="xs:string" use="required"/>
</xs:complexType>



ÕâÊÇcategoryÔªËØÀàÐ͵ÄÃèÊö£¬ÈκÎʹÓÃproductÀàÐ͵ÄÎĵµÔªËØ¿ÉÒÔ°üº¬µÄ×ÓÔªËØÊÇname¡¢description¡¢categoryºÍproduct¡£nameºÍdescriptionÔªËصÄÀàÐͶ¼ÊǼòµ¥ÀàÐÍxs:string¡£¶øcategoryÊÇÒ»¸öµÝ¹éÔªËØ£¬ÒýÓÃÁË×ÔÉíÕâ¸öÔªËØÀàÐÍ¡£¶øproductµÄÔªËØÀàÐÍÔòÊÇÇ°ÃæÃèÊöºÃµÄproductÀàÐÍ¡£ÈκÎʹÓÃproductÀàÐ͵ÄÎĵµÔªËØ»¹ÓÐÁ½¸ö±ØÐë³öÏÖµÄÊôÐÔcategoryKeyºÍparentCategoryKey£¬ÕâÊÇÁ½¸ö×Ö·û´®(xs:string)ÀàÐ͵ÄÊôÐÔÖµ£¬·Ö±ð±íʾÁË×ÔÉíÔªËصļüÖµºÍ¸¸±²categoryµÄ¼üÖµ¡£


<xs:element name="ave_category"gt;
<xs:complexType>
<xs:sequence>
<xs:element name="authInfo" type="xs:base64Binary"/>
<xs:element name="category" type="category" minOccurs="0" maxOccurs="uounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>



ÕâÊÇÔÚÕâ¸öSchemaÎĵµÖÐΨһµÄÒ»¸öÔªËض¨Ò壬ԪËØsave_categoryÊÇÒ»¸ö¸´ºÏÀàÐÍ£¬ËüµÄÔªËØ¿ÉÒÔÓÐauthInfoºÍcategory¡£ÆäÖÐauthInfoÊÇÒ»¸öbase64±àÂëµÄ×Ö·û´®£¬¶øcategoryÔòÊÇÒ»¸ö¿ÉÒÔ³öÏÖ0´Îµ½ÎÞÏ޴εÄÀàÐÍΪcategoryµÄ×ÓÔªËØ¡£ÎÒÃDz»ÄÑ·¢ÏÖÔªËض¨ÒåºÍÀàÐͶ¨ÒåµÄ»ù±¾»úÖÆÊÇÒ»ÑùµÄ£¬ÊÂʵÉÏ£¬ÎÒÃÇÍêÈ«¿ÉÒÔ½«Õâ¶Î¶¨Òå²ð·Ö³ÉÁ½¶Î£¬Ò»¶ÎΪÀàÐͶ¨Ò壬һ¶ÎΪԪËض¨Ò壬ÏÂÃæ¸ø³öÕâ¸öµÈ¼ÛʵÀý£¬Ï£ÍûÓÐÖúÓÚ¶ÔSchemaµÄÀí½â¡£


<xs:complexType name="ave_category"gt;
<xs:sequence>
<xs:element name="authInfo" type="xs:base64Binary"/>
<xs:element name="category" type="category" minOccurs="0" maxOccurs="uounded"/>
</xs:sequence>
</xs:complexType>

<xs:element name="ave_category" type="ave_category" />



ÄÇΪʲôҪ²ÉÓõÚÒ»ÖÖ·½·¨£¬¶ø²»Ê¹ÓõڶþÖÖ·½·¨ÄØ£¬Ô­ÒòÒ²ºÜ¼òµ¥£¬ÓÉÓÚÕû¸öWeb·þÎñÏà¹ØµÄÏûÏ¢SchemaÖУ¬ÖîÈçcategory¡¢product¡¢featureBag¡¢compliantecBag¡¢parameterBagÕâЩԪËض¼¿ÉÄܱ»¸´Óã¬Òò´Ë¶¨Òå³ÉÀàÐͱȽϺÏÊÊ£¬¶øsave_categoryÊÇÒ»¸öµ¥Ò»µÄÏûÏ¢£¬²»¿ÉÄܱ»ÆäËûÔªËظ´Óã¬Òò´Ë¾ÍÖ±½Ó¶¨Òå³ÉÁËÔªËØ¡£


</xs:schema>
×îºó£¬ÎÒ¸ø³ö¶ÔÓ¦±¾½ÚÃèÊöµÄsave_categoryÔªËصÄSchema¶¨ÒåµÄSchemaͼʾÀ´½áÊø±¾Ð¡½Ú¡£

Figure 1. SOAP API Schemaͼʾ


WSDL·þÎñÃèÊö

¶ÔSOAP APIÏûÏ¢Íê³ÉSchema½¨Ä£Ö®ºó£¬Ò»·½ÃæÕâ¸öÊý¾ÝÄ£ÐÍ¿ÉÒÔÓÉSOAP InterfaceÀ´Ê¹Ó㬵±·¢Éú¾ßÌåµ÷ÓÃʱ¿ÉÒÔʹÓÃÕâ¸öÊý¾ÝÄ£ÐÍÀ´³ýÁË´«ÈëµÄ²ÎÊý²¢Éú³É´«³öµÄ²ÎÊý¡£Í¬Ê±£¬ÀûÓÃÕâ¸öÊý¾ÝÄ£ÐÍ£¬ÎÒÃÇ¿ÉÒÔÉú³ÉÏàÓ¦µÄWSDLÃèÊö£¬´Ó¶ø½«Õâ¸öWeb·þÎñµÄ½Ó¿ÚÎĵµ·¢²¼¸øʹÓÃÕߣ¬¸Ã½Ó¿ÚÎĵµÊǾ߱¸±»³ÌÐò×Ô¶¯´¦ÀíµÄÄÜÁ¦µÄ¡£

ÒÔÏÂÊÇWSDLÎĵµÏêϸµÄ¶¨Ò壺(ÍêÕûµÄWSDLÎĵµÊÇ: sagitta.wsdl)


<?xml version="1.0"?>
<definitio name="catalogService"
targetNameace="http://www.sagitta.com/wsdl/savecategory.wsdl"
xml:t="http://www.sagitta.com/wsdl/savecategory.wsdl"
xml:myxs="http://www.sagitta.com/schema/"
xml:soap="http://www.w3.org/2001/06/soap-envelope"
xml="http://schemas.xmlsoap.org/wsdl/"gt;

<import nameace="http://www.sagitta.com/schema/" location=" http://www.sagitta.com/schema/save_category.xsd" />



ÕâÊÇWSDLÎļþµÄÎļþÍ·£¬ÆäÖеÄimportÔªËØÖ¸Ã÷ÔÚÕâ¸öWSDLÎļþÖУ¬typesϵͳÊÇÓÉhttp://www.sagitta.com/schema/save_category.xsdÎļþ¾ßÌåÃèÊö£¬ÔÚÕâÀï½ö½öÊǽ«Æäµ¼Èë¡£


<meage name="ave_category"gt;
<art name="ody" element="myxs:save_category"/>
</meage>

<meage name="categoryList"gt;
<art name="ody" element="myxs:categoryList"/>
</meage>



ÕâÀﶨÒåÁËÁ½ÌõÏûÏ¢£ºsave_categoryÏûÏ¢£¬ÔÚÇ°ÃæµÄSchema½¨Ä£ÖÐÒѾ­ÍêÕûµØ´´½¨Á˸ùÔªËصĽṹ¶¨Òå¡£ÆäÖÐmyxsÊÇÕâÀïʹÓõÄÃüÃû¿Õ¼ä(nameace)£¬ÃüÃû¿Õ¼äµÄ¾ßÌ嶨ÒåÔÚÎļþÍ·ÉϳöÏÖ¡£¶øcategoryList½«»á¶ÔÓ¦save_categoryÏûÏ¢µÄ·µ»ØÏûÏ¢£¬ÔÚSchema½¨Ä£ÖÐûÓбíÏÖ£¬ÔÚÕâÀïÎÒÒ²½öÁгöÒ»¸öÔªËØÃû£¬ÏàÐÅ´ó¼ÒÔÚ¿´Á˱¾ÎĵÄÇ°°ë²¿·ÖÒÔ¼°±¾ÏµÁеÄǰһƪÎÄÕÂÖ®ºó£¬»áºÜÇå³þÈçºÎÀ´¶¨Òå¡£


<ortType name="ave_category_portType"gt;
<operation name="ave_category_operatioquotgt;
<iut meage="t:save_category"/>
<output meage="t:categoryList"/>
</operatiogt;
</portType>



Õⲿ·Ö¶¨ÒåÁË·þÎñ·ÃÎʵãµÄµ÷ÓÃģʽµÄÀàÐÍ£¬±íÃ÷Õâ¸öÈë¿ÚÀàÐÍÊÇÇëÇó/ÏìӦģʽ£¬ÇëÇóÏûÏ¢ÊÇsave_category£¬¶øÏìÓ¦ÏûÏ¢ÊÇcategoryList¡£


<inding name="ave_category_soainding" type=" save_category_portType "gt;
<oap:binding style="document" traort=" http://www.w3.org/2001/06/soap-envelope/httquotgt;
<operation name="ave_category_operatioquotgt;
<oap:operation soapAction=" http://www.sagitta.com/catalog/"gt;
<iut>
<oap:body use="literal" nameace=" http://www.sagitta.com/schema/"
encodingStyle=" http://www.w3.org/2001/06/soap-encoding"/>
</iut>
<output>
<oap:body use="literal" nameace=" http://www.sagitta.com/schema/"
encodingStyle=" http://www.w3.org/2001/06/soap-encoding"/>
</output>
</soap:operatiogt;
</operatiogt;
</soap:binding>
</binding>



Õⲿ·Ö½«·þÎñ·ÃÎʵãµÄ³éÏó¶¨ÒåÓëSOAP HTTP°ó¶¨£¬ÃèÊöÈçºÎͨ¹ýSOAP/HTTPÀ´·ÃÎÊ°´ÕÕÇ°ÃæÃèÊöµÄ·ÃÎÊÈë¿ÚµãÀàÐͲ¿ÊðµÄ·ÃÎÊÈë¿Ú¡£ÆäÖй涨ÁËÔÚ¾ßÌåSOAPµ÷ÓÃʱ£¬Ó¦µ±Ê¹ÓõÄsoapActionÊÇ"http://www.sagitta.com/catalog/"£¬¶øÇëÇó/ÏìÓ¦ÏûÏ¢µÄ±àÂë·ç¸ñ¶¼Ó¦µ±²ÉÓÃSOAP¹æ·¶Ä¬È϶¨ÒåµÄ±àÂë·ç¸ñ" http://www.w3.org/2001/06/soap-encoding "¡£


<ervice name="catalogService"gt;
<documentatiogt;Online Web Service for Catalog</documentatiogt;
<ort name="ave_category_port" binding="t:save_category_soainding"gt;
<oap:addre location="http://www.sagitta.com/catalog/"/>
</port>
</service>

</definitiogt;



Õⲿ·ÖÊǾßÌåµÄWeb·þÎñµÄ¶¨Ò壬ÔÚÕâ¸öÃûΪcatalogServiceµÄWeb·þÎñÖУ¬ÌṩÁËÒ»¸ö·þÎñ·ÃÎÊÈë¿Ú(Æäʵ»¹Óкܶ࣬²»¹ýÔÚÕâÀïÒòΪÑÝʾµÄÔ­Òò£¬½ö½ö½éÉÜÁËÒ»¸ö)£¬·ÃÎʵØÖ·ÊÇ"http://www.sagitta.com/catalog/"£¬Ê¹ÓõÄÏûϢģʽÊÇÓÉÇ°ÃæµÄbindingËù¶¨ÒåµÄ¡£

UDDI·þÎñ·¢²¼

ÔÚÇ°Ò»½ÚÖУ¬ÎÒÃÇÒѾ­Í¨¹ýʹÓÃWSDLÕâ¸ö¹¤¾ß½«Catalog ServiceÕâ¸öWeb·þÎñ½øÐÐÁ˽ṹ»¯µØÃèÊö¡£ÎªÁËʹ¸ü¶àµÄDZÔÚÓû§Äܹ»·¢ÏÖÕâ¸öWeb·þÎñ£¬Í¬Ê±Ò²ÎªÁ˼ÓÇ¿Õâ¸öWeb·þÎñµÄ»¥²Ù×÷ÄÜÁ¦ºÍÔÖÄѻָ´Ê±µÄÁ¬½Ó±£³ÖÄÜÁ¦£¬ÎÒÃÇÐèҪʹÓÃUDDI SDK½«Õâ¸öWeb·þÎñ×¢²áµ½UDDI×¢²áÖÐÐÄÖÐÈ¥¡£

¼ÙÉèÎÒÃÇ֮ǰÒѾ­×¢²áÁËÒ»¸öbusineEntity£¬½Ð×öwww.sagitta.com£¬Ò»¸öÔÚÏß·þÎñÌṩÉÌ£¬Õâ¸öbusineEntityµÄ¼üÖµÊÇ"434554F4-6E17-1342-EA41-36E642531DA1"£¬ÄÇôÎÒÃÇÒªÔÚÕâ¸öbusineEntityÏÂ×¢²áÒ»¸öbusineervice£¬ÒÔÓÃÓÚÃèÊöÇ°ÃæµÄCatalog Service¡£Í¬Ê±ÐèÒª³ÉÁ¢µÄ¼ÙÉèÊÇÎÒÃÇÒ²Ô¤ÏÈ×¢²áÁËÒ»¸öService Type(tModel)£¬Õâ¸ötModelÃèÊöÁËÎÒÃÇÕâ¸öÐèÒª·¢²¼µÄWeb·þÎñµÄµ÷Óù淶£¬¾ßÌåÄÚÈÝÊÇÇ°ÃæÎÒ¶¨ÒåµÄÕâ¸öWSDLÎĵµ£¬ÔÚUDDIÖУ¬×¢²áµÄÊÇÃèÊöµÄÁ´½Ó¡£

busineervice×¢²áµÄSOAPÏûÏ¢ÈçÏ£¬ÆäÖÐʹÓÃÁËMicrosoftµÄtest.uddi.microsoft.comÕ¾µã£¬Òò´ËauthInfoÖпÉÒÔÌîÈë²âÊÔÓõÄudditest¡£


<?xml version="1.0" encoding="UTF-8"?>
<Envelope xml="http://schemas.xmlsoap.org/soap/envelope/"gt;
<ody>
<ave_service generic="1.0" xml="urn:uddi-org:api"gt;
<authInfo>udditest</authInfo>
<usineervice busineKey="434554F4-6E17-1342-EA41-36E642531DA1" serviceKey="quotgt;
<ame>categoryService</name>
<description xml:lang="equotgt;Online Web Service for Catalog</descriptiogt;
<indingTemplategt;
<indingTemplate bindingKey="quot; serviceKey="quotgt;
<description xml:lang="equotgt;categoryService's BindingTemplate3</descriptiogt;
<acceoint URLType="httquotgt;http://www.sagitta.com/catalog/</acceoint>
<tModelItanceDetailgt;
<tModelItanceInfo tModelKey="uuid:E31ºÚ¿Í·ÀÏß69A-AEFF-4468-BA4D-2BF22FE4ACEF"gt;
<description xml:lang="equotgtagitta Web Service Type Descriptiolt;/descriptiogt;
<itanceDetailgt;
<description xml:lang="equotgtagitta Web Service Type Descriptiolt;/descriptiogt;
<overviewDoc>
<description xml:lang="equotgtagitta Web Service Overview</descriptiogt;
<overviewURL>http://www.sagitta.com/wsdl/savecategory.wsdl</overviewURL>
</overviewDoc>
</itanceDetailgt;
</tModelItanceInfo>
</tModelItanceDetailgt;
</bindingTemplate>
</bindingTemplategt;
</busineervice>
</save_service>
</Body>
</Envelope>



ͨ¹ýÉÏÊöµÄAPIµ÷Óã¬ÎÒÃǾÍÒѾ­°ÑÕâ¸ö·þÎñ×¢²á½øÁËUDDI×¢²áÖÐÐÄ£¬ÆäÖÐbindingTemplateµÄacceointÊÇ·þÎñµÄÈë¿Ú£¬¶øoverviewDocÖеÄoverviewURLÊÇWSDLÎĵµµÄ·ÃÎÊλÖá£

DZÔÚµÄʹÓÃÕß¿ÉÒÔͨ¹ý²éѯUDDI×¢²áÖÐÐÄÕÒµ½Õâ¸öWeb·þÎñ£¬Í¨¹ýoverviewURLÖб£´æµÄURLÕÒµ½·þÎñµÄÃèÊö£¬È»ºóͨ¹ýacceointËùÖ¸¶¨µÄ·ÃÎʵØÖ·À´·ÃÎÊÕâ¸ö·þÎñ¡£

µ±·¢Éú½ô¼±·þÎñ±ÀÀ£µÄʱºò£¬Web·þÎñ¿ÉÄܱ»Ç¨ÒƵ½Áíһ̨Ö÷»úÉÏ£¬IPµØÖ·£¬ÉõÖÁÊÇ·ÃÎʵÄURL¶¼¿ÉÄÜÓкܴó±ä»¯£¬´ËʱԭÏȵļ¯³ÉµÄÁ¬½Ó½«²»ÔÙ¹¤×÷¡£µ«ÊÇÓÉÓÚUDDI×¢²áµÄ´æÔÚ£¬ÎÒÃÇ¿ÉÒÔͨ¹ý×Ô¶¯»¯µÄ³ÌÐòÊÖ¶ÎÀ´½â¾öÕâ¸öÎÊÌ⣬ʹµÃÀàËƵķþÎñÔÖÄѻָ´µÄ¹ý³Ì·Ç³£Ñ¸ËÙ¡£

¾ßÌåµÄÁ÷³ÌÒ»°ãÊÇ£º

µ±»Ö¸´µÄ·þÎñÆô¶¯ºó£¬×Ô¶¯È¥¸üÐÂUDDI×¢²áÖÐÐÄÉϵÄÊý¾Ý£¬½«·ÃÎÊÈë¿ÚÐ޸ĵ½ÐµÄURLλÖÃ;
Á¬ÈëµÄ¿Í»§¶Ëϵͳµ±·¢ÏÖÎÞ·¨·ÃÎÊ×îÖÕ·þÎñµÄʱºò£¬½«»á¶¨ÆÚÈ¥²éѯUDDI×¢²áÖÐÐÄ£¬¿´¿´ÐµÄBindingTemplateÊý¾ÝºÍ±¾µØ»º´æµÄÓÐûÓвî±ð£¬Èç¹ûÓеĻ°£¬¾ÍÏÂÔص½±¾µØ£¬ÖØн¨Á¢·þÎñ°ó¶¨£¬Íê³É·þÎñÁ¬½ÓµÄǨÒÆ¡£
×ܽá

µ½ÕâƪÎÄÕÂΪֹ£¬ÈçºÎ¼Ü¹¹Web ServiceÕâ¸öϵÁоͽ«¸æÒ»¶ÎÂ䣬ÔÚÕû¸öϵÁÐÖУ¬´ÓΪʲôҪÓÐWeb·þÎñ¿ªÊ¼£¬µ½Ê²Ã´ÊÇWeb·þÎñ£¬Web·þÎñµÄ¿ª·¢¹¤¾ß£¬¶ÔWeb·þÎñ×÷ÁËÒ»¸ö¸ÅÄîÉϵÄÈ«Ãæ½éÉÜ¡£È»ºóÒÔÒ»¸ö¾ßÌåʵÀýÀ´½éÉÜWeb·þÎñµÄ¹¹½¨Ä£Ê½ºÍ¸÷ÖÖWeb Service "tack"¼¼ÊõµÄ¾ßÌåÓ¦Óá£Ï£ÍûÕâ¸öϵÁжԴó¼ÒÀí½âºÍ½ÓÊÜÏÂÒ»´úµÄÓ¦ÓðüװģʽWeb·þÎñÓÐÒ»¸öÈ«ÃæµÄ°ïÖú¡£


    ºÚ¿Í·ÀÏßÍø°²·þÎñÆ÷ά»¤·½°¸±¾ÆªÁ¬½Ó£ºhttp://www.rongsen.com.cn/show-19290-1.html
Íøվά»¤½Ì³Ì¸üÐÂʱ¼ä:2012-12-08 13:54:12  ¡¾´òÓ¡´ËÒ³¡¿  ¡¾¹Ø±Õ¡¿
ÎÒÒªÉêÇë±¾Õ¾£ºNµã | ºÚ¿Í·ÀÏß¹ÙÍø |  
רҵ·þÎñÆ÷ά»¤¼°Íøվά»¤ÊÖ¹¤°²È«´î½¨»·¾³£¬ÍøÕ¾°²È«¼Ó¹Ì·þÎñ¡£ºÚ¿Í·ÀÏßÍø°²·þÎñÆ÷ά»¤»ùµØÕÐÉ̽øÐÐÖУ¡QQ:29769479

footer  footer  footer  footer