Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net ServiceStack/SOAP生成兼容的WSDL_Asp.net_<img Src="//i.stack.imgur.com/WM7S8.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">servicestack - Fatal编程技术网 servicestack,Asp.net,servicestack" /> servicestack,Asp.net,servicestack" />

Asp.net ServiceStack/SOAP生成兼容的WSDL

Asp.net ServiceStack/SOAP生成兼容的WSDL,asp.net,servicestack,Asp.net,servicestack,我需要支持一组仅为SOAP的服务,但我在定义服务时遇到了困难,因为现有客户机可以使用这些服务,而几乎不需要更改。我正在讨论的问题是,1。获取正确的POST值,2。肥皂剧,3。包括数据类型,以及4。让它包含所有子数据成员 考虑这个搜索商店的简单服务: --请求-- POST /services-1.0/Store.asmx SOAPAction: http://example.com/Services/LookupStores Content-Type: text/xml; charset=utf

我需要支持一组仅为SOAP的服务,但我在定义服务时遇到了困难,因为现有客户机可以使用这些服务,而几乎不需要更改。我正在讨论的问题是,1。获取正确的POST值,2。肥皂剧,3。包括数据类型,以及4。让它包含所有子数据成员

考虑这个搜索商店的简单服务:

--请求--

POST /services-1.0/Store.asmx
SOAPAction: http://example.com/Services/LookupStores
Content-Type: text/xml; charset=utf-8
Content-Length: string
Host: string

<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <LookupStores xmlns="http://example.com/Services">
      <AuthenticationID>string</AuthenticationID>
      <NameMatch>string</NameMatch>
    </LookupStores>
  </soap:Body>
</soap:Envelope>
--回应---

HTTP/1.0 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: string

<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <LookupStoresResponse xmlns="http://example.com/Services">
      <LookupStoresResult>
        <StoreList>
          <StoreData>
            <Number>string</Number>
            <Name>string</Name>
          </StoreData>
          <StoreData>
            <Number>string</Number>
            <Name>string</Name>
          </StoreData>
        </StoreList>
        <ResponseCode>string</ResponseCode>
        <ResponseMessage>string</ResponseMessage>
        <ExtendedResponseMessage>string</ExtendedResponseMessage>
      </LookupStoresResult>
    </LookupStoresResponse>
  </soap:Body>
</soap:Envelope>
希望模仿它的服务代码:

public class Store : Service
{
    public LookupStoresResponse Post(LookupStores request)
    {
        return new LookupStoresResponse();
    }
}

[DataContract(Namespace="http://example.com/Services")]
public class LookupStores
{
    [DataMember]
    string AuthenticationID { get { return ""; } set { } }
    [DataMember]
    string NameMatch;
}

 [DataContract]
public class LookupStoresResponse
{
    [DataMember]
    List<StoreData> LookupStoresResult;
}

[DataContract]
public class LookupStoresResult
{
    [DataMember]
    List<StoreData> StoreList;
}

[DataContract]
public class StoreData
{
    [DataMember]
    string Number;
    [DataMember]
    string Name;
}
收益率:

POST /soap11 HTTP/1.1 
Host: localhost 
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: LookupStores

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>

<LookupStores xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://example.com/Services">
  <AuthenticationID />
  <NameMatch i:nil="true" />
</LookupStores>

    </soap:Body>
</soap:Envelope>


HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>

<LookupStoresResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/EagleServices.Services">
  <LookupStoresResult i:nil="true" />
</LookupStoresResponse>

    </soap:Body>
</soap:Envelope>