2

我在 .NET 中有一个 Web 服务,它接受参数作为 DTO。当我使用 SOAP UI 传递值时,该对象没有进入 .NET Web 服务。

我的 DTO 是一个 get、set 类,我在我的 Web 服务方法中使用这个 DTO,如下所示。

getQuote(RequestDTO requestDTO)

当我使用 SOAP UI 像下面的请求一样对其进行测试时,requestDTO总是会出现null方法getQuote。但是,当我使用调用此 Web 服务的示例 .NET ASPX 页面进行测试时,它工作正常。

以下是我在 SOAP UI 中的请求。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"     xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<getQuotes>
<requestQuoteDTO>
<SystemID>123</SystemID>
<RequestCircuitID>6012344</RequestCircuitID>
<PriceAllNodes>false</PriceAllNodes>
<siteDTO>
<SiteName>Test SOAPUI</SiteName>
<Street1>5 St Johns Lane</Street1>
<Street2></Street2>
<City>London</City>
<PostCode>EC1M 4BH</PostCode>
<State></State>
<Country>GBR</Country>
<Wirecentre></Wirecentre>
<SitePhoneNumber></SitePhoneNumber>
<Latitude></Latitude>
<Longitude></Longitude>
</siteDTO>
<ProductRef>PIP</ProductRef>
<SpeedRef>4 Mbps</SpeedRef>
<LineTypeRef>Ethernet</LineTypeRef>
<ContractTerm>2</ContractTerm>
</requestQuoteDTO>
</getQuotes>
</soapenv:Body>
</soapenv:Envelope>
4

1 回答 1

0

肥皂请求看起来像这样

enter code here
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
  <tem:getQuotes>
     <tem:requestQuoteDTO>
        <tem:SystemID>?</tem:SystemID>
        <tem:RequestCircuitID>?</tem:RequestCircuitID>
        <tem:PriceAllNodes>?</tem:PriceAllNodes>
        <tem:siteDTO>
           <tem:SiteName>?</tem:SiteName>
           <tem:Street1>?</tem:Street1>
           <tem:Street2>?</tem:Street2>
           <tem:City>?</tem:City>
           <tem:PostCode>?</tem:PostCode>
           <tem:State>?</tem:State>
           <tem:Country>?</tem:Country>
           <tem:Wirecentre>?</tem:Wirecentre>
           <tem:SitePhoneNumber>?</tem:SitePhoneNumber>
           <tem:Latitude>?</tem:Latitude>
           <tem:Longitude>?</tem:Longitude>
        </tem:siteDTO>
        <tem:ProductRef>?</tem:ProductRef>
        <tem:SpeedRef>?</tem:SpeedRef>
        <tem:LineTypeRef>?</tem:LineTypeRef>
        <tem:ContractTerm>?</tem:ContractTerm>
     </tem:requestQuoteDTO>
  </tem:getQuotes>

于 2012-10-22T17:48:56.323 回答