从jquery soap服务调用wsdl文件 [英] call wsdl file from jquery soap service

查看:157
本文介绍了从jquery soap服务调用wsdl文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi, 

I got an WSDL file from siebel team. I need to call this service from Jquery $.soap call and parse the value.

The WSDL file content looks like

 <pre lang="HTML"> <?xml version="1.0" encoding="UTF-8" ?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsdLocal1="http://www.siebel.com/xml/GetAccountInfoReqData" targetNamespace="http://siebel.com/CustomUI" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsdLocal2="http://www.siebel.com/xml/GetAccountInfoReplyData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://siebel.com/CustomUI">
      <types>
        <xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xsdLocal1="http://www.siebel.com/xml/GetAccountInfoReqData" targetNamespace="http://www.siebel.com/xml/GetAccountInfoReqData" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <xsd:annotation>
            <xsd:documentation>Copyright (C) 2001-2004 Siebel Systems, Inc. All rights reserved. Siebel XSD Generation</xsd:documentation>
          </xsd:annotation>
          <xsd:element name="GetAccountInfoReqData" type="xsdLocal1:GetAccountInfoReqData"></xsd:element>
          <xsd:complexType name="GetAccountInfoReqDataTopElmt">
            <xsd:sequence>
              <xsd:element name="GetAccountInfoReqData" maxOccurs="1" minOccurs="1" type="xsdLocal1:GetAccountInfoReqData"></xsd:element>
            </xsd:sequence>
          </xsd:complexType>









我试过这种方式使用Jquery soap api ..提交肥皂服务后,我得到了相同的ws dl文件内容无论我提交什么。







And i tried with this way using Jquery soap api.. After submitting the soap service i'm getting the same wsdl file content whatever i submitted.

$.soap({
     url: 'http://localhost/soap/soapservices.wsdl?',
     method: '',
     success: function(soapResponse) {},
     error: function(SOAPResponse) {}
   });







这是正确的方法还是请给出一些建议,想法开始我的work。




Is this a correct way or please give some suggestions, idea to start my work.

推荐答案

.soap调用并解析值。

WSDL文件内容看起来像

< pre lang = HTML> <?xml version = 1.0 encoding = UTF-8?>
< definitions xmlns = http://schemas.xmlsoap.org/wsdl/ xmlns:soap = http://schemas.xmlsoap.org/wsdl/soap/ xmlns :xsdLocal1 = http://www.siebel.com/xml/GetAccountInfoReqData targetNamespace = http://siebel.com/CustomUI xmlns:soapenc = http://schemas.xmlsoap.org/soap/encoding/
xmlns:xsdLocal2 = http://www.siebel.com/xml/GetAccountInfoReplyData xmlns:xsd = http://www.w3.org/2001/XMLSchema xmlns:tns = http://siebel.com/CustomUI>
< types>
< xsd:schema elementFormDefault = qualified attributeFormDefault = unqualified xmlns:xsdLocal1 = http://www.siebel.com/xml/GetAccountInfoReqData targetNamespace = http ://www.siebel.com/xml/GetAccountInfoReqData xmlns:xsd = http:// www.w3.org/2001/XMLSchema\">
< xsd:annotation>
< xsd:documentation>版权所有(C)2001-2004 Siebel Systems,Inc。保留所有权利。 Siebel XSD生成< / xsd:documentation >
< / xsd:annotation >
< xsd:element name = GetAccountInfoReqData类型= xsdLocal1:GetAccountInfoReqData> < / xsd:element >
< xsd:complexType name = GetAccountInfoReqDataTopElmt>
< xsd:sequence>
< xsd:element name = GetAccountInfoReqData maxOccurs = 1 minOccurs = 1 type = xsdLocal1:GetAccountInfoReqData> < / xsd:element >
< span class =code-keyword>< /
xsd:sequence >
< / xsd:complexType >
.soap call and parse the value. The WSDL file content looks like <pre lang="HTML"> <?xml version="1.0" encoding="UTF-8" ?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsdLocal1="http://www.siebel.com/xml/GetAccountInfoReqData" targetNamespace="http://siebel.com/CustomUI" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsdLocal2="http://www.siebel.com/xml/GetAccountInfoReplyData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://siebel.com/CustomUI"> <types> <xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xsdLocal1="http://www.siebel.com/xml/GetAccountInfoReqData" targetNamespace="http://www.siebel.com/xml/GetAccountInfoReqData" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:annotation> <xsd:documentation>Copyright (C) 2001-2004 Siebel Systems, Inc. All rights reserved. Siebel XSD Generation</xsd:documentation> </xsd:annotation> <xsd:element name="GetAccountInfoReqData" type="xsdLocal1:GetAccountInfoReqData"></xsd:element> <xsd:complexType name="GetAccountInfoReqDataTopElmt"> <xsd:sequence> <xsd:element name="GetAccountInfoReqData" maxOccurs="1" minOccurs="1" type="xsdLocal1:GetAccountInfoReqData"></xsd:element> </xsd:sequence> </xsd:complexType>









我试过这种方式使用Jquery soap api ..提交肥皂服务后,我得到了相同的ws dl文件内容无论我提交什么。







And i tried with this way using Jquery soap api.. After submitting the soap service i'm getting the same wsdl file content whatever i submitted.


.soap({
url:' http://localhost/soap/soapservices.wsdl?'
方法:' '
成功: function (soapResponse){ },
错误: function (SOAPResponse){}
});
.soap({ url: 'http://localhost/soap/soapservices.wsdl?', method: '', success: function(soapResponse) {}, error: function(SOAPResponse) {} });







这是正确的方法还是请给出一些建议,想法开始我的work。




Is this a correct way or please give some suggestions, idea to start my work.


首先,没有调用WSDL文件这样的概念。其次,如果您请求WSDL文件,当然,在基于WSDL的任何合理服务中,您将获得此WSDL文件。您还期待什么?



这不是服务本身的消耗方式。它在很多地方都有解释:

http://fahadismy.name/soap-calls- using-jquery-ajax [ ^ ],

http:// openlandscape.net/2009/09/25/call-soap-xm-web-services-with-jquery-ajax [ ^ ],

http://www.lm-tech.it/博客/后期/ 2013/05/05 /如何使用RESTful-service-using-jQuery.aspx [ ^ ],

http://www.cnblogs.com/clearforever/archive/2011/10/09/2203628.html [ ^ ],

https://spring.io/guides/gs/consuming-rest-jquery [ ^ ]。



-SA
First, there is no such concept as "call WSDL file". Second, if you request for WSDL file, of course, in any reasonable service based on WSDL, you will get this WSDL file. What else would you expect?

This is not how the service itself is consumed. It's explained in many places:
http://fahadismy.name/soap-calls-using-jquery-ajax[^],
http://openlandscape.net/2009/09/25/call-soap-xm-web-services-with-jquery-ajax[^],
http://www.lm-tech.it/Blog/post/2013/05/08/How-to-consume-a-RESTful-service-using-jQuery.aspx[^],
http://www.cnblogs.com/clearforever/archive/2011/10/09/2203628.html[^],
https://spring.io/guides/gs/consuming-rest-jquery[^].

—SA


这篇关于从jquery soap服务调用wsdl文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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