简体   繁体   English

WCF服务SOAP对象

[英]WCF Service SOAP Object

I have a web service in WCF, my contract/interface of my sample method looks like this: 我在WCF中有一个Web服务,我的示例方法的协定/接口如下所示:

[ServiceContract]
public interface INTERFACE
{
    [OperationContract]
    os_consultar oe_consultar(oe_consultar obj_consultar);
}

This method generates and XML like this: 此方法生成和XML,如下所示:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org soap/envelope/" xmlns:wses="http://org.com/wses/"
xmlns:ean="http://schemas.datacontract.org/2004/07 Ean.PaymentGateway.Bank.BankInterfaceEntity">
<soapenv:Header/>
<soapenv:Body>
  <wses:oe_consultar>
     <!--Optional:-->
     <wses:obj_consultar>
        <cod1>?</cod1>
        <cod2>?</cod2>
     </wses:obj_consultar>
  </wses:oe_consultar>
 </soapenv:Body>
</soapenv:Envelope>

I want to know if it is possible to generate the xml this way: 我想知道是否可以通过这种方式生成xml:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org soap/envelope/" xmlns:wses="http://org.com/wses/"
xmlns:ean="http://schemas.datacontract.org/2004/07 Ean.PaymentGateway.Bank.BankInterfaceEntity">
<soapenv:Header/>
<soapenv:Body>
  <wses:oe_consultar>
    <cod1>?</cod1>
    <cod2>?</cod2>
  </wses:oe_consultar>
 </soapenv:Body>
</soapenv:Envelope>

Thanks in advance 提前致谢

what about this 那这个呢

[ServiceContract]
public interface INTERFACE
{
    [OperationContract]
    void oe_consultar(cod1 string, cod2 string);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM