0

我正在尝试使用 IIS 媒体服务的REST API以编程方式创建实时发布点。为此,我向该 URL 发送 POST 调用:

http://127.0.0.1/services/smoothstreaming/publishingpoints.isml/settings 

我在请求中包含了两个自定义标头:

Content-Type: application/atom+xml
Slug: /test.isml

这是请求的正文:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <entry xmlns="http://www.w3.org/2005/Atom">
    <id>http://127.0.0.1/test.isml/settings</id>
    <title>Test</title>
    <updated>2012-07-12T19:13:25Z</updated>
    <content type="application/xml">
      <SmoothStreaming xmlns="http://schemas.microsoft.com/iis/media/2011/03/streaming/management">
        <Settings>
          <Title>Test</Title>
          <SourceType>Push</SourceType>
          <AutoStart>false</AutoStart>
          <AutoRestartOnEncoderReconnect>false</AutoRestartOnEncoderReconnect>
          <LookAheadChunks>2</LookAheadChunks>
          <Archive enabled="false">
            <Path useEventIdOnPath="false" />
          </Archive>
          <ClientConnections enabled="true">
            <ClientManifestVersion>2.0</ClientManifestVersion>
          </ClientConnections>
          <ServerConnections enabled="false">
            <SendEndOfStreamOnStop>false</SendEndOfStreamOnStop>
          </ServerConnections>
        </Settings>
      </SmoothStreaming>
    </content>
  </entry>

IIS 给我这个正文的 405/Bad Request 错误:

<?xml version="1.0" encoding="UTF-8"?>
<SmoothStreaming xmlns="http://schemas.microsoft.com/iis/media/2011/03/streaming/management">
  <Error>
    <ErrorCode>0x80880026</ErrorCode>
    <ErrorMessage>The resource contains one or more elements that contain invalid data. For information about valid resource representations, please see the documentation for the supported schemas.</ErrorMessage>
  </Error>
</SmoothStreaming>

任何人都知道我在这里做错了什么?

4

1 回答 1

0

省略“存档”和“服务器连接”节点修复它。不确定它们有什么问题,或者它们是否应该只在启用 = true 时才包含在内。

于 2012-07-13T18:31:48.303 回答