What are Servicenow SOAP API getkeys wildcards? - soap

I'd like to use a SOAP request to get a list of items in servicenow table, that have description starting with "TEST".
I am able to send a simple getKeys request. For example the below one is successfully returning to me the sys_id of a single ticket:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hr="http://www.service-now.com/hr_case">
<soapenv:Header/>
<soapenv:Body>
<hr:getKeys>
<short_description>TEST Soap 1</short_description>
</hr:getKeys>
</soapenv:Body>
</soapenv:Envelope>
How should I modify the above request, so that it returns keys of all items with description starting with "TEST"?

I've used instead a REST webservice with the URI:
https://???.service-now.com/api/now/table/hr_case?sysparm_query=short_descriptionSTARTSWITHTEST
before then I tried a URI like that:
https://???.service-now.com/api/now/table/hr_case?&short_description=TEST Soap 1

Related

Do we have any SOAP API or REST API which will give us response/metadata with custom form and its fields

I am trying to get the metadata/fields of the custom forms in Netsuite. But the documentation of netsuite does not provide any direct way of doing this. Some pages mentioned using the SOAP Api's, So i tried using the SOAP api. Here is my api request in SOAP.
<?xml version="1.0"?>
<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Header>
<ns1:searchPreferences
xmlns:ns1="urn:messages_2022_1.platform.webservices.netsuite.com" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">
<ns1:pageSize>30</ns1:pageSize>
</ns1:searchPreferences>
<ns2:tokenPassport soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"
xmlns:ns2="urn:messages_2022_1.platform.webservices.netsuite.com">
<ns3:account
xmlns:ns3="urn:core_2022_1.platform.webservices.netsuite.com">{{ACCOUNT}}
</ns3:account>
<ns4:consumerKey
xmlns:ns4="urn:core_2022_1.platform.webservices.netsuite.com">{{CONSUMER_KEY}}
</ns4:consumerKey>
<ns5:token
xmlns:ns5="urn:core_2022_1.platform.webservices.netsuite.com">{{TOKEN_ID}}
</ns5:token>
<ns6:nonce
xmlns:ns6="urn:core_2022_1.platform.webservices.netsuite.com">{{nonce}}
</ns6:nonce>
<ns7:timestamp
xmlns:ns7="urn:core_2022_1.platform.webservices.netsuite.com">{{timestamp}}
</ns7:timestamp>
<ns8:signature
xmlns:ns8="urn:core_2022_1.platform.webservices.netsuite.com" algorithm="HMAC-SHA256">{{signature}}
</ns8:signature>
</ns2:tokenPassport>
</soapenv:Header>
<soapenv:Body>
<getSelectValue>
<fieldDescription
xmlns:platformCore="urn:core_2022_1.platform.webservices.netsuite.com">
<platformCore:recordType>salesOrder</platformCore:recordType>
<platformCore:sublist
xmlns="urn:core_2022_1.platform.webservices.netsuite.com">customForm
</platformCore:sublist>
<platformCore:field>salesOrder</platformCore:field>
<platformCore:filterByValueList>
<platformCore:filterBy>
<platformCore:field>entity</platformCore:field>
<platformCore:internalId>164</platformCore:internalId>
</platformCore:filterBy>
</platformCore:filterByValueList>
</fieldDescription>
<pageIndex>1</pageIndex>
</getSelectValue>
</soapenv:Body>
</soapenv:Envelope>
The authorization and the signature generation are working correctly and it return actual response from netsuite. The response contains the list of all custom forms, but not the metadata/fields of the form i put in the filter part.
If there is any other way to do this let me know.

Unable to create listview using metadata api on Salesforce

I am new to Salesforce metadata api. I want to create a listview of contacts on Salesforce using metadata api.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
<soap:Header>
<met:AllOrNoneHeader>
<met:allOrNone>false</met:allOrNone>
</met:AllOrNoneHeader>
<met:CallOptions>
<met:client>https://xyz.salesforce.com</met:client>
</met:CallOptions>
<met:SessionHeader>
<met:sessionId>xyz</met:sessionId>
</met:SessionHeader>
</soap:Header>
<soap:Body>
<met:createMetadata>
<!--Zero or more repetitions:-->
<met:metadata>
<!--Optional:-->
<met:fullName>TESTVIEW__c</met:fullName>
</met:metadata>
</met:createMetadata>
</soap:Body>
</soap:Envelope>
I am getting
[
{
"errorCode": "METHOD_NOT_ALLOWED",
"message": "HTTP Method 'POST' not allowed. Allowed are HEAD,GET"
}
]
The endpoint I use is:
https://xyz.salesforce.com/services/data/v51.0/sobjects/Contact/listviews
I updated to SOAP endpoint:
https://xyz-dev-ed.my.salesforce.com/services/Soap/m/51.0/1112312DRED21
Now I am getting
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>content-type of the request should be text/xml</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
I guess I am one step closer. Is the payload valid for creation of contact listview?
You can't do a Metadata API deployment by making a POST to the REST API endpoint.
If you want to use a REST endpoint, use the REST deployRequest endpoint. If you want to use the SOAP createMetadata() call to which your payload appears to be oriented, you need to use the SOAP API.

Workday - SOAP API - Create_Requisition_Request SOAP Payload

I am working on Workday SOAP API. Using SOAP API - I am trying to create a Job Requisition (Create_Requisition_Request) and I am struggling with what valid values could be for each attribute and element. Could anyone please help me with some sample requests or point me to the link where I could get the valid values for each elements and attributes. Any help on this would be highly appreciated.
I have filled the xml payload with minimal information. you can add or remove some fields.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc">
<soapenv:Header/>
<soapenv:Body>
<bsvc:Create_Requisition_Request bsvc:version="v27.2">
<bsvc:Business_Process_Parameters>
<bsvc:Auto_Complete>true</bsvc:Auto_Complete>
<bsvc:Run_Now>true</bsvc:Run_Now>
<bsvc:Comment_Data>
<bsvc:Comment>Create Job Requisition using WWS</bsvc:Comment>
</bsvc:Comment_Data>
</bsvc:Business_Process_Parameters>
<bsvc:Create_Job_Requisition_Data>
<bsvc:Position_Restriction_Reference>
<bsvc:ID bsvc:type="Position_ID">Your Position ID eg P-00300</bsvc:ID>
</bsvc:Position_Restriction_Reference>
<bsvc:Number_of_Openings>1</bsvc:Number_of_Openings>
<bsvc:Job_Requisition_Data>
<bsvc:Job_Requisition_ID>MY-REQ-001</bsvc:Job_Requisition_ID>
<bsvc:Job_Posting_Title>Software Engineer</bsvc:Job_Posting_Title>
<bsvc:Recruiting_Start_Date>2018-01-01</bsvc:Recruiting_Start_Date>
<bsvc:Target_Hire_Date>2018-01-01</bsvc:Target_Hire_Date>
<bsvc:Job_Profile_Reference>
<bsvc:ID bsvc:type="Job_Profile_ID">Enter Job profile ID (it should be in your tenant)</bsvc:ID>
</bsvc:Job_Profile_Reference>
<bsvc:Worker_Type_Reference>
<bsvc:ID bsvc:type="Worker_Type_ID">Employee</bsvc:ID>
</bsvc:Worker_Type_Reference>
<bsvc:Worker_Sub-Type_Reference>
<bsvc:ID bsvc:type="Employee_Type_ID">Regular</bsvc:ID>
</bsvc:Worker_Sub-Type_Reference>
<bsvc:Primary_Location_Reference bsvc:Descriptor="nimborum in">
<bsvc:ID bsvc:type="Location_ID">Toronto_site</bsvc:ID>
</bsvc:Primary_Location_Reference>
<bsvc:Position_Time_Type_Reference bsvc:Descriptor="animos et temperat">
<bsvc:ID bsvc:type="Position_Time_Type_ID">Full_time</bsvc:ID>
</bsvc:Position_Time_Type_Reference>
<bsvc:Scheduled_Weekly_Hours>40</bsvc:Scheduled_Weekly_Hours>
</bsvc:Job_Requisition_Data>
</bsvc:Create_Job_Requisition_Data>
</bsvc:Create_Requisition_Request>
</soapenv:Body>
</soapenv:Envelope>

How to get response value from Currency Converter service response through groovy script in SoapUI?

I'm using Currency Converter webservice to practice groovy script in SoapUI Pro.
In that, I have created a property that should get response / output of the Currency Converter service through groovy script.
For that, I tried the following script which gets all the raw response data :(
I need to get the exact result i.e. converted value and assign to the property.
Can anyone provide me the correct groovy script?
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/">
<soapenv:Header/>
<soapenv:Body>
<web:ConversionRate>
<web:FromCurrency>USD</web:FromCurrency>
<web:ToCurrency>INR</web:ToCurrency>
</web:ConversionRate>
</soapenv:Body>
</soapenv:Envelope>
Response:
<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>
<ConversionRateResponse xmlns="http://www.webserviceX.NET/">
<ConversionRateResult>60.54</ConversionRateResult>
</ConversionRateResponse>
</soap:Body>
</soap:Envelope>
Thanks
Karunagara Pandi
First you need access to the Response.
def conversionRateResult = context.expand( '${step_name#Response#//*:ConversionRateResult}' )
Then to assign it to a property depends on multiple things: 1) where are you doing it from, and 2) where do you want the property assigned.
To crawl the hierarchy from a script step, you would do something like:
testRunner.testCase.setPropertyValue("property_name", conversionRateResult)
Consider browsing through the documentation and API.

How to deserialize soap response with multiref in .net?

I am making a .net wcf client for java ws. But when I make a request, and response contains fault, it also contains multiRef section. So I get this exception:
Server returned an invalid SOAP Fault.
End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope expected. Found element 'multiRef' from namespace ''
This is how response from server looks like (taken directly from network):
<soapenv:Envelope>
<soapenv:Header/>
<soapenv:Body>
<soapenv:Fault>...</soapenv:Fault>
<multiRef>...</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Is there any way to configure my wcf client to deserialize that message right ? Or a possibility to get a raw response xml?