나는 아래의 코드를 사용하여 salesforce.com API에 액세스하기 위해 C++에서 클라이언트를 gSoap를 사용하려고 시도하고있다 : 문제가 아니라 언제 실행하지 않고gSoap : HTTP 헤더, 콘텐츠 길이 : 0
struct soap soap;
soap_init(&soap);
_ns1__login loginReq;
_ns1__loginResponse loginRes;
loginReq.username = "XXXX";
loginReq.password = "XXXX";
if(soap_call___ns1__login(&soap,NULL,NULL,&loginReq,&loginRes) == 0){
qDebug() << loginRes.result->sessionId;
} else {
soap_print_fault(&soap, stderr);
soap_print_fault_location(&soap, stderr);
}
이 준수를 다음과 같은 오류 발생 : 나는 패킷 캡처를 실행 한
SOAP 1.1 fault: SOAP-ENV:Client [no subcode]
"Validation constraint violation: tag name or namespace mismatch in element <soapenv:Envelope>"
Detail: [no detail]
HTTP/1.1 500 Internal Server Error
Server:
Content-Type: text/xml; charset=UTF-8
Content-Length: 625
Date: Fri, 29 Apr 2011 00:56:17 GMT
Connection: close
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>UNKNOWN_EXCEPTION</faultcode><faultstring>UNKNOWN_EXCEPTION: Premature end of file.</faultstring><detail><sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault"><sf:exceptionCode>UNKNOWN_EXCEPTION</sf:exceptionCode><sf:exceptionMessage>Premature end of file.</sf:exceptionMessage></sf:UnexpectedErrorFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
<!-- ** HERE ** -->
를 모든 것이 0 HTTP 헤더에 '콘텐츠 길이'를 제외하고 올바른 모습을 보여줍니다
POST /services/Soap/c/21.0 HTTP/1.1
Host: login.salesforce.com
User-Agent: gSOAP/2.7
Content-Type: text/xml; charset=utf-8
Content-Length: 0
Connection: close
SOAPAction: ""
<?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:ns2="urn:sobject.enterprise.soap.sforce.com" xmlns:ns3="urn:fault.enterprise.soap.sforce.com" xmlns:ns1="urn:enterprise.soap.sforce.com"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><ns1:login><ns1:username>XXXX</ns1:username><ns1:password>XXXX</ns1:password></ns1:login></SOAP-ENV:Body></SOAP-ENV:Envelope>
을
누군가 내가 잘못 가고 있다는 것에 대한 통찰력이 있다면 크게 감사하겠습니다.
데비안 6.0에서 g ++ 4.4.5를 사용하여 gSoap 2.7을 사용하고 있는데, 이것이 도움이된다면 컴파일해야합니다.
이상하게 들릴지 모르겠지만 VC++, gSOAP 및 salesforce.com에서 작동하는 단서를 찾으려고합니다. 괜찮 으면 몇 가지 서류를 보여 주시겠습니까? –