How to receive data using Domino webservice provider - web-services

I have an external application that should send and recieve data from a Domino web service provider.
I managed to create a webservice proivider using lotusscript that send data back to the caller
I need to know how to receive data from the caller using the provider and add it to Domino? could not find any example on the internet, is it possible?

In the code of the provider (I call it wsOfDomino), you add a function, just put parameter(s) to this function.
Class wsOfDomino
function getWSdata( userName as string) as string
getWSdata = "Hello " + userName
End Function
End Class
Domino will generate the WSDL, in which the external application will "see" that it can send to Domino the userName.
Change userName and name of the function according your needs.

Related

How to use custom function for account activation in django graphql auth

I am using django-graphql-auth to send account activation email.
It has below method,
https://github.com/PedroBern/django-graphql-auth/blob/master/graphql_auth/mixins.py#L200
However I need to use my own custom function since I am using third party api service.
Using my function I am able to send the email however I am not sure how can I override the default behavior.
I am seeing there is an async_email_fucn at below,
https://github.com/PedroBern/django-graphql-auth/blob/master/graphql_auth/mixins.py#L219
Please suggest.

Securely sending password data to REST API?

I have a REST API made with Django Rest Framework. This API has an endpoint for creating new users. When creating a new user, I obviously need to provide some sort of password. What I am concerned about is how to communicate that password data from the client to the create user endpoint in the API via JSON. Do I send the password in plain text? Should I encrypt client side and then send? SSL/HTTPS? TL;DR: How do I safely do something like this: POST to myapi.com/create-user with_data {'password':'my password'}
Sending in plain text over HTTPS would be just as secure as any other web account creation you've done from the browser.
Although you don't actually need to require the user provide a password- you could have them provide an email and you dynamically create a temporary password and email it to them.

Getting all users in Moodle using the webservices

I'm developing a Java client to interact with Moodle. I want to get all the users registered within a Moodle installation.
I found the webservice function called core_user_get_users which returns a list with users.
When I call the service without any parameters I get a repsonse with a invalid parameter exception.
When I add a criteria parameter (criteria[0][key]=id&criteria[0][value]=some_id) it returns a single user with that specific id.
I can't seem to find what criteria to pass to the function to get the entire list with users registered.
You can use the email criteria. If you have the value %% it will retrieve all registered users.

Consuming external webservice with ASP

I'm doing a simple page to register users. However after I get the user's input I need to call a web service to get a token which will then allow me to call another web service which will finally proceed to register the user (using the input AND the token).
So what I want to know is how to call this WS and retrieve it's response and then add that response (which would be the token) to the form used for user registration.
Edit: I'm using classic ASP
Depends on how the web service is written. These days most APIs are written using REST (i.e. standard HTTP GET/POST URL format). So you simply make a call to a URL, and get a value back - you can do this using ASP's "ServerXMLHTTP" component. e.g.
Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
xml.Open "POST", sURL, False
xml.Send parms
returnValue = xml.ResponseText
Then do something with "returnValue"

Salesforce: SOAP Login from Salesforce TO Salesforce

I implemented a batch job which makes a webservice call within the same salesforce instance, which then is supposed to send emails with a pdf attachment,
since you cannot send pdf attachments directly from a batch job. My webservice call looks like this:
public static void callOut(List ids){
InvoiceAttachmentConnector.InvoiceAttachmentService ws = new InvoiceAttachmentConnector.InvoiceAttachmentService();
ws.SessionHeader = new InvoiceAttachmentConnector.SessionHeader_element();
ws.SessionHeader.sessionId = UserInfo.getSessionId();
ws.handleInvoicePdfAttachment(ids);
}
However in batch jobs UserInfo.getSessionId() returns null, therefore i get a INVALID_SESSION_ID exception.
How can i log in to get a SessionId? So far I found no solution to login from salesforce to salesforce. If u can help I would appreciate it! Thanks!
You cannot get a session Id like this in batch apex as it runs under the system context and so has no specific user info for retrieval.
UPDATE:
You have the following options:
Try running the web services wsdl from your Salesforce org through the wsdl to apex generator in your org to generate some classes that may allow you to login. You are only allowed one web service request per execute call.
You could create a sites page that you make a HTTP get request to in your batch apex. This needs to retrieve the Ids of the items you want to send the PDFs for and a particular user to run as for you to use the System.runAs(user) method. You could pass these parameters in the HTTPRequest header or in a custom setting.
Note that neither of these solutions are ideal, you may want to reconsider why you are using Batch apex first of all and see whether you could reimplement it in a different way.