devinf的syncml状态415

时间:2009-12-01 12:46:05

标签: syncml

我从N95客户端获得415状态,用于发送服务器devinf。 我尝试过很多东西但没有成功。

这是服务器响应(由我生成,我正在编写自己的syncml服务器实现。):

<?xml version="1.0"?>
<!DOCTYPE SyncML PUBLIC "-//SYNCML//DTD SyncML 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd">
<SyncML>
  <SyncHdr>
    <VerDTD>1.2</VerDTD>
    <VerProto>SyncML/1.2</VerProto>
    <SessionID>14</SessionID>
    <MsgID>1</MsgID>
    <Target>
      <LocURI>IMEI:356406027185460</LocURI>
    </Target>
    <Source>
      <LocURI>http://localhost:8880</LocURI>
    </Source>
    <Meta>
      <MaxMsgSize xmlns="syncml:metinf">10000</MaxMsgSize>
    </Meta>
  </SyncHdr>
  <SyncBody>
    <Status>
      <MsgRef>1</MsgRef>
      <Data>200</Data>
      <Cmd>Alert</Cmd>
      <CmdRef>1</CmdRef>
      <CmdID>1</CmdID>
    </Status>
    <Status>
      <MsgRef>1</MsgRef>
      <Data>200</Data>
      <Cmd>Put</Cmd>
      <CmdRef>2</CmdRef>
      <CmdID>2</CmdID>
    </Status>
    <Status>
      <MsgRef>1</MsgRef>
      <Data>200</Data>
      <Cmd>Get</Cmd>
      <CmdRef>3</CmdRef>
      <CmdID>3</CmdID>
      <TargetRef>./devinf12</TargetRef>
    </Status>
    <Results>
      <MsgRef>1</MsgRef>
      <Item>
        <Meta>
          <Type xmlns="syncml:metinf">application/vnd.syncml-devinf+xml</Type>
        </Meta>
        <Source>
          <LocURI>./devinf12</LocURI>
        </Source>
        <Data>
          <DevInf xmlns="syncml:devinf">
            <VerDTD>1.2</VerDTD>
            <Man>my company ltd.</Man>
            <Mod>syncml mod</Mod>
            <SwV>0.01</SwV>
            <FwV>1.01</FwV>
            <HwV>0.1a</HwV>
            <DevID>syncmlserv</DevID>
            <DevTyp>server</DevTyp>
            <DataStore>
              <SourceRef>./contacts</SourceRef>
              <Rx-Pref>
                <CTType>text/vcard</CTType>
                <VerCT>3.0</VerCT>
              </Rx-Pref>
              <Rx>
                <CTType>text/vcard</CTType>
                <VerCT>2.1</VerCT>
              </Rx>
              <Tx-Pref>
                <CTType>text/vcard</CTType>
                <VerCT>3.0</VerCT>
              </Tx-Pref>
              <Tx>
                <CTType>text/vcard</CTType>
                <VerCT>2.1</VerCT>
              </Tx>
              <CTCap>
                <CTType>text/x-vcard</CTType>
                <PropName>BEGIN</PropName>
                <ValEnum>VCARD</ValEnum>
                <PropName>END</PropName>
                <ValEnum>VCARD</ValEnum>
                <PropName>VERSION</PropName>
                <ValEnum>2.1</ValEnum>
                <PropName>N</PropName>
                <PropName>TEL</PropName>
                <ParamName>VOICE</ParamName>
                <ParamName>FAX</ParamName>
                <ParamName>CELL</ParamName>
              </CTCap>
              <CTCap>
                <CTType>text/x-vcard</CTType>
                <PropName>BEGIN</PropName>
                <ValEnum>VCARD</ValEnum>
                <PropName>END</PropName>
                <ValEnum>VCARD</ValEnum>
                <PropName>VERSION</PropName>
                <ValEnum>3.0</ValEnum>
                <PropName>N</PropName>
                <PropName>TEL</PropName>
                <ParamName>VOICE</ParamName>
                <ParamName>FAX</ParamName>
                <ParamName>CELL</ParamName>
              </CTCap>
              <SyncCap>
                <SyncType>1</SyncType>
                <SyncType>2</SyncType>
                <SyncType>3</SyncType>
                <SyncType>4</SyncType>
                <SyncType>5</SyncType>
                <SyncType>6</SyncType>
              </SyncCap>
            </DataStore>
          </DevInf>
        </Data>
      </Item>
      <CmdRef>3</CmdRef>
      <CmdID>4</CmdID>
      <Meta>
        <Type xmlns="syncml:metinf">application/vnd.syncml-devinf+xml</Type>
      </Meta>
      <TargetRef>./devinf12</TargetRef>
    </Results>
  </SyncBody>
</SyncML>

以下是客户发送的内容:

<?xml version="1.0"?>
<!DOCTYPE SyncML PUBLIC "-//SYNCML//DTD SyncML 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd">
<SyncML xmlns="SYNCML:SYNCML1.2">
  <SyncHdr>
    <VerDTD>1.2</VerDTD>
    <VerProto>SyncML/1.2</VerProto>
    <SessionID>14</SessionID>
    <MsgID>2</MsgID>
    <Target>
      <LocURI>http://localhost:8880</LocURI>
    </Target>
    <Source>
      <LocURI>IMEI:356406027185460</LocURI>
    </Source>
    <Meta>
      <MaxMsgSize xmlns="syncml:metinf">10000</MaxMsgSize>
    </Meta>
  </SyncHdr>
  <SyncBody>
    <Status>
      <CmdID>1</CmdID>
      <MsgRef>1</MsgRef>
      <CmdRef>0</CmdRef>
      <Cmd>SyncHdr</Cmd>
      <TargetRef>IMEI:356406027185460</TargetRef>
      <SourceRef>http://localhost:8880</SourceRef>
      <Data>200</Data>
    </Status>
    <Status>
      <CmdID>2</CmdID>
      <MsgRef>1</MsgRef>
      <CmdRef>4</CmdRef>
      <Cmd>Results</Cmd>
      <Data>415</Data>
    </Status>
  </SyncBody>
</SyncML>

将一个元素放入/移出Item中的一个注释不会改变一个东西。 我在那个阶段基本上迷路了..

1 个答案:

答案 0 :(得分:1)

响应代码是SyncML响应.. 可能你有不支持的媒体类型或格式。不受支持的内容 类型或格式也应该在项目中标识 状态中的元素类型。

检查......