Why does clangd respond with "method not found" when using textDocument/didOpen? - language-server-protocol

I try to communicate with clangd. The first initialization is fine, but when trying to open a document with "textDocument/didOpen" i get the response "method not found". I cannot find any other method in the specification for opening documents. Is it the wrong method, or am I doing something else wrong?
My request
Content-Length: 1771
{
"id": 2,
"jsonrpc": "2.0",
"method": "textDocument/didOpen",
"params": {
"textDocument": {
"languageId": "cpp",
"text": "file content...",
"uri": "file://src/main.cpp",
"version": 1
}
}
}
The response I get:
Content-Length: 77
{
"error": {
"code": -32601,
"message": "method not found"
},
"id": 2,
"jsonrpc": "2.0"
}

The language server protocol distinguishes between request messages which are client --> server messages to which the server will respond, and notification messages which are client --> server messages which are meant to notify the server about something and do not require a response.
The id field is only expected for request messages (it's used to associate the response with the request). However, textDocument/didOpen is a notification message. Removing the id field should fix the error.
Further reading:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage

Related

Deleting the Queue Message is not succeeding after creating the blob using Azure Logic App

This Logic App Requirement is:
Get the messages from Azure Storage Queue.
For each message, Create a blob in the container using message id.
After creating the blob, delete the Queue
Every action is working fine, except the 3rd step. Deletion is not working fine.
Where I did wrong?
Last Action Response:
{
"error": {
"code": 400,
"source": "logic-apis-centralus.azure-apim.net",
"clientRequestId": "<guidid>",
"message": "The response is not in a JSON format.",
"innerError": "<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>InvalidQueryParameterValue</Code><Message>Value for one of the query parameters specified in the request URI is invalid.\nRequestId:requid\nTime:2022-12-13T00:30:13.1887047Z</Message><QueryParameterName>popreceipt</QueryParameterName><QueryParameterValue>Queryparametervalue</QueryParameterValue><Reason>Invalid pop receipt format</Reason></Error>"
}
}
After reproducing issue from my side
The error message is pointing to Pop Receipt as Scott Mildenberger said
Even I got the same error because of taking Message ID as Dynamic content for Pop Receipt
Got the same error
Error resolved from my end after taking Pop Receipt as Dynamic content
In Delete message action taken Message Id and Pop Receipt as dynamic content as shown in below image
After this For each and Delete message actions ran successfully
Success code 204
Delete message Success Response
{
"statusCode": 204,
"headers": {
"x-ms-request-id": "******",
"x-ms-client-request-id": "********",
"x-ms-version": "2020-04-08",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "true",
"x-ms-apihub-obo": "false",
"Date": "Wed, 14 Dec 2022 03:04:37 GMT",
"Content-Length": "0"
}
}
Successfully Queue message deleted as shown in below image

How to extract a substring value from Json response in SOAPUI

I am trying to fetch the requestID from the message which is a string.
{
"version": "1.0.0-80",
"status": 201,
"error": "MSG004",
"uuid": "aae1bb59-da3f-4118-a4a4-asdfsdfsd",
"message": "Successfully created a request with an id of 1234",
"path": "/api/request/",
"timestamp": "2019-03-21T09:41:58.484"
}
Can anyone help me with creating a property from message, I only need to pass request id in the end of this sentence:
"Successfully created a request with an id of 1234"
Thanks
Using a straight-forward substring should do the trick.
def id = variableThatContainsTheString.substring(46)
This however is not pretty. But nor is the solution you are testing.
I would argue that if the ID is something that should be used by the consumer of the webservice, then it really should be delivered in a key-value of its own. There should be no need to cut it from a string.
The response could then be something like this:
{
"version": "1.0.0-80",
"status": 201,
"error": "MSG004",
"uuid": "aae1bb59-da3f-4118-a4a4-asdfsdfsd",
"message": "Successfully created a request with an id of 1234",
"path": "/api/request/",
"timestamp": "2019-03-21T09:41:58.484",
"id": "1234"
}
Tell the developers to get their act together. ;-)

How to fix HTTP-Status 401 (Unauthorized) on bot-connector when calling the facebook-messenger webhook?

After setting up a bot-connector (SAP Conversational AI: https://github.com/SAPConversationalAI/bot-connector), creating a channel for the fb-messenger and configuring a webhook in the fb-app i constantly get http-status 401 (unauthorized) in my bot-connector log when sending a message from my fb-messenger.
Here is what i've done so far: (i fallowed this guide: https://github.com/SAPConversationalAI/bot-connector/wiki/Channel---Messenger)
deployed bot-connector to google cloud as app engine service to get the [bot-connector url]
created bot-connector:
POST on [bot-connector url]/v1/connectors with body:
{"url":[bot-connector endpoint url]}
POST-response:
{
"results": {
"id": [connector id],
"url": [bot-connector endpoint url],
"isTyping": true,
"conversations": [],
"channels": []
},
"message": "Connector successfully created"
}
created channel for fb-messenger:
POST on [bot-connector url]/v1/connectors/[connector id]/channels with body:
{
"slug":"channel-messenger-srtbot-dev",
"type":"messenger",
"token":[fb-app secret],
"apiKey":[fb-app api-key],
"isActivated":true
}
POST response:
{
"results": {
"id": [connector id],
"updatedAt": "2019-01-22T15:03:29.569Z",
"createdAt": "2019-01-22T15:03:29.569Z",
"webhook": "/v1/webhook/[channel id]",
"slug": [name of my channel],
"type": "messenger",
"token": [fb-app secret],
"apiKey": [fb-app api-key],
"connector": [connector id],
"locales": [],
"openingType": "never",
"hasGetStarted": false,
"forwardConversationStart": false,
"isActivated": true,
"isErrored": false,
"webhookToken": [fb webhook token]
},
"message": "Channel successfully created"
}
configured fb-messenger-webhook: (after completing the config i get the http-status 200 in the bot-connector log)
callback-url: [bot-connector url]/v1/webhook/[channel id]
token: [fb webhook token]
subscribed webhook to my fb-page
sent a message in my fb-messenger
Expected results:
after i send a message in the fb-messenger:
http-status 200 in the bot-connector log
messages gets forwarded to [bot-connector endpoint url]
bot responds to the message (i get an answer in the fb-messenger)
Actual results:
after i send a messag in the fb-messenger:
http-status 401 (unauthorized) in the bot-connector log (approximately every 60 seconds after the first fb-messenger message)
nothing else happens
i get no answer in the fb-messenger
When creating the channel, the app secret should be passed as the apiKey attribute and the page token as the token attribute. When the channel is created, it will have a webhookToken attribute. This should be used as the verify token when setting up the webhook on Facebook.
So instead what you should be passing to create the channel, should look like this:
{
"slug":"channel-messenger-srtbot-dev",
"type":"messenger",
"token":[fb-page token],
"apiKey":[fb-app secret],
"isActivated":true
}

creating subscription with Microsoft Graph API error

I'm trying to create a subscription to receive notification about changes to Office365 Calendar. I have already worked with Outlook Notitication API but having a problem with Microsoft Grap API
I try to create a subscription using Http Post to https://graph.microsoft.com/beta/subscriptions with header and body:
Header: Content-Type: application/json; Authorization : Bearer {accessToke}
Body:
{
"resource": "me/calendars",
"notificationUrl": "sample notification url",
"changeType": "Created",
}
In my notification url, i've setup to send a response with the value of validation token when receveving a validation request
Finally, the result i received:
{
"error": {
"code": "ExtensionError",
"message": "There was an error processing a storage extension.",
"innerError": {
"request-id": "6c563931-511d-415d-9c04-c07f25d45b1f",
"date": "2016-03-20T08:10:32"
}
}
}
I wonder what I'm doing wrong or that's a internal error of MS Grap API. Can anyone help me? Thank in advance
The correct resource to use for calendar events is "me/events". We'll try to get a better error message in future.

Create a new customer in the sandbox receive a 500 error. Google Reseller API v1

I have authenticated my request and when I'm trying to create a new customer in the sandbox, i receive a 500 error.
Request:
POST https://www.googleapis.com/apps/reseller/v1sandbox/customers
{
"customerDomain": "test.com",
"kind": "reseller#customer"
}
Response:
500 Internal Server Error
- Show headers -
{
"error": {
"code": 500,
"message": null
}
}
search the word "required" in this page
https://developers.google.com/admin-sdk/reseller/v1/reference/customers#resource

Resources