2013-10-21 7 views
1

EWS 프록시 클래스에서 작동하는 응용 프로그램을 작성하려고합니다. 프록시 클래스를 생성하기 위해 gsoap (컴파일 된 OpenSSL)을 사용했습니다. 저는 EWS에서 작동하는 라이브러리를 구현했습니다. 그물. 문제는 다음과 같습니다. 서버 연결을 구현하는 방법을 모르겠습니다. 다음을 수행 :, 그 결과gSoap Exchange 웹 서비스 연결

ExchangeServiceBindingProxy *proxy = new ExchangeServiceBindingProxy("https://192.168.0.49/EWS/exchange.asmx"); 
soap *pSoap = proxy->soap; 
pSoap->userid = "user1"; 
pSoap->passwd = "password1"; 
pSoap->recv_timeout = 300; 
pSoap->send_timeout = 300; 

SOAP_ENV__Header *header = new SOAP_ENV__Header(); 
header->ns3__RequestServerVersion = new _ns3__RequestServerVersion(); 
header->ns3__RequestServerVersion->soap = pSoap; 
header->ns3__RequestServerVersion->Version = ns3__ExchangeVersionType__Exchange2010; 
pSoap->header = header; 

//get root folder ID 
ns3__DistinguishedFolderIdType *dfit = new ns3__DistinguishedFolderIdType(); 
dfit->Id = ns3__DistinguishedFolderIdNameType__inbox; 

//set the props that we want to retrieve 
ns3__FolderResponseShapeType *frst = new ns3__FolderResponseShapeType(); 
frst->BaseShape = ns3__DefaultShapeNamesType__AllProperties; 

//get folder 
ns1__GetFolderType *gftRoot = new ns1__GetFolderType(); 
gftRoot->FolderIds = new ns3__NonEmptyArrayOfBaseFolderIdsType(); 
gftRoot->FolderIds->__union_NonEmptyArrayOfBaseFolderIdsType = new __ns3__union_NonEmptyArrayOfBaseFolderIdsType(); 
gftRoot->FolderIds->__union_NonEmptyArrayOfBaseFolderIdsType->union_NonEmptyArrayOfBaseFolderIdsType.DistinguishedFolderId = dfit; 
gftRoot->FolderShape = frst; 
__ns1__GetFolderResponse response; 


int error = proxy->GetFolder(gftRoot, response); 

오류를 받고 : SLL_ERROR합니다.

나는 그것이 잘못된 것을하고 있음을 알고있다. 근데 뭐? 프록시 클래스 기능을 사용하려면 어떻게해야합니까?

답변

0

직접 해결 : 프로젝트 LibNTLM에 추가되고 전 처리기 WITH_NTLM에 추가되었습니다.

또한, 약간의 코드를 변경 :

ExchangeServiceBindingProxy *proxy = new ExchangeServiceBindingProxy(endpoint.c_str()); 

soap *pSoap = proxy->soap; 
pSoap->userid = "Ivan1"; 
pSoap->passwd = "1"; 
pSoap->ntlm_challenge = ""; 
pSoap->authrealm = "Ursa-Minor"; 

pSoap->ssl_flags = SOAP_SSL_NO_AUTHENTICATION; 
//pSoap->keep_alive = true; 
pSoap->mode = SOAP_IO_KEEPALIVE; 

//get root folder ID 
ns3__DistinguishedFolderIdType *dfit = new ns3__DistinguishedFolderIdType(); 
dfit->Id = ns3__DistinguishedFolderIdNameType__inbox; 

//set the props that we want to retrieve 
ns3__FolderResponseShapeType *frst = new ns3__FolderResponseShapeType(); 
frst->BaseShape = ns3__DefaultShapeNamesType__AllProperties; 

//get folder 
ns1__GetFolderType *gftRoot = new ns1__GetFolderType(); 
gftRoot->FolderIds = new ns3__NonEmptyArrayOfBaseFolderIdsType(); 
gftRoot->FolderIds->__size_NonEmptyArrayOfBaseFolderIdsType = 1; 
gftRoot->FolderIds->__union_NonEmptyArrayOfBaseFolderIdsType = new __ns3__union_NonEmptyArrayOfBaseFolderIdsType(); 
gftRoot->FolderIds->__union_NonEmptyArrayOfBaseFolderIdsType->union_NonEmptyArrayOfBaseFolderIdsType.DistinguishedFolderId = dfit; 
gftRoot->FolderIds = (ns3__NonEmptyArrayOfBaseFolderIdsType*)dfit; 
gftRoot->FolderShape = frst; 
__ns1__GetFolderResponse response; 

int qq = proxy->GetFolder(gftRoot, response); 

return true; 

을하지만 지금은 enother 문제가 : Error 500: Internal Server Error