SalesForce SOAPUI Login call fails with SocketTimeoutException - salesforce

I am new to SalesForce and trying to setup my first call to Sandbox SalesForce.
I generated a Enterprise WSDL file and created the project in SOAPUI.
The login request has URL set to https://test.salesforce.com/services/Soap/c/48.0/0DFr0000XXXXXXX
<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>XXXX#XXXXXXX</urn:username>
<urn:password>Password+Token</urn:password>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
Getting java.net.SocketTimeoutException
I am able to put this URL in browser and get a response
https://test.salesforce.com/services/Soap/c/48.0/0DFr0000XXXXXXX
and get response
Only POST allowed
That means it might not be firewall issue??
Please help.

(not 100% an answer but too long for a comment)
It might be that you're behind a proxy or firewall. Maybe your browser automatically downloads some configuration script but in SoapUI and other tools like that you'd need to specify the proxy details manually. Do you have any other app that can connect OK? Data Loader? maybe simple ping test.salesforce.com? curl if you're familiar with it? Or tell SoapUI to GET www.google.com and see what happens? If these fail - talk with your IT about proxy details. Or try from another machine?
See if anything hit Salesforce. Go to your user in setup, scroll all the way down to login history, see if there's any non-browser activity.
It's possible your SF admin disabled logging in from generic test.salesforce.com. You can verify it in Setup -> My Domain. (but if you can login via browser just fine and it's with normal SF username and pass, no Single Sign-On tricks - ignore this point)
As stupid as it sounds - what's the timeout you have in SoapUI ;)

Related

Safaricom dashboard does not show all the test credentials

I am working on Safaricom Daraja API B2C but some of the required test credentials are not displayed in the Safaricom Dashboard.
As you can see above, the initiator name and security credentials are not provided yet they are needed in the B2C API call.
How do I get these credentials.
EDIT:
This question was asked before Safaricom upgraded to the new Daraja Dashboard. The problem has now been sorted
Apparently, for some unknown reason to us, Safaricom chose to hide the test credentials and if you need them, you have to write them an email at apisupport#safaricom.co.ke and request for the test credentials. You will get a response in less than an hour with shortcodes and initiators that you can use for test.
Source -> https://survtechnologies.co.ke/get-test-credentials-safaricom-m-pesa-daraja-api/
The test Credentials are on the simulator link, bottom right redirects to the link.
Please try this with the new mpesa portal2.0 - It is straight-forward

Not able to login the page with okta using Angularjs

i have created the simple login page using AngularJS integrate with okta api this POST API I am passing the parameters like:
1) Username
2) password
3) option:multiOptionalFactorEnroll:true
warnBeforePasswordExpired:true
it's throwing the 500 internal server error, can you help me how to fix this issue?
This is a CORS issue please add "Allow-access-control-origin": "*" in headers while doing a post request and also Check this link and allow your website to access the same
Cross Origin issues can be bypassed by disabling chrome web security (provided you are testing in chrome browser):
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --allow-file-access-from-files
But, please be advised this approach will work only in your local machine and for server you will need to use the approach as mentioned by #Neha Tawar

REST API call for TFS2013

Ok so I've read multiple articles on my topic but none seem to help. I'm trying to accomplish the same thing this guy wanted in this article here.
I used the example stated in the answer (https://{yourserver}/defaultcollection/_apis/git/repositories?api-version=1.0 ) in an angular http get request but I'm getting a 401 error saying the credentials i supplied were not valid.
I then downloaded curl and supplied the following command "curl -u username:password http://{myserver}/defaultcollection/_apis/git/repositories?api-version=1.0" and the result came back the same, html saying i do not have valid credentials. Can someone point me in the right direction so I can pull the projects root branch and childrens branches and data along with it?
Essentially I am searching for a way to pull data from the server and display it on my web app. I'll need branches names and history for each branch and child branch.
Update
So I'm now able cURL into this service using the --ntlm switch that Richard recommended. Now to actually get my app connected to the service I found that I could pass windows credentials using:
withCredentials:true
It no longer gives me a 401 error. Instead I am not getting a new error stating:
XMLHttpRequest cannot load http://{servername}/{defaultcollection}/_apis/projects?api-version=1.0. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
What are my next steps to get this working?
Solution
I took what Richard suggested and created my own asp.net web api to communicate with tfs. I was able to modify the web.config file to allow CORS. I added the following lines to the system.webServer section of the file.
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
Doing this has resolved the error message I was receiving and creating a simple api to get specific information was not too hard to do. Thanks for all the help.
In your curl command add --ntlm as an option.
The command should be as follows:
curl -u username:password --ntlm http://{myserver}/defaultcollection/_apis/git/repositories?api-version=1.0
Be aware that the API doesn't currently support CORS. This means you can make API calls from your own server side code without a problem, but you can't make the calls directly from a browser. There's a UserVoice suggestion to enable this that you can vote for.

Google Contacts Carddav Url

I would like to sync my google contacts into roundcube. I already installed 2 plugins (calendar sync with caldav is working like a charm with url, user and password) but I cant find the correct url for the carddav service.
Does anyone knows it?
Thank you
Moritz
The URL at this moment is:
https://www.googleapis.com/carddav/v1/principals/YOUR#gmail.com/lists/default
But the client you're trying to connect from should not be using this permanently, but instead discover the correct URL by sending a PROPFIND to https://www.googleapis.com/.well-known/carddav as described in the Developer's Guide.
Anyway, Roundcube would have to support OAuth2 authentication, not user and password, to be able to connect properly, which I don't believe it does.

Unauthorized dataimport-scheduler calls

I'm trying to setup an dataimport-scheduler for solr, everything's working and the deltaimport url is called every 30 minutes, the only problem is I'm using jetty and activated authentication in jetty.xml so the dataimport_scheduler gets:
<index update process> Response message Unauthorized
(saw in log file), How can I solve this?
The DataImportScheduler needs to have access to your solr/dataimport url via http. The error you see in the log file is because of the authentication you added. As far as I know the DataImportScheduler doesn't support authentication out of the box, but it should be easy to add it to the code.
Unfortunately it doesn't use http-client, which would have made things a bit easier and flexible I guess, but you can have a look at this answer to find out how to add http basic authentication to http calls made through the HttpURLConnection class.

Resources