XMLの解析 - XMLツリーから値を取得します
-
12-12-2019 - |
質問
Nintexワークフローを使用しています。私はWebサービスを追加し、getUserprofile.asmxからデータを取得するように設定されました。Webサービスを追加した後、NINTEXは、SOAPがどのように見えるようになりますか。これが石鹸です。
<?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>
.
私は「クエリXML」を追加し、ユーザープロファイルデータベースからreflededNameにXPathのバリエーションをいくつか試してみました。
これは私が試したコードのいくつかです
/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
.
しかし、それらはすべてFalseFalsePreferredNamePublicholmberg、ナンシーを与える。私は私にHolmberg、Nancy。
提案してください。
解決
私はこれを続き、その問題を解決しました。
XMLを含む変数をtextXMLと呼ばれている場合は、クエリXMLアクションで、ワークフロー変数への参照を挿入することができ、次のようになります。
<xml xmlns="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService">
{WorkflowVariable:textXML}
</xml>
. 所属していません StackOverflow