gSOAP不从Web服务返回信息,而仅返回模式

|| 我正在尝试从Microsoft Project Server Project Web服务检索项目信息。 我使用gSOAP实现客户端。这是我的代码的样子:
if ( project.ReadProjectStatus(&read_project_status_message, &read_project_status_response) == SOAP_OK )
{
    ofstream project_info(\"C:\\\\PROJECTINFO.XML\");   
    project_info << read_project_status_response.ReadProjectStatusResult->__any;
}
尽管来自项目服务器的响应如下所示:
<soap:Envelope ...>
    <soap:Body ...>
        <ReadProjectStatusResponse ...>
            <ReadProjectStatusResult>
                <xs:schema ...>
                ...
                </xs:schema ...>
                <diffgr:diffgram ...>
                    <ProjectDataSet ...>
                    ....
                    </ProjectDataSet>
                </diffgr:diffgram>
            </ReadProjectStatusResult>
        </ReadProjectStatusResponse>
    </soap:Body>
</soap:Envelope>                   
当我打开文件PROJECTINFO.XML(其中写入了read_project_status_response.ReadProjectStatusResult-> __ any)时,我只能看到
<xs:schema ...>
    ...
</xs:schema> 
部分。与项目信息无关。 任何人都知道为什么会发生这种情况,以及如何使用gsoap检索项目状态信息? 提前致谢。     
已邀请:
        太少了,太晚了,但是这里... 项目服务器提供的wsdl不完整。看起来像这样。
  <s:element name=\"ReadProjectStatusResponse\">
    <s:complexType>
      <s:sequence>
        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ReadProjectStatusResult\">
          <s:complexType>
            <s:sequence>
              <s:any namespace=\"http://schemas.microsoft.com/office/project/server/webservices/ProjectDataSet/\" />
            </s:sequence>
          </s:complexType>
        </s:element>
      </s:sequence>
    </s:complexType>
  </s:element>
将其更改为以下内容(注意s:any之前的额外s:element)并使用gsoap重新编译。现在,gsoap将创建2个成员变量(xsd__schema和__any)。 xsd__schema将包含模式,而__any将携带正确的数据。
  <s:element name=\"ReadProjectStatusResponse\">
    <s:complexType>
      <s:sequence>
        <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ReadProjectStatusResult\">
          <s:complexType>
            <s:sequence>
              <s:element ref=\"s:schema\"/>
              <s:any namespace=\"http://schemas.microsoft.com/office/project/server/webservices/ProjectDataSet/\" />
            </s:sequence>
          </s:complexType>
        </s:element>
      </s:sequence>
    </s:complexType>
  </s:element>
    

要回复问题请先登录注册