我是一名初級開發人員,並試圖編寫一個應用程序來使用SOAP Web服務。使用Soap服務,以對象的形式接收如何寫入XML?
使用web引用,我可以很容易地調用Soap web服務器的web方法,但問題在於服務器返回一個對象(我認爲是UBL XML對象) 。我可以作爲一個XML對象訪問它的單個元素/節點。但是如果我想輸出它對XML文件/對象的響應,我該怎麼做呢?將對象作爲XML對象輸出可能是一項微不足道的任務,但我不確定從何處開始。我試過簡單的調用ToString()返回的對象不起作用。我是否需要降低傳遞http POST的等級以發送SOAP標題和正文以及解釋/寫入響應流以獲取XML文本的響應?
這是我用來獲取UBL格式化XML對象的代碼:
/// <summary>
/// Used by supplier to check Order
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnRequestPO_Click(object sender, EventArgs e)
{
string t_return;
SupplierServices supplierServices = new SupplierServices();
LoginDetails lgDetails = new LoginDetails();
lgDetails.UserName = "user";
lgDetails.Password = "password";
supplierServices.LoginDetailsValue = lgDetails;
RequestPurchaseOrder requestPO = new RequestPurchaseOrder();
requestPO.SupplierCode = "1234";
try
{
Order returned_order = supplierServices.SupplierRequestPO(requestPO);
if (returned_order != null)
{
//Simply call the ToString wouldn't work, it will return a
//class name instead.
t_return = returned_order.ToString();
MessageBox.Show(t_return);
}
else
MessageBox.Show("Returned order is empty!");
}
catch (Exception ex)
{
String responseFromServer = ex.Message.ToString() + " ";
if (ex!= null)
{
MessageBox.Show(responseFromServer);
}
}
,這裏是SOAP響應,我應該得到:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
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>
<SupplierRequestPOResponse xmlns="https://extranet.thewarehouse.co.nz/ElectronicCommerce/">
<Order xmlns="urn:oasis:names:specification:ubl:schema:xsd:Order-2">
<ID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<CopyIndicator xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<IssueDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Note xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Note xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<DocumentCurrencyCode xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<CustomerReference xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineCountNumeric xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<ValidityPeriod xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<StartDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<EndDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Description xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Description xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
</ValidityPeriod>
<ValidityPeriod xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<StartDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<EndDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Description xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Description xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
</ValidityPeriod>
<BuyerCustomerParty xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<CustomerAssignedAccountID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Party>
<EndpointID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartyName xsi:nil="true" />
<PartyName xsi:nil="true" />
<PostalAddress xsi:nil="true" />
<PhysicalLocation xsi:nil="true" />
<PartyTaxScheme xsi:nil="true" />
<PartyTaxScheme xsi:nil="true" />
</Party>
<BuyerContact>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Name xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Telephone xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Telefax xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
</BuyerContact>
</BuyerCustomerParty>
<SellerSupplierParty xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<CustomerAssignedAccountID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Party>
<EndpointID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartyName xsi:nil="true" />
<PartyName xsi:nil="true" />
<PostalAddress xsi:nil="true" />
<PhysicalLocation xsi:nil="true" />
<PartyTaxScheme xsi:nil="true" />
<PartyTaxScheme xsi:nil="true" />
</Party>
</SellerSupplierParty>
<ManufacturerParty xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<EndpointID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartyName>
<Name xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
</PartyName>
<PartyName>
<Name xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
</PartyName>
<PostalAddress>
<StreetName xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<AdditionalStreetName xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<CitySubdivisionName xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<CityName xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Country xsi:nil="true" />
</PostalAddress>
<PhysicalLocation>
<Address xsi:nil="true" />
</PhysicalLocation>
<PartyTaxScheme>
<RegistrationName xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<CompanyID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TaxScheme xsi:nil="true" />
</PartyTaxScheme>
<PartyTaxScheme>
<RegistrationName xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<CompanyID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TaxScheme xsi:nil="true" />
</PartyTaxScheme>
</ManufacturerParty>
<Delivery xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<Quantity xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TrackingID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<DeliveryParty>
<EndpointID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartyName xsi:nil="true" />
<PartyName xsi:nil="true" />
<PostalAddress xsi:nil="true" />
<PhysicalLocation xsi:nil="true" />
<PartyTaxScheme xsi:nil="true" />
<PartyTaxScheme xsi:nil="true" />
</DeliveryParty>
</Delivery>
<Delivery xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<Quantity xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TrackingID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<DeliveryParty>
<EndpointID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartyName xsi:nil="true" />
<PartyName xsi:nil="true" />
<PostalAddress xsi:nil="true" />
<PhysicalLocation xsi:nil="true" />
<PartyTaxScheme xsi:nil="true" />
<PartyTaxScheme xsi:nil="true" />
</DeliveryParty>
</Delivery>
<TransactionConditions xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<ID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<ActionCode xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Description xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Description xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<DocumentReference>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<CopyIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<UUID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<IssueDate xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<DocumentTypeCode xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<DocumentType xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<XPath xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<XPath xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Attachment xsi:nil="true" />
</DocumentReference>
<DocumentReference>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<CopyIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<UUID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<IssueDate xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<DocumentTypeCode xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<DocumentType xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<XPath xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<XPath xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Attachment xsi:nil="true" />
</DocumentReference>
</TransactionConditions>
<TaxTotal xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<TaxAmount xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
</TaxTotal>
<TaxTotal xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<TaxAmount xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
</TaxTotal>
<AnticipatedMonetaryTotal xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<LineExtensionAmount xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<AllowanceTotalAmount xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PayableAmount xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
</AnticipatedMonetaryTotal>
<OrderLine xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<Note xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineItem>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Note xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineStatusCode xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Quantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineExtensionAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TotalTaxAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MinimumQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MaximumBackorderQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartialDeliveryIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<BackOrderAllowedIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Delivery xsi:nil="true" />
<Delivery xsi:nil="true" />
<PricingReference xsi:nil="true" />
<Price xsi:nil="true" />
<Item xsi:nil="true" />
</LineItem>
<BuyerProposedSubstituteLineItem>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Note xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineStatusCode xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Quantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineExtensionAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TotalTaxAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MinimumQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MaximumBackorderQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartialDeliveryIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<BackOrderAllowedIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Delivery xsi:nil="true" />
<Delivery xsi:nil="true" />
<PricingReference xsi:nil="true" />
<Price xsi:nil="true" />
<Item xsi:nil="true" />
</BuyerProposedSubstituteLineItem>
<BuyerProposedSubstituteLineItem>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Note xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineStatusCode xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Quantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineExtensionAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TotalTaxAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MinimumQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MaximumBackorderQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartialDeliveryIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<BackOrderAllowedIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Delivery xsi:nil="true" />
<Delivery xsi:nil="true" />
<PricingReference xsi:nil="true" />
<Price xsi:nil="true" />
<Item xsi:nil="true" />
</BuyerProposedSubstituteLineItem>
</OrderLine>
<OrderLine xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<Note xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineItem>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Note xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineStatusCode xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Quantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineExtensionAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TotalTaxAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MinimumQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MaximumBackorderQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartialDeliveryIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<BackOrderAllowedIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Delivery xsi:nil="true" />
<Delivery xsi:nil="true" />
<PricingReference xsi:nil="true" />
<Price xsi:nil="true" />
<Item xsi:nil="true" />
</LineItem>
<BuyerProposedSubstituteLineItem>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Note xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineStatusCode xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Quantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineExtensionAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TotalTaxAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MinimumQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MaximumBackorderQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartialDeliveryIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<BackOrderAllowedIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Delivery xsi:nil="true" />
<Delivery xsi:nil="true" />
<PricingReference xsi:nil="true" />
<Price xsi:nil="true" />
<Item xsi:nil="true" />
</BuyerProposedSubstituteLineItem>
<BuyerProposedSubstituteLineItem>
<ID xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Note xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineStatusCode xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Quantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<LineExtensionAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<TotalTaxAmount xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MinimumQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<MaximumBackorderQuantity xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<PartialDeliveryIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<BackOrderAllowedIndicator xsi:nil="true" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
<Delivery xsi:nil="true" />
<Delivery xsi:nil="true" />
<PricingReference xsi:nil="true" />
<Price xsi:nil="true" />
<Item xsi:nil="true" />
</BuyerProposedSubstituteLineItem>
</OrderLine>
</Order>
</SupplierRequestPOResponse>
</soap:Body>
</soap:Envelope>
謝謝馬克,序列化正是我所需要的。但由於某種原因MessageBox.Show不會顯示返回的序列化結果,可能是由於它的大小?由此產生的XML文件將是600Ks?我得到它直接寫入文本,並應該能夠顯示爲RichText,如果我想。 – 2010-11-23 23:48:06
是的,MessageBox可以顯示的大小可能有限制,但是我想提出的一點是,我提供的Serialize方法返回一個字符串,所以在這一點上,您可以使用它來做什麼。很高興我能幫上忙。 – 2010-11-24 14:56:28