Difference between logging in into salesforce sandbox with and without consuming wsdl? - node.js

I am very new to Salesforce and it's API.
I am having a sandbox org and with it I have url, username, password, security token and last but not the least partner.wsdl
My aim was to connect and retrieve/create data.
Technologies at hand was nodejs
So here is how I started.
I searched over the internet and came to know that I need to create a client, SOAP client in order to login, create the connection and use that connection to create and access the Leads data.So I followed this sample where the wsdl was being consumed.
So I was able to connect
I was very happy on this success and then suddenly I wasn't able to identify/find a way where I can get the sObject.I looked hard for this but no luck. So posted a question on SO
Meanwhile I also looked for other node module and found jsforce
I used jsforce starting guide and created a client that was connecting to salesforce however without using the wsdl file.
Again I was happy, even more happy because I was having the sObject with me.
Now, what is the fundamental difference if I login using the local wsdl file and without wsdl file in the language of salesforce. Which one is the correct way of logging in?
Sorry if this question is not according to SO rules or if there is a typo.

I'm the author of jsforce you mentioned.
In that lib we use REST API mostly and SOAP APIs are only used in some specific calls like login or metadata. Even in such calls we don't use WSDLs because there's no good lib to generate client modules from WSDL in JavaScript/Node.js area. Instead we wrote modules for each APIs which generate SOAP XML strings and parse the response XML.
It is enough because these API message schema are static and fiesible in the specific version, unlike SOAP API Enterprise WSDL differs in organizations. So we can hard code the client module directly w/o generate it from WSDL.

Related

create space/room and send message via google-api in node.js

Case: Google Chat support in node.js using the googleapis library.
I studied the documentation, created a service account and implemented authentication. In first step I used the chat.spaces.list() method and it worked (no error returned).
I want to send a message via chat, so I wanted to create a new space, I found the chat.spaces.create method (https://developers.google.com/chat/api/reference/rest/v1/spaces/create) Unfortunately, this method is not present in "googleapis" for node.js In general, I see that the list of methods in "googleapis" is different than the one in the documentation. Only spaces in the documentation, but spaces and rooms in the library... I'm lost. How to do it? Any tips?
I see that the list of methods in "googleapis" is different than the one in the documentation
I think you are seeing wrong documentation. Your reference link is REST API documentation. The nodejs googleapis client documentation you can see on https://googleapis.dev/nodejs/googleapis/latest/chat/classes/Resource$Spaces.html.
And also based on the REST API documentation, the API that you looking for(create space) is not general available.
† Supports user authentication in Developer Preview. App authentication isn't available.
You need to join Google Workspace Developer Preview Program to access that feature.

What is the fastest way to generate an POST or GET SOAP XML payload for SuiteTalk Web services?

Hopefully someone can help me.
I am currently using POSTMAN to run SOAP web service tests on NetSuite.
Annoyingly, I am having to generate the body of an XML request from scratch, and would really like a method whereby a basic template is generated for me, and I simply fill in the gaps. Creating an XML web request from scratch is prone to errors hence my question. I tried SOAPUI but it does not
Any ideas is most appreciated!
hope you remember me!! The easiest way would be to download any of the existing working SOAP web request from any running build and modify that to suit your need. There is no out of the box built in template that you could build on at least as per my knowledge. Please specify the record for which you are building the SOAP request
The easiest way is to not use POSTMAN.
I used to do a lot of this and what I'd do is:
generate the java client for SuiteTalk
install a recording proxy (I think WireMock does this -- the one I used to use doesn't seem to be around anymore)
use JUnit tests to hit SuiteTalk
in the test setup override the SSL config to ignore host name verification
test an API call
extract the complete working SOAP from the proxy logs
templatize the SOAP and use it where needed.

How to setup OAuth 2.0 server using loopback.io

I have set up OAuth as per the docs and this link https://strongloop.com/strongblog/node-js-loopback-api-gateway-sample-applications/.
There are a few issues in understanding the usage of the code base and flow based on the options of loopback-component-oauth2. Is there a tutorial that covers each section or a working implementation for Implict, AuthorizationCode, Refresh token, JWT.
I have been able to secure API (eg: /api/Notes) as per docs and it does seem to be blocking requests but is not allowing me to authenticate. More, when I make a request to /oauth/token this API is also throwing Unauthorized 401 errors - both from REST Client like postman and https://loopbacklocalhost/explorer.
I am using loopback 3.0. I am having tough time with the component not documented completely nor having a doc aligned example code. May be I am missing something here.
I have seen this hub repo as well and seems they use passport directly and is documented very less making it difficult to integrate things easily.
https://github.com/strongloop/microgateway
Note: I have gone through the following question, the archive repo tests.
How to setup OAuth 2.0 server using loopback
Any help is welcome.

Method not allowed when trying to access API methods via SOAP integration

Good day,
I'm having trouble calling DSAPI methods via SOAP ( C# Integration ). I keep getting 405 Method not allowed errors. So far I've tried calling the RequestTemplate and CreateEnvelopeFromTemplates methods, both of which fail. I was able to successfully retrieve the DSAPIServiceSoapClient object and also successfully login via the login method of the credential API. If you need more information, i'm ready to provide them. Thank you.
You're succeeding with the login, which is good.
My guess is that the other calls are not well formed. Perhaps they're missing the right base url (which you receive from the login call).
Are you switching to the different base url for your subsequent calls? (Different server name?)
I suggest that you try the API logging feature and see what it reports. It enables you to see a log of your API requests. See the Request Logging article for the classic DocuSign experience, or the new DocuSign UI.
i just needed to add the in the X-DocuSign-Authentication http header whenever i try to get a DSAPIClient object.

WSDL off ServiceStack REST API

I know this at least IMO is a stupid request. Because WSDL is old hat and sucks compared to just doing a RESTful API. But I have a corporate "mandate" where we want to do a REST API but then corporate wants a WSDL still. I know..it makes no sense and apparently we can't push back and say NO and tell them to just use our future REST API.
So can you generate a WSDL if I were to start creating a REST API with ServiceStack? Meaning I add uri attributes and such? So that I can "make them happy"?
I prefer not to use WCF, it's a nightmare with a ton of attributes and configuration to try and hack a RPC style web service to try and be RESTful. Obviously that doesn't work out too well.
SOAP along with REST is supported and you can have REST API along with soap wsdl. There are some recommendations posted in servicestack wiki that you can review and get started! You just need to implement the restful service and soap, json, xml etc are automatically supported.

Resources