0

我有以下 XML,我想在其中发布记录ProductNumberQuantityPrice

    <?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>
    <QueryPrices xmlns="xyz">
      <strSessionKey>string</strSessionKey>
      <nDiscountID>int</nDiscountID>
      <objOrderItems>
        <OrderItem>
          <ProductNumber>int</ProductNumber>
          <Quantity>int</Quantity>
          <Price>float</Price>
        </OrderItem>
        <OrderItem>
          <ProductNumber>int</ProductNumber>
          <Quantity>int</Quantity>
          <Price>float</Price>
        </OrderItem>
      </objOrderItems>
    </QueryPrices>
  </soap:Body>
</soap:Envelope>
4

1 回答 1

1

创建肥皂对象,并仅用于addProperty()传递参数。

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request .addProperty("key", value);

处理SOAP

在你的情况下:

request.addProperty( "ProductNumber","something");
request.addProperty( "Quantity","something");
request.addProperty( "Price","something");
于 2012-04-13T07:02:47.087 回答