У меня есть некоторые проблемы с ews (gSoap) для работы GetServerTimeZones.gSoap EWS «Проверка схемы ошибки»
мой клиент код:
//request
ews__GetServerTimeZonesType *zoneReq = new ews__GetServerTimeZonesType();
zoneReq->Ids = new ns1__NonEmptyArrayOfTimeZoneIdType();
zoneReq->Ids->Id.push_back("Eastern Standard Time");
bool val = false;
zoneReq->ReturnFullTimeZoneData = &val;
//response
__ews__GetServerTimeZonesResponse resp;
if(proxy->GetServerTimeZones(zoneReq, resp) == SOAP_OK)
std::cout << "Works!!" << std::endl;
После успешной компиляции, когда Run это я имею эту ошибку неисправности мыло:
SOAP 1.1 fault: ns1:ErrorSchemaValidation[no subcode]
"The request failed schema validation: This is an invalid xsi:type 'http://schemas.microsoft.com/exchange/services/2006/messages:GetServerTimeZonesType'." Detail: <e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode>
журнал посланных:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ews="http://schemas.microsoft.com/exchange/services/2006/messages">
<SOAP-ENV:Body>
<ews:GetServerTimeZones xsi:type="ews:GetServerTimeZonesType">
<ews:Ids>
<ns1:Id>Eastern Standard Time</ns1:Id>
</ews:Ids>
</ews:GetServerTimeZones>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
и RECEIVE:
HTTP/1.1 500 Internal Server Error
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation
</faultcode>
<faultstring xml:lang="en-US">The request failed schema validation: This is an invalid xsi:type 'http://schemas.microsoft.com/exchange/services/2006/messages:GetServerTimeZonesType'.
</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation
</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema validation.
</e:Message>
<t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:LineNumber>2</t:LineNumber>
<t:LinePosition>396</t:LinePosition>
<t:Violation>This is an invalid xsi:type 'http://schemas.microsoft.com/exchange/services/2006/messages:GetServerTimeZonesType'.</t:Violation>
</t:MessageXml>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Что я здесь делаю неправильно? Любая помощь оценивается. Если вам нужен еще один код, я также предоставил вам это. Спасибо.
UPDATE: Фактический XML-файл для запроса:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:ews="http://schemas.microsoft.com/exchange/services/2006/messages">
<SOAP-ENV:Header>
<ns1:MailboxCulture></ns1:MailboxCulture>
<ns1:RequestServerVersion Version="Exchange2013_SP1">
</ns1:RequestServerVersion>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ews:GetServerTimeZones ReturnFullTimeZoneData="false">
<ews:Ids>
<ns1:Id></ns1:Id>
<ns1:Id></ns1:Id>
</ews:Ids>
</ews:GetServerTimeZones>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Но в лог-файл, отправляемый там ReturnFullTimeZoneData="false"
отсутствует, так что я не уверен в этом, это может быть причиной этой проблемы?
UPDATE (2):
Вот отображение имен table-
#include "soapH.h"
SOAP_NMAC struct Namespace namespaces[] =
{
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL},
{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL},
{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
{"ns1", "http://schemas.microsoft.com/exchange/services/2006/types", NULL, NULL},
{"ews", "http://schemas.microsoft.com/exchange/services/2006/messages", NULL, NULL},
{NULL, NULL, NULL, NULL}
};
Может кто-нибудь сказать мне, есть ли должны быть изменения в этой таблице или нет? Спасибо.
Hi @Tom W, официальная документация для библиотеки gSoap: http://www.genivia.com/doc/soapdoc2.html#tth_sEc7.1.2, я думаю, что пространство имен prifix правильно, поскольку в файле services.h упоминаются соглашения являются: 'ews =" http://schemas.microsoft.com/exchange/services/2006/messages "' 'ns1 =" http://schemas.microsoft.com/exchange/services/2006/types " ' – Tushar
@IStar У меня есть те же сомнения, что и ваш, возможно, в нижней ссылке PLZ помочь мне. http://stackoverflow.com/questions/19562854/gsoap-ews-error-500-internal-server-error – Tushar
Привет @Tom W, я думаю, что вы правы, проблема может быть там, но знаете ли вы, как решить эту проблему ? Благодарю. – Tushar