用C#开发的WebService 生成WSDL中的s:stirng 成为 xsd:string
用C#开发的WebService 生成WSDL中的s:stirng 变为 xsd:string
我的WebService:
[WebService(Namespace = "http://www.w3.org/2001/XMLSchema")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : WebService
{
public Service () { }
[WebMethod]
public String RecvSMS(String caller, String time, String cont, String ucNum)
{
return "-1";
}
生成WSDL:
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
- <s:element name="RecvSMS">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="caller" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="time" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="cont" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ucNum" type="s:string" />
现在调用方要求我把 所有类型: s:string 改为 xsd:string 请大家帮忙,我该如何改?
------解决方案--------------------
参考一下这篇文章,或者对你有用
http://wenku.baidu.com/link?url=nTus9rFVZzuMKxLQQFVje1SdTdl7LFzFRZT1HO9OIokUdinN0jXSF1AcZIj6f-ST6PyoA3BsRHjgQ7JH2jWmL7CVDLCczJHWeybe282gs9a
------解决方案--------------------
都是字符串类型,只是命名空间不同,一个是soapenc,一个是xsd.
命名空间可以在wsdl文档的开头找到如下定义:xmlns:soapenc="http://…… " xmlns:xsd="http://……"
我的WebService:
[WebService(Namespace = "http://www.w3.org/2001/XMLSchema")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : WebService
{
public Service () { }
[WebMethod]
public String RecvSMS(String caller, String time, String cont, String ucNum)
{
return "-1";
}
生成WSDL:
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
- <s:element name="RecvSMS">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="caller" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="time" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="cont" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ucNum" type="s:string" />
现在调用方要求我把 所有类型: s:string 改为 xsd:string 请大家帮忙,我该如何改?
------解决方案--------------------
参考一下这篇文章,或者对你有用
http://wenku.baidu.com/link?url=nTus9rFVZzuMKxLQQFVje1SdTdl7LFzFRZT1HO9OIokUdinN0jXSF1AcZIj6f-ST6PyoA3BsRHjgQ7JH2jWmL7CVDLCczJHWeybe282gs9a
------解决方案--------------------
都是字符串类型,只是命名空间不同,一个是soapenc,一个是xsd.
命名空间可以在wsdl文档的开头找到如下定义:xmlns:soapenc="http://…… " xmlns:xsd="http://……"