구문 분석 XML - XML 트리에서 값을 가져옵니다
-
12-12-2019 - |
문제
NINTEX 워크 플로우를 사용하고 있습니다.i GetUserProfile.asmx에서 웹 서비스를 추가하고 데이터를 검색하도록 구성되었습니다.웹 서비스를 추가 한 후 NINTEX는 비누가 어떻게 생겼는지 확인할 수 있습니다.여기 비누가 있습니다.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetUserPropertyByAccountName xmlns="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService">
<accountName>{WorkflowVariable:tmpApprover}</accountName>
<propertyName>PreferredName</propertyName>
</GetUserPropertyByAccountName>
</soap:Body>
</soap:Envelope>
.
NINTEX는 또한 결과가 XML에서 어떻게 생겼는지 확인할 수 있습니다.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetUserPropertyByAccountNameResponse xmlns="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService">
<GetUserPropertyByAccountNameResult>
<IsPrivacyChanged>false</IsPrivacyChanged>
<IsValueChanged>false</IsValueChanged>
<Name>PreferredName</Name>
<Privacy>Public</Privacy>
<Values>
<ValueData>
<Value xsi:type="xsd:string">Holmberg, Nancy</Value>
</ValueData>
</Values>
</GetUserPropertyByAccountNameResult>
</GetUserPropertyByAccountNameResponse>
</soap:Body>
</soap:Envelope>
.
I "Query XML"을 추가하고 사용자 프로필 데이터베이스에서 기본 이름을 기본 이름으로 변형 시도했으며 "FalseFalSepreferrednamePublicholmberg, Nancy"를 제공합니다.
여기에 내가 시도한 코드 중 일부는
/soap:Envelope/soap:Body/defaultNS:GetUserPropertyByAccountNameResponse/defaultNS:GetUserPropertyByAccountNameResult/defaultNS:Values/defaultNS:ValueData/defaultNS:Value/@xsi:type
.
또는
//defaultNS:xml/defaultNS:Values/defaultNS:ValueData/defaultNS:Value
.
또는
//defaultNS:xml/defaultNS:Name
.
또는
//@PreferredName
.
그러나 그들은 모두 나에게 나에게 긍정적으로줍니다, 낸시.나는 holmberg, 낸시를 주어야합니다.
제안하십시오.
해결책
나는 이것을 따라 갔다. 그리고 그것은이 문제를 해결했다.
XML이 포함 된 변수를 TextXML이라고하는 경우 쿼리 XML 작업에서 워크 플로 변수에 대한 참조를 삽입하고 다음과 같이 표시됩니다.
<xml xmlns="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService">
{WorkflowVariable:textXML}
</xml>
. 제휴하지 않습니다 StackOverflow