我想在JavaScript中使用XML SOAP Web服务来创建Firefox Addon,但我想要使用的Web服务是在安全的https连接下。如何通过安全的https连接在JavaScript中使用基于soap xml的web服务?
我下载不使用安全连接工作soapclient.js库。我怎么解决这个问题?有没有现有的有用的JS库?
编辑: 这是显示在链接
<!-- WSDL file generated by Zend Studio. --><definitions name="InetCuotasWS" targetNamespace="urn:InetCuotasWS">
<types><xsd:schema targetNamespace="urn:InetCuotasWS">
<xsd:complexType name="Usuario"><xsd:all>
<xsd:element name="cuota" type="xsd:float"/><xsd:element name="cuota_usada" type="xsd:anyType"/>
<xsd:element name="nivel_navegacion" type="xsd:string"/>
<xsd:element name="usuario" type="xsd:string"/>
</xsd:all></xsd:complexType></xsd:schema></types>
<message name="ObtenerCuota"><part name="usuario" type="xsd:string"/><part name="clave" type="xsd:string"/>
<part name="dominio" type="xsd:string"/></message>
<message name="ObtenerCuotaResponse"><part name="ObtenerCuotaReturn" type="typens:Usuario"/></message><portType name="InetCuotasWSPortType">
<operation name="ObtenerCuota"><documentation>
Obtener el estado de la cuota de un usuario dado su usuario y clave.
</documentation>
<input message="typens:ObtenerCuota"/>
<output message="typens:ObtenerCuotaResponse"/></operation></portType><binding name="InetCuotasWSBinding" type="typens:InetCuotasWSPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="ObtenerCuota"><soap:operation soapAction="urn:InetCuotasWSAction"/><input><soap:body namespace="urn:InetCuotasWS" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input><output><soap:body namespace="urn:InetCuotasWS" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output></operation></binding><service name="InetCuotasWSService"><port name="InetCuotasWSPort" binding="typens:InetCuotasWSBinding"><soap:address location="https://cuotas.uci.cu/servicios/v1/InetCuotasWS.php"/>
</port></service></definitions>
编辑 我用了SoapUI如你所说,这是URI https://cuotas.uci.cu/servicios/v1/InetCuotasWS.php?wsdl 和的SOAPMessage是
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:InetCuotasWS">
<soapenv:Header/><soapenv:Body>
<urn:ObtenerCuota soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<usuario xsi:type="xsd:string">dogcalas</usuario>
<clave xsi:type="xsd:string">.*Pepe</clave>
<dominio xsi:type="xsd:string">uci</dominio>
</urn:ObtenerCuota></soapenv:Body></soapenv:Envelope>
当我在Firefox中发送soap消息时,警报('ERROR ')显示,Firefox的firebug插件显示此消息。
错误德LECTURA XML:无SE encuentra ELEMENTOUbicación: MOZ-nullprincipal:{fc98c066-ae21-4b57-b743-83e9519342c7}NÚMERO德 拉利内阿1,columna 1:
即使使用另一项服务,Firefox总是显示相同的消息。 只有当我使用Internet Explorer 10,发送消息,但服务器响应isn't我的期望:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode>
<faultstring>SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: 'location' and 'uri' options are required in nonWSDL mode</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
在IE中,如果我使用其他的服务,脚本工作。
所有原始信息,除非该服务器支持[CORS(http://en.wikipedia.org/wiki/Cross-origin_resource_sharing),你可能会被卡住与[CROSS-DOMAIN](http://stackoverflow.com/questions/2882522/crossdomain-error)错误。 ** P.S **链接无处可去。 – balexandre
ups,链接只是为我的大学 – Abs
,那么你将有一个很大的问题,做这个插件...;) – balexandre