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 检索项目状态信息?
提前致谢。
I am trying to retrieve project information from Microsoft Project Server Project web service.
I use gSOAP to implement the client. Here is how my code looks like:
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;
}
Although the response from project server looks like:
<soap:Envelope ...>
<soap:Body ...>
<ReadProjectStatusResponse ...>
<ReadProjectStatusResult>
<xs:schema ...>
...
</xs:schema ...>
<diffgr:diffgram ...>
<ProjectDataSet ...>
....
</ProjectDataSet>
</diffgr:diffgram>
</ReadProjectStatusResult>
</ReadProjectStatusResponse>
</soap:Body>
</soap:Envelope>
when I open the file PROJECTINFO.XML (in which read_project_status_response.ReadProjectStatusResult->__any is written), I can see only the
<xs:schema ...>
...
</xs:schema>
part. Nothing about the project information.
Anyone knows why this happens and how I can retrieve project status info using gsoap?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
太少太晚了,但是这里...
项目服务器提供的 wsdl 不完整。看起来像这样。
将其更改为以下内容(注意 s:any 之前的额外 s:element)并使用 gsoap 重新编译。现在 gsoap 将创建 2 个成员变量(xsd__schema 和 __any)。 xsd__schema 将包含架构,__any 将携带正确的数据。
Too little too late, but here goes...
the wsdl provided by the project server is incomplete. It looks like this.
Change it to the following (note the extra s:element before s:any) and recompile using gsoap. Now gsoap will create 2 member variables (xsd__schema and __any). xsd__schema will contain the schema and __any will carry the right data.