NetSuite - Postman - REST - "Incorrect data center requested!" - soap

I'm using Postman to connect to NetSuite and all the setup and authorization were made.
When I'm trying to use GET method for a Example template, the request return the Status 200 OK, but with this error?
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>
soapenv:Server.userException
</faultcode>
<faultstring>
Incorrect data center requested! The data center you are requesting is not the data center where your account is hosted. To obtain the correct URL for your request, please use the SOAP getDataCenterUrls operation.
</faultstring>
<detail>
<platformFaults:unexpectedErrorFault xmlns:platformFaults="urn:faults_/services/rest/record/v1/metadata-catalog/customer.platform.webservices.netsuite.com">
<platformFaults:code>
USER_ERROR
</platformFaults:code>
<platformFaults:message>
Incorrect data center requested! The data center you are requesting is not the data center where your account is hosted. To obtain the correct URL for your request, please use the SOAP getDataCenterUrls operation.
</platformFaults:message>
</platformFaults:unexpectedErrorFault>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">
acct027.prod.svale.netledger.com
</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
My URL setup is the same from my Company URL setup:
I've seen other cases like that, and all the responses were related to get the address in the company URL as I've done it.
What can be wrong?
Thank you!

Actually, I had some errors in my postman setup:
The Account_ID, should be entered exactly like this, in capital letters:
But the company URL, and Rest Services should stay like that:
And it worked for me.

Related

Retrieve SOAP Request Valid from XSD

I have this kind of "guidelines" to call a SOAP service:
URL: http://80.211.113.172:8080/soap
No WSDL at all!
The XSD for request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="/soap_serv" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPENC="http://schemas.xmlsoap.org/soap/encoding/" SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:TRACKING>
<ldv xsi:type="xsd:string">2020.00.0070423</ldv>
<codcli xsi:nil="true"/>
<rifcli xsi:nil="true"/>
<anno_bl xsi:nil="true"/>
</ns1:TRACKING>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Does anyone know how to create a request object to send with SoapUI?
The XML you are showing isn't an XML Schema (or XSD file). As pointed out in the comment by #kimbert, that is actually an SOAP XML message. The payload inside it is what an XML instance of an XSD schema would be.
You have two options:
ask for a WSDL for the web service so that you can generate some client code to help you with the calls.
if a WSDL is not available, ask for better documentation for how to call the service. Not sure where you got that example but is the operation name TRACKING? Is the ns1 prefix pointing to the correct namespace? Should the elements inside the TRACKING element also be in this namespace? Note also that you are using codcli and rifcli in your call, when that guideline shows cod_cli and rif_cli. You most likely also need to send values for your elements, not have them null like that.
Not having a WSDL or valid up to date documentation for how the exchanged messages should look like will make things very difficult for you in interacting with the web service.

How do I log into SalesForce using SOAP in JMeter?

My app usually ask the user to log into SalesForce using this URL.
https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=ABC&redirect_uri=http://localhost:3001/callback_URL&state=5abe9eb7b39bae29fcc2dcf9
If successful will call the callbackURL and let the application know login was successful. I would like to mimic this behavior in JMeter.
I tried following the tutorial in this link exactly:
http://blog.deadlypenguin.com/blog/2017/06/29/jmeter-logging-salesforce/
But it's not return a session ID. What am I doing wrong?
Here is how I set it up as per the tutorial:
This is the SalesForce information in step: credentials
Here is the Login Request, as described in step: logging in
Here is the Header config for the login request, as described in the step: loggin in
Here is how I save the convsation, as described in the step: storing session id
Here is what the request sent look like:
POST http://test.salesforce.com/services/Soap/c/42.0
POST data:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
<soapenv:Header></soapenv:Header>
<soapenv:Body>
<urn:login>
<urn:username>USERNAME</urn:username>
<urn:password>PASSWORDTOKEN</urn:password>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
[no cookies]
Request Headers:
Connection: close
Content-Type: text/xml: charset=utf-8
SOAPAction: "urn:enterprise.soap.sforce.com/Soap/loginRequest"
Content-Length: 390
Host: test.salesforce.com
User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_161)
And here is the response back:
Formatted XML:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>INVALID_LOGIN</faultcode>
<faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring>
<detail>
<sf:LoginFault xsi:type="sf:LoginFault">
<sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>
<sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage>
</sf:LoginFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
I am sure the username and password I used is correct, so there must be some other error. I notice in the tutorial it append the Token after the password. Where do I get that? What token is it talking about?
I am not an expert in sales force. But from your description it looks like you are not passing the security token along with the password which is shown in the reference. So, authentication required "Password + Security token". From your first snapshot, I am getting both. i.e. ${SF_Password}${SF_Token}.
Try it and let us know if it solves the issue or not.
Regards,

Why do i get "Wrong API base URL used" when pinging Adobe EchoSign Cloud by a SOAP request?

I am trying to access signed documents within the Adobe EchoSign Cloud. I have got an API key for authentication and used it in a testPing SOAP request like
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:api="http://api.echosign">
<soapenv:Header/>
<soapenv:Body>
<api:testPing>
<api:apiKey>myKeyhere</api:apiKey>
</api:testPing>
</soapenv:Body>
</soapenv:Envelope>
I sent this request to
https://secure.echosign.com/services/EchoSignDocumentService22
But as a result I only get
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Wrong API base URL used</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
What does that message mean?
I suspect Cross-Domain but you should test it with fiddler. It reports you more clean data with your problem.
I found an important note in the Adobe documentation:
However, starting from version 22 of the Document API, all API calls must be made on a specific base URL obtained either using the OAuth workflow (the api_access_point parameter that is included with an authorization code) or by making a call to the getBaseUris method. The corresponding gateway can then be constructed by concatenating the base URL with "services/EchoSignDocumentService22". Calls made on the wrong base URL will result in an exception indicating that the wrong API base URL was used. Note that getBaseUris itself can be called on any appropriate gateway, including the one mentioned above.
Calling getBaseUris indeed returns another URI which then can be used for subsequent requests.

Correct envelope to use for a SOAP request?

I'm trying to integrate with the SOAP API specified here:
https://api.okpay.com/OkPayAPI?singleWsdl
https://api.okpay.com/OkPayAPI?wsdl
At the moment the code autogenerated from the wsdl files appears to be acting up, so I'm wondering what should be the correct envelope to send and where should I be sending it?
I used this service for testing: http://www.soapclient.com/soapmsg.html . For server address I put in:
https://api.okpay.com/
And for SOAP Message I put in what my code is currently generating:
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Body xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Get_Date_Time xmlns="https://api.okpay.com"></Get_Date_Time></Body></Envelope>
And the response appears to be a HTML code of a page, rather than an envelope response.
What would be the correct SOAP Action / Message to what Server Address to send in order to invoke the Get_Date_Time method as specified in the WSDL?
A couple of things:
The "Server Address" needs to point at the actual service, so in this case
https://api.okpay.com/OkPayAPI
The action can be seen in the WSDL, in this case
https://api.okpay.com/I_OkPayAPI/Get_Date_Time
Have a look at the WSDL and search for the action I gave above, that should give you an idea for how to find it for other actions.
With those two updates you should get back the response you expect:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<Get_Date_TimeResponse xmlns="https://api.okpay.com">
<Get_Date_TimeResult>2015-01-31 17:52:37</Get_Date_TimeResult>
</Get_Date_TimeResponse>
</s:Body>
</s:Envelope>

Using JMeter SOAP/XML-RPC Request to call ChemSpell Web Service

I'm trying to test the web service api for a free service called ChemSpell. I am trying to use JMeter's SOAP/XML-RPC Request option to test it. I am a bit new at this and not sure what to enter in. The call expects two parameters, which for testing purposes I want to set to the following:
Name = "formeldehyde"
Source = "All databases"
Based on their site I'm putting "http://chemspell.nlm.nih.gov:80/axis/SpellAid.jws" for the URL and "http://chemspell.nlm.nih.gov" in Send SOAPAction. I'm not sure how to configure the "Soap/XML-RPC Data" portion. I'm thinking the WSDL file they provide should give me everything I need to configure that section, but I'm not exactly sure how. Any help is much appreciated!
You need to create the xml that will be sent to the webservice, based on the wsdl, and paste it in the SOAP/XML-RPC data field.
The xml will describe the method call you wish to make and the data you wish to pass to it.
It will look like this (you will need to replace ? with data):
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:spel="http://chemspell.nlm.nih.gov/axis/SpellAid.jws/axis/SpellAid.jws">
<soapenv:Header/>
<soapenv:Body>
<spel:getSugList soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<name xsi:type="xsd:string">?</name>
<src xsi:type="xsd:string">?</src>
</spel:getSugList>
</soapenv:Body>
</soapenv:Envelope>
The easiest way to generate blank requests like the above is using SOAP UI. You just give the wsdl URL and it generates all possible requests for you. I copy and paste these over to JMeter.