문제

나는 사용하려고한다 Java Healthvault API "오프라인"모드 (즉, 사용자가 로그인 할 필요가 없음)에서 GetThings 메소드를 호출하려면 모든 "파일"유형 항목을 검색합니다. 내가 이해 한 바에 따르면, 오프라인 요청을하는 데 필요한 것은 사용자 계정의 Persion ID 및 Record ID입니다. 그러나 요청에 이것들을 추가하더라도 메소드 호출이 작동하지 않습니다. 응답에서 오류 코드 "67"을 반환하며, API의 정적 변수에 따르면 "유효하지 않은 사람 또는 그룹 ID"를 나타냅니다.

나는 Person ID와 Record ID를 두 번 확인했으며 실제로 정확합니다. "온라인"모드에서 동일한 요청을하는 것은 (즉, 사용자 수상을 포함시킬 때) 완벽하게 잘 작동합니다. 내 응용 프로그램은 모든 "파일"항목 유형에 오프라인 액세스를 허용하도록 구성되어 있으므로 액세스 문제가 될 수 없습니다.

보안상의 이유로 실제 개인 ID와 레코드 ID를 아래 코드 샘플에서 가짜 ID로 대체했습니다.

내 Java 코드는 다음과 같습니다.

StringBuilder requestXml = new StringBuilder();
requestXml.append("<info><group>");
requestXml.append("<filter><type-id>bd0403c5-4ae2-4b0e-a8db-1888678e4528</type-id></filter>");
requestXml.append("<format><section>core</section><section>otherdata</section><xml/></format>");
requestXml.append("</group></info>");

Request request = new Request();
request.setMethodName("GetThings");
request.setOfflineUserId("e2f925e7-2748-4d88-bz48-32036dc10020");
request.setRecordId("73ab2792-5481-43eb-837c-67d1e3337300");
request.setInfo(requestXml.toString());

Connection connection = ConnectionFactory.getConnection();
HVAccessor accessor = new HVAccessor();
accessor.send(request, connection);

XML 요청이 생성됩니다.

<wc-request:request xmlns:wc-request="urn:com.microsoft.wc.request">
    <auth>
        <hmac-data algName="HMACSHA1">5WdiBnTvxsNbVHg134ggIETlJNE=</hmac-data>
    </auth>
    <header>
        <method>GetThings</method>
        <method-version>1</method-version>
        <record-id>73ab2792-5481-43eb-837c-67d1e3337300</record-id>
        <auth-session>
            <auth-token>ASAAAJQ1R50J8HpMshAjeHkjh/habVgM17BjSBuA/GmbJPV9A9d63mramakSZxf+ZHZh+7xWllTWGhAijBvxhNxauzBLci1IWWh+JDbGQZabnWbG7YH28ZP+FQuRPNP4T8O1NTNCFNETao0ly+UuPjWEZWCV5cCPX7GjaEJ4BMAFv4vAOEwIOe63VWntfzH9r3Rz0VnHAhb400iqs1XxlJrRbgXdNRdg</auth-token>
            <offline-person-info>
                <offline-person-id>e2f925e7-2748-4d88-bz48-32036dc10020</offline-person-id>
            </offline-person-info>
        </auth-session>
        <language>en</language>
        <country>US</country>
        <msg-time>2009-10-21T12:37:51.706-04:00</msg-time>
        <msg-ttl>180000</msg-ttl>
        <version>0.0.0.1</version>
        <info-hash>
            <hash-data algName="SHA1">oAZVXLGAUMfuVPrqjqb98yCb4/c=</hash-data>
        </info-hash>
    </header>
    <info>
        <group>
            <filter>
                <type-id>bd0403c5-4ae2-4b0e-a8db-1888678e4528</type-id>
            </filter>
            <format>
                <section>core</section>
                <section>otherdata</section>
                <xml />
            </format>
        </group>
    </info>
</wc-request:request>

XML 응답은 다시 얻습니다.

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <status>
        <code>67</code>
        <error>
            <message>Exception of type
                'Microsoft.Health.Platform.WildcatStatusException' was thrown.</message>
        </error>
    </status>
</response>

도와 주셔서 정말 감사합니다. :)

도움이 되었습니까?

해결책 2

문제는 내 사람과 레코드 ID가 실제로 ~이었다 잘못된. 나는 연결하는 동안 내가 얻은 것을 사용하고 있었다. 견본 내와 달리 응용 프로그램 소유하다 신청. 나는 그들이 응용 프로그램을 통해 변경된 것을 몰랐다. 내 신청서에서 GetPersonInfo를 호출 한 후 올바른 사람과 레코드 ID를 얻을 수있었습니다.

다른 팁

다른 사람은 그렇게함으로써 오류를 해결했습니다. 당신은 이미 이것을 시도 했습니까?

I got the error cleared up. I re-imported the certificate (found in the cert
folder) through the Healthvault Application Manager, cleared up the offline.txt
file and re-ran the application.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top