我有这个WSDL,
<s:element name="IncidentCreated">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="IncidentCreatedStc" type="tns:IncidentCreatedStc" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="IncidentCreatedStc">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="CreationDate" type="s:dateTime" />
<s:element minOccurs="1" maxOccurs="1" name="DangerFlag" nillable="true" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="DeadDeviceAlias" nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
我在c#中自动生成服务引用(WSDL),它看起来像这样:
<wsdl:definitions targetNamespace="ENMAC/TCS" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="ENMAC/TCS" 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:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="ENMAC/TCS">
<s:element name="IncidentCreated">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CreationDate" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="DangerFlag" nillable="true" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="DeadDeviceAlias" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
从来没有创建过IncidentCreatedStc节点,我实际上根本不会想到它,问题是当我从服务中收到XML时它看起来像
<IncidentCreated>
<IncidentCreatedStr>
<CreationDate></CreationDate>
<DangerFlag></DangerFlag>
<DeadDeviceAlias></DeadDeviceAlias>
</IncidentCreatedStr>
</IncidentCreated>
我的问题是如何使我的肥皂服务符合最后的格式?