Ну может кто подскажет как вложеность сделать больше.
Нуобходиомо получить:
<?xml version="1.0" encoding="UTF-8"?>
<UFXMsg direction=string msg_type=string scheme=string version=string>
<MsgId>string</MsgId>
<Source app=string/>
<MsgData>
<Doc>
<TransType>
<TransCode>
<MsgCode>string</MsgCode>
</TransCode>
</TransType>
<DocRefSet>
<Parm>
<ParmCode>string</ParmCode>
<Value>string</Value>
</Parm>
</DocRefSet>
<Requestor>
<ContractNumber>string</ContractNumber>
</Requestor>
<Source>
<ContractNumber>string</ContractNumber>
</Source>
<ResultDtls>
<Parm>
<ParmCode>string</ParmCode>
<Value>string</Value>
</Parm>
</ResultDtls>
</Doc>
</MsgData>
</UFXMsg>
Вот что я накидываю:
public class Document
{
public class TransportType
{
public class TransportCode
{
public string MsgCode;
}
public TransportCode TransCode;
}
public class Parameters
{
public string ParmCode;
public string Value;
}
public class CRequestor
{
public string ContractNumber;
}
public class DocumentRefSet
{
public Parameters Param;
}
public class CSource
{
public string ContractNumber;
}
public class ResultDetals
{
public Parameters Param;
}
public TransportType TranType;
public CRequestor Requestor;
public DocumentRefSet DocRefSet;
public CSource Source;
public ResultDetals ResultDtls;
}
public class MessageData
{
public Document Doc;
}
public class UFXMessage
{
[XmlAttribute]
public string direction;
[XmlAttribute]
public string msg_type;
[XmlAttribute]
public string scheme;
[XmlAttribute]
public string version;
public string MsgId;
public class Csource
{
[XmlAttribute]
public string app;
}
public Csource Source;
public MessageData MsgData;
}
[WebMethod]
public void Ballans(UFXMessage UFXMsg)
{
}
Вот что мне WebService выдает :
POST /Service1.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "
http://tempuri.org/Ballans"
<?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>
<Ballans xmlns="
http://tempuri.org/">
<UFXMsg direction="string" msg_type="string" scheme="string" version="string">
<MsgId>string</MsgId>
<Source app="string" />
<MsgData>
<Doc>
<TranType xsi:nil="true" />
<Requestor xsi:nil="true" />
<DocRefSet xsi:nil="true" />
<Source xsi:nil="true" />
<ResultDtls xsi:nil="true" />
</Doc>
</MsgData>
</UFXMsg>
</Ballans>
</soap:Body>
</soap:Envelope>
Так вот как сделать, так что бы вложеность была видна, например у <TranType xsi:nil="true" /> и вид был такой
<TransType>
<TransCode>
<MsgCode>string</MsgCode>
</TransCode>
</TransType>