如何在PHP中使用soapclient.js [英] How do I use the soapclient.js with PHP

查看:89
本文介绍了如何在PHP中使用soapclient.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的wsdl文件位于./wsdl路径:

< definitions xmlns =http://schemas.xmlsoap.org/wsdl/xmlns:soap =http:// schemas .xmlsoap.org / wsdl / soap /xmlns:tns =http://soap.client.chipkarte.atxmlns:wsam =http://www.w3.org/2007/05/addressing/metadata xmlns:wsp =http://www.w3.org/ns/ws-policyxmlns:wsp1_2 =http://schemas.xmlsoap.org/ws/2004/09/policyxmlns:wsu =http ://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsdxmlns:xsd =http://www.w3.org/2001/XMLSchema targetNamespace =http://soap.client.chipkarte.atname =ServiceManager>

< types>

< xs:schema xmlns:xs =http://www.w3.org/2001/XMLSchemaelementFormDefault =qualifiedtargetNamespace =http://soap.client.chipkarte.atversion =1.0>

< xs:element name =getServicestype =tns:getServices/>

< xs:element name =getServicesResponsetype =tns:getServicesResponse/>

< xs:complexType name =ge tServices>

< xs:sequence />

< / xs:complexType>

< xs:complexType name = getServicesResponse>

< xs:sequence>

< xs:element name =returntype =tns:servicemaxOccurs =unboundedminOccurs =0nillable =true/>

< / xs:sequence>

< / xs:complexType>

< xs:complexType name =service>

< xs:sequence>

< xs:element name =descriptiontype =xs:string minOccurs =0/>

< xs:element name =endPointURLtype =xs:stringminOccurs =0/>

< xs:element name =nametype =xs:stringminOccurs =0/>

< xs:element name =typetype =xs:string minOccurs =0/>

< xs:element name =versiontype =xs:stringminOccurs =0/>

< ; / xs:sequence>

< / xs:complexType>

< / xs:schema>

< / types>

< message name =getServices >

< part name =parameterselement =tns:getServices/>

< / message>

< message name =getServicesResponse>

< part name =parameterselement =tns:getServicesResponse/>

< / message>

< portType name =IServiceManager>

< operation name =getServices>

& lt;输入wsam: Action =http://soap.client.chipkarte.at/IServiceManager/getServicesRequestmessage =tns:getServices/>

< output wsam:Action =http:// soap .client.chipkarte.at / IServiceManager / getServicesResponsemessage =tns:getServicesResponse/>

< / operation>

< / portType>

< binding name =servicemanager_1Bindingtype =tns:IServiceManager>

< soap:binding style =文件transport =http://schemas.xmlsoap.org/soap/http/>

< operation name =getServices>

< soap:operation soapAction =/>

& lt; input>

< soap:body use =literal/>

& lt; / input>

< output>

< soap:body use =literal/>

< / output>

< / operation>

< / binding>

< service name =ServiceManager>

< port name =servicemanager_1binding =tns:servicemanager_1Binding>

< soap:address location =http:// localhost / servicemanager / 1 />

< / port>

< / service>

< / definitions>



使用的网址是https://10.196.2.98/servicemanager/1



我有什么尝试过:



我试过

my wsdl file resides in ./wsdl path:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.client.chipkarte.at" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soap.client.chipkarte.at" name="ServiceManager">
<types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://soap.client.chipkarte.at" version="1.0">
<xs:element name="getServices" type="tns:getServices" />
<xs:element name="getServicesResponse" type="tns:getServicesResponse" />
<xs:complexType name="getServices">
<xs:sequence />
</xs:complexType>
<xs:complexType name="getServicesResponse">
<xs:sequence>
<xs:element name="return" type="tns:service" maxOccurs="unbounded" minOccurs="0" nillable="true" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="service">
<xs:sequence>
<xs:element name="description" type="xs:string" minOccurs="0" />
<xs:element name="endPointURL" type="xs:string" minOccurs="0" />
<xs:element name="name" type="xs:string" minOccurs="0" />
<xs:element name="type" type="xs:string" minOccurs="0" />
<xs:element name="version" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name="getServices">
<part name="parameters" element="tns:getServices" />
</message>
<message name="getServicesResponse">
<part name="parameters" element="tns:getServicesResponse" />
</message>
<portType name="IServiceManager">
<operation name="getServices">
&lt;input wsam:Action="http://soap.client.chipkarte.at/IServiceManager/getServicesRequest" message="tns:getServices" />
<output wsam:Action="http://soap.client.chipkarte.at/IServiceManager/getServicesResponse" message="tns:getServicesResponse" />
</operation>
</portType>
<binding name="servicemanager_1Binding" type="tns:IServiceManager">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="getServices">
<soap:operation soapAction="" />
&lt;input>
<soap:body use="literal" />
&lt;/input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="ServiceManager">
<port name="servicemanager_1" binding="tns:servicemanager_1Binding">
<soap:address location="http://localhost/servicemanager/1" />
</port>
</service>
</definitions>

The url to be used is "https://10.196.2.98/servicemanager/1"

What I have tried:

I tried

<pre lang="HTML"><script type="text/javascript" src="./inc/soapclient.js">





function getServices(ECard_IP)

{

var sv = new SOAPClient(./ wsdl / ServiceManager.wsdl);

var svres = sv.invoke(https://+ ECard_IP +/ servicemanager / 1,getServices,sv);

alert(SVres+ svres.toSource());

}



哪些不起作用。谁能给我一个示例如何解决我的问题?

谢谢Mikr41



function getServices(ECard_IP)
{
var sv = new SOAPClient("./wsdl/ServiceManager.wsdl");
var svres = sv.invoke("https://" + ECard_IP + "/servicemanager/1", "getServices", sv);
alert("SVres " + svres.toSource());
}

which did not work. Could anyone give me a sample how to solve my problem?
Thanks Mikr41

推荐答案

如果您正在寻找相同的soapclient,请查看以下文档.js文件。代码示例适用于.Net,但应该可以帮助您了解所需的内容是用javascript编写的。

JavaScript SOAP客户端 - 源代码 [ ^ ]



如果您提到的是其他内容,请告知我们这个。



:)
Check following documentation if you are looking for the same soapclient.js. The code samples are for .Net but should help get you an idea as the required stuffs are written in javascript as it seems.
JavaScript SOAP Client - Source Code[^]

Please let me know if you are refering to something other than this.

:)


这篇关于如何在PHP中使用soapclient.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆