uploadpost响应

对于成功的POST请求,响应正文是XML uploadPostReturn文档,如XSD在以下内容中所指定:

<element name="uploadPostReturn">
        <complexType>
            <sequence>
                <element name="jobHandle" type="xsd:string"/>
            </sequence>
        </complexType>
    </element>

对于同一作业的任何后续POST请求,返回的jobHandleuploadPostParams/jobHandle参数中传递。 您还可以使用它来轮询getActiveJobs操作的作业状态,或查询getJobLogDetails操作的作业日志。

如果处理POST请求时出错,则响应正文将由故障中所述的API故障类型之一组成。

示例POST请求

POST /scene7/UploadFile HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost
Content-Length: 362630
Content-Type: multipart/form-data; boundary=O9-ba7tieRtqA4QRSaVk-eDq6658SPrYfvUcJ

--O9-ba7tieRtqA4QRSaVk-eDq6658SPrYfvUcJ
Content-Disposition: form-data; name="auth"
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit

            <authHeader xmlns="http://www.scene7.com/IpsApi/xsd/2014-04-03">
                   <user>sampleuser@test.com</user>
                   <password>*</password>
                   <locale>en-US</locale>
                   <appName>MyUploadServletTest</appName>
                   <appVersion>1.0</appVersion>
                   <faultHttpStatusCode>200</faultHttpStatusCode>
           </authHeader>

--O9-ba7tieRtqA4QRSaVk-eDq6658SPrYfvUcJ
Content-Disposition: form-data; name="uploadParams"
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit

            <uploadPostParam xmlns="http://www.scene7.com/IpsApi/xsd/2014-04-03">
                <companyHandle>c|2101</companyHandle>
                <jobName>uploadFileServlet-1376682217351</jobName>
                <uploadParams>
                    <overwrite>true</overwrite>
                    <readyForPublish>true</readyForPublish>
                    <preservePublishState>true</preservePublishState>
                    <createMask>true</createMask>
                    <preserveCrop>true</preserveCrop>
                    <manualCropOptions>
                      <left>500</left>
                      <right>500</right>
                      <top>500</top>
                      <bottom>500</bottom>
                    </manualCropOptions>
                    <photoshopOptions>
                      <process>MaintainLayers</process>
                      <layerOptions>
                        <layerNaming>AppendNumber</layerNaming>
                        <anchor>Northwest</anchor>
                        <createTemplate>true</createTemplate>
                        <extractText>true</extractText>
                        <extendLayers>false</extendLayers>
                      </layerOptions>
                    </photoshopOptions>
                    <emailSetting>None</emailSetting>
                </uploadParams>
            </uploadPostParam>

--O9-ba7tieRtqA4QRSaVk-eDq6658SPrYfvUcJ--
Content-Disposition: form-data; name="file1"; filename="ApiTestCo1/UploadFileServlet1376682217351//1376682217351-1.jpg"
Content-Type: application/octet-stream; charset=ISO-8859-1
Content-Transfer-Encoding: binary
<file bytes ... >
--O9-ba7tieRtqA4QRSaVk-eDq6658SPrYfvUcJ--
Content-Disposition: form-data; name="file2"; filename="ApiTestCo1/UploadFileServlet1376682217351//1376682217351-2.jpg"
Content-Type: application/octet-stream; charset=ISO-8859-1
Content-Transfer-Encoding: binary
<file bytes ... >
--O9-ba7tieRtqA4QRSaVk-eDq6658SPrYfvUcJ--