私は以下を参照してください:SPサーバーへのSOAP 1.1リクエストのサンプルですが、それは重要ではありません。SOAPコンテンツの長さ
POST /_vti_bin/lists.asmx HTTP/1.1
Host: 192.168.0.25
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/GetList"
<?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>
<GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>string</listName>
</GetList>
</soap:Body>
</soap:Envelope>
フィールドのContent-Length:長さは、実際の値と交換する必要があります。その価値は何ですか?私はどこでそれを見ることができますか?またはリクエスト前に値を計算する方法は?
UPD1。 私はContent-Length
値が第一<
で始まり、ここで>
または多分ボディの最後の文字、改行で終わる体の長さ(バイト単位)である
headerPropertyObj = new HeaderProperty("Content-Length", "383"); // should be calc before
headerList.add(headerPropertyObj);
transport.setUrl(URL);
request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("listName", "Tasks");
envelope.setOutputSoapObject(request);
transport.call(SOAP_ACTION, envelope, headerList);
どのようにSOAPリクエストを作成していますか? – McDowell
このリンクはあなたに役立ちます http://stackoverflow.com/questions/290172/calculating-soap-content-length – Xara
私は** transport.call(SOAP_ACTION、envelope、headerList)で完全なクエリを見ることができます; **しかし、私はこのメソッドの前にcalcコンテンツの長さが必要です。 – Gorets