How can I determine the "correct" version of vqmver for the following vQmod xml script?
<?xml version="1.0" encoding="UTF-8"?>
<modification
xmlns="https://github.com/vqmod/vqmod"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://github.com/vqmod/vqmod https://raw.githubusercontent.com/vqmod/vqmod/master/vqmod.xsd"
>
<id>Replace 123 with ABC</id>
<version>1.0.0</version>
<vqmver>2.5.0</vqmver>
<author>qphoria</author>
<file name="relative/path/myfile.php">
<operation>
<search position="replace"><![CDATA[
$var = '123';
]]></search>
<add><![CDATA[
$var = 'ABC';
]]></add>
</operation>
</file>
</modification>
I have found some information here https://github.com/vqmod/vqmod/wiki/Scripting , but it doesn't explain in more details.
Related
Receving error Message : "org.mule.runtime.api.exception.MuleRuntimeException - Could not read from file store, while reading payload as Xml.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/amqp http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<amqp:config name="AMQP_Config" doc:name="AMQP Config" doc:id="e0e4ca51-72e7-4d3b-bf01-705aacee16f0" >
<amqp:connection host="orangutan.rmq.cloudamqp.com" port="5672" virtualHost="xxxx" username="xxxx" password="xxxx" />
</amqp:config>
<flow name="artvanFlow" doc:id="59d15f19-3a12-491a-90a0-b2c980dbb05a" >
<amqp:listener doc:name="Listener" doc:id="ea9cb6d6-ccad-4a7f-8925-5879b561910e" config-ref="AMQP_Config" queueName="PIMQueue" outputMimeType="application/xml"/>
<ee:transform doc:name="Transform Message" doc:id="cddf8b22-91af-46b4-a8d6-c4237de75307" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
{
INVMSTP: {
IMDEL: payload.Root.STG_SKU.Activity_Code default ""
}
}]]></ee:set-payload>
</ee:message>
</ee:transform>
<logger level="INFO" doc:name="Logger" doc:id="a3411653-aff7-4363-8d24-6c10334d816f" message="#[payload]"/>
</flow>
</mule>
Apple to resolve the issue. There is no issue with the mule code. Input XML has
<?xml version="1.0" **encoding="WINDOWS-1251"** standalone="yes"?>
if I change to
<?xml version="1.0" **encoding="utf-8"** standalone="yes"?>
Things are fine.
I am trying to create the tasks using ews but it is giving ErrorInvalidIdMalformed error.
I have already tried using wellknownfolders name and with task folder id but I am not able to create task
email_id = "xyz#pqr.onmicrosoft.com"
folder_id = "tasks"
# or folder_id="id of some task folder"
RestoreTASK = b'''<?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/"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2007_SP1" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
%s
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<CreateItem
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
MessageDisposition="SaveOnly">
<SavedItemFolderId>
<t:FolderId Id="%s"/>
</SavedItemFolderId>
<Items>
<t:Task>
<t:Subject>My task EWS</t:Subject>
<t:DueDate>2006-10-26T21:32:52</t:DueDate>
<t:Status>NotStarted</t:Status>
</t:Task>
</Items>
</CreateItem>
</soap:Body>
</soap:Envelope>''' % (email_id, folder_id)
ews_api_url = 'https://outlook.office365.com/EWS/Exchange.asmx'
response = requests.post(url=ews_api_url, headers = headers,
data=RestoreTASK)
So do I need to make changes in my soap request because folder id that I am specifing manually is correct.
Please help.
The error is telling you the folderId is wrong so how do you know its correct ? How did you retrieve the FolderId in the first place ? eg a simple test of you XML with DistinguishedFolderId works fine
<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/"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2007_SP1" />
</soap:Header>
<soap:Body>
<CreateItem
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
MessageDisposition="SaveOnly">
<SavedItemFolderId>
<t:DistinguishedFolderId Id="tasks"/>
</SavedItemFolderId>
<Items>
<t:Task>
<t:Subject>My task EWS</t:Subject>
<t:DueDate>2006-10-26T21:32:52</t:DueDate>
<t:Status>NotStarted</t:Status>
</t:Task>
</Items>
</CreateItem>
</soap:Body>
</soap:Envelope>
I have question about how to extract the SAML Response in jmeter, i follow these steps but it's not succeed and i don't know where is the problem :
- when i have the login Page, i send post request to the Idp provider to authenticate me (i give him, username and password), after that i will get SAML Response like this :
PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOn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2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjxzYW1sOkF0dHJpYnV0ZSB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIE5hbWU9InJlbmNvc3RjZW50ZXIiIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6dW5zcGVjaWZpZWQiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPkFBNTA4MTU8L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pjwvc2FtbDpBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4=
In jmeter i used: post regular expression extractor, i give him this regex to extract the SAMLResponse but it don't work :
name='SAMLResponse' value='([^"]+)'
If anyone can help me ?
This response is base64 encoded. You need to base64 decode this response. Save the response in a file, lets call it idpResponse.
If you have a linux shell run the command below to decode the response:
cat idpResponse | base64 -D
You contents are:
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
Consent="urn:oasis:names:tc:SAML:2.0:consent:obtained"
Destination="https://asfv2-sarah-dev.cfapps.renault.fr/saml"
ID="idaegi4-OfUpt3t6MeWvFhU4ovNfM"
InResponseTo="ID_3c62dc6a-297f-4361-ba87-b1f6f1bfa53a"
IssueInstant="2016-04-25T11:33:10Z" Version="2.0">
<saml:Issuer>
https://virtual872.labtech.pls.renault.fr:8443/nidp/saml2/metadata</saml:Issuer>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</samlp:Status>
<saml:Assertion ID="idoEAaiOJruD0lvAFvcPGTxA4GZV8"
IssueInstant="2016-04-25T11:33:11Z" Version="2.0">
<saml:Issuer>
https://virtual872.labtech.pls.renault.fr:8443/nidp/saml2/metadata</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<ds:Reference URI="#idoEAaiOJruD0lvAFvcPGTxA4GZV8">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<ds:DigestValue>
JCZ165dScExJIQRJ1G/WcBGrcrg=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
vRmUL8JH4zbU+nMwb9OuVJFYAchodke2E3HJzpbaQBwvFG3fzVMeyWsmgiZYOFG0R9N++yZod0gi
6SEanBEFUMZNrT5YRaEyR6Y7N6Jp5VHS0/YUcjujt7LHOihEgHY7geNMGq9yNFH37aFH6U3xfP42
qfuFAPHgwcLwBj1PgTwIm5FS05I8p/vUBbGb3RTjZlmotDvfXqHrelPsw6niPEi6I7SN7KNtVZUs
tA4bRgTcufgKMEVUhwV+ZvIJDfSV1ZgbuUp9GzRxtUbJnkNPob9it4z5LxQLARtZ+h/XxLJe4kHq
VaCUd4aZQGSikGujErPVUIxKQpGJzdOETKUS9Q==</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIIFWTCCBEGgAwIBAgICAg4wDQYJKoZIhvcNAQEFBQAwRTEQMA4GA1UECgwHUmVuYXV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AMCBsAwHQYDVR0lBBYwFAYIKwYBBQUH
AwIGCCsGAQUFBwMBMA4GA1UdDwEB/wQEAwIF4DAlBgNVHREEHjAcgRpkaWRpZXIucm9tZWxvdEBy
ZW5hdWx0LmNvbTBYBgNVHR8EUTBPME2gS6BJhkdodHRwOi8vY3JsLnJlbmF1bHQuZnIvQ1JML1Jl
bmF1bHRJbnRlcm5hbC9DbGFzczFBdXRoUHJlUHJvZHVjdGlvbkNBLmNybDBTBggrBgEFBQcBAQRH
MEUwQwYIKwYBBQUHMAGGN2h0dHA6Ly9jcmwucmVuYXVsdC5mci9vY3NwL1JlbmF1bHRJbnRlcm5h
bFByZVByb2R1Y3Rpb24wDQYJKoZIhvcNAQEFBQADggEBAE1DcpWVnVN5bvZBqFkjUV1zQioU/yE0
F6YVOn8NGvul3dgUInpDAu528CGU3mf4Wkwyg/AcicvuK+jbf6SNzuoqcCDjbqa6WaKFDHMgj1VD
GrfYBw/WddNG/t8DNcaJbmvW68F1W0NL1DwVDgfAQ+pWd/s64fFssm8rdYkf9KwzLPXKYIn74Ybr
+Ff+xfTXeU4aXkP57Z3IceoHVvgXmcByJA3jaY+Mt+c4At0sDgccozEK2XNXtN30ts0s2bxcU/NC
7URFJN0FO6xG7YoH2ba3ItJUzQyds4fxWT1Z97ghpx4dz9c9uw0xbBXhpVtBVvn9oL9BP4uGcLZa
ZveLyIM=</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
NameQualifier="https://virtual872.labtech.pls.renault.fr:8443/nidp/saml2/metadata"
SPNameQualifier="https://asfv2-sarah-dev.cfapps.renault.fr">
p080145</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData InResponseTo="ID_3c62dc6a-297f-4361-ba87-b1f6f1bfa53a"
NotOnOrAfter="2016-04-25T12:33:10Z"
Recipient="https://asfv2-sarah-dev.cfapps.renault.fr/saml" />
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2016-04-25T11:28:11Z"
NotOnOrAfter="2016-04-25T11:38:11Z">
<saml:AudienceRestriction>
<saml:Audience>
https://asfv2-sarah-dev.cfapps.renault.fr</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="2016-04-25T11:33:10Z"
SessionIndex="idoEAaiOJruD0lvAFvcPGTxA4GZV8">
<saml:AuthnContext>
<saml:AuthnContextClassRef>
urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml:AuthnContextClassRef>
<saml:AuthnContextDeclRef>
secure/name/password/uri</saml:AuthnContextDeclRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="uid"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xsi:type="xs:string">
p080145</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="preferredLanguage"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml:AttributeValue xsi:type="xs:string">
FR</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="mail"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xsi:type="xs:string">
sarah.hadbi#renault.com</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="givenName"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml:AttributeValue xsi:type="xs:string">
Sarah</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="sn"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xsi:type="xs:string">
Hadbi</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="cn"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xsi:type="xs:string">HADBI
Sarah</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="renpersontype"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml:AttributeValue xsi:type="xs:string">
ou=catSTGR,ou=PersonTypes,ou=TechnicalData,o=renault</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="Role1"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml:AttributeValue xsi:type="xs:string">
admin</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Name="rencostcenter"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
<saml:AttributeValue xsi:type="xs:string">
AA50815</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
</samlp:Response>
Your regex, name='SAMLResponse' value='([^"]+)' mixes quote types: ' and ". Your matching group matches "anything that isn't a " one or more times, and then a ' afterwards. I suspect that your pattern matches the trailing ', keeps going, and then can't find the ending ' because it already matched it in the ([^"]+).
If you're passing this value back into another request, that should be all you need to change. Otherwise, you'll have to do what Suresh Koya suggests.
use regex:
name='SAMLResponse' value='([\s\S]+?)'
I have the following code for generating a xml from a rabl template:
obj = OpenStruct.new
obj.categories = [{node: ["Foo","Bar"]},{node: ["Test1","Test2"]}]
Rabl::Renderer.xml(obj, 'adapter_xml')
and this is the rabl template adapter_xml.rabl
object #obj => :root
attributes :categories
which generates this XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<categories>
<category>
<node>
<node>Foo</node>
<node>Bar</node>
</node>
</category>
<category>
<node>
<node>Test1</node>
<node>Test2</node>
</node>
</category>
</categories>
</root>
But what I want to achieve is the following format, without the extra <node> tags:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<categories>
<category>
<node>Foo</node>
<node>Bar</node>
</category>
<category>
<node>Test1</node>
<node>Test2</node>
</category>
</categories>
</root>
Is there any way to do this with rabl? Or do I have to modify the ruby code mentioned first?
If ancestor nodes defines namespaces, I can use them:
> Nokogiri::XML(<<-XML
<?xml version='1.0' encoding='UTF-8'?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="bookid">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:creator opf:role="aut">John Doe</dc:creator>
</metadata>
</package>
XML
> xml.at_xpath("//dc:creator[#opf:role='aut']", xml.at_xpath("//xmlns:metadata").namespaces).text
=> "John Doe"
However, what shall I do with following XML?
> Nokogiri::XML(<<-XML
<?xml version='1.0' encoding='UTF-8'?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="bookid">
<metadata>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf" opf:role="aut">John Doe</dc:creator>
</metadata>
</package>
XML
> xml.at_xpath("//dc:creator[#opf:role='aut']", xml.at_xpath("//xmlns:metadata").namespaces).text
Nokogiri::XML::XPath::SyntaxError: Undefined namespace prefix: //dc:creator[#opf:role='aut']
I think xml.remove_namespaces! or literal namespace arguments for at_xpath is last resort.
To programmatically collect all the namespaces, use Document#collect_namespaces.
xml = Nokogiri::XML(xmldata)
ns = xml.collect_namespaces
puts xml.at('//dc:creator[#opf:role="aut"]', ns).text
Output:
John Doe