介绍一篇使用WebService的文章
由 lwz7512 于 03月30日 2009编辑 分类: Flex技巧
这篇文章通过对比webservice组件两种用法的不同,详细解释了其中各种属性的含义,比如service、port、endpointURI、wsdl的取值:
service—-> WSDL文件中的<service name=”WSServiceName”>;
port —-> <port name=”WSPort” binding=”tns:SOAPbinding”>
endpointURI —-> <soap:address location=”http://abc.com/soap”/>中的location
wsdl就是SOAP endpoint URI with a “?WSDL”
并指出使用跨域webservice的策略:
<?xml version=”1.0″?>
<!DOCTYPE cross-domain-policy SYSTEM “http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd”> <cross-domain-policy>
<site-control permitted-cross-domain-policies=”all” />
<allow-access-from domain=”*” secure=”false”/>
<allow-http-request-headers-from domain=”*” headers=”*” secure=”false” />
</cross-domain-policy>
此外难能可贵的是给出了利用blazeds和lcds的代理服务来解决跨域问题瓶颈:
Please open the proxy-config.xml, and add the following xml snippet within the service xml tag.
<destination id=”sampleDestination”>
<adapter ref=”soap-proxy”/>
<properties>
<wsdl>http://abc.com/wsdl</wsdl>
<soap>http://abc.com/soap</soap>
</properties>
</destination>