I have crated a magento custom SOAP V2 Module,i have a xml request as follows.
from the firebug
----------------
endpoint :http://202.129.197.46:4141/magento/vmagento9/inventory.php
operationName :getFilterValues
requestXml :<GetFilterValuesRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.promostandards
.org/WSDL/InventoryService/1.0.0/">
<wsVersion>Token1</wsVersion>
<id>tvijay12312</id>
<password>Token1</password>
<productID>Token1</productID>
<productIDtype>Token1</productIDtype>
</GetFilterValuesRequest>
version : 1.2.1
webServiceName : Inventory
from this i want the id,password,productId and productIDtype.
kindly share your idea to get this request data and pass to the login and mycustom api methods
Related
I am trying to explore different options to connect to a REST endpoint using Azure Data Factory. I have the below python code which does what I am looking for but not sure if Azure Data Factory offers something out of the box to connect to the api or a way to call a custom code.
Code:
import sys
import requests
from requests_oauthlib import OAuth2Session
from oauthlib.oauth2 import BackendApplicationClient
import json
import logging
import time
logging.captureWarnings(True)
api_url = "https://webapi.com/api/v1/data"
client_id = 'client'
client_secret = 'secret'
client = BackendApplicationClient(client_id=client_id)
oauth = OAuth2Session(client=client)
token = oauth.fetch_token(token_url='https://webapi.com/connect/accesstoken', client_id=client_id, client_secret=client_secret)
client = OAuth2Session(client_id, token=token)
response = client.get(api_url)
data = response.json()
When I look at the REST linked service I don't see many authentication options
Could you please point to me on what activities to use to make OAuth2 working in Azure Data Factory
You would have to use a WebActivity to call using POST method and get the authentication token before getting data from API.
Here is an example.
First create an Web Activity.
Select your URL that would do the authentication and get the token.
Set Method to POST.
Create header > Name: Content-Type Value: application/x-www-form-urlencoded
Configure request body for HTTP request.
..
Format: grant_type=refresh_token&client_id={client_id}&client_secret=t0_0CxxxxxxxxOKyT8gWva3GPU0JxYhsQ-S1XfAIYaEYrpB&refresh_token={refresh_token}
Example: grant_type=refresh_token&client_id=HsdO3t5xxxxxxxxx0VBsbGYb&client_secret=t0_0CqU8oA5snIOKyT8gWxxxxxxxxxYhsQ-S1XfAIYaEYrpB&refresh_token={refresh_token
I have shown above for example, please replace with respective id and secret when you try.
As an output from this WebActivity, you would receive a JSON string. From which you can extract the access_token to further use in any request header from further activities (REST linked service) in the pipeline depending on your need.
You can get the access_token like below. I have assigned it to a variable for simplicity.
#activity('GetOauth2 token').output.access_token
Here is an example from official MS doc for Oauth authentication implementation for copying data.
Is there any good open source framework for Rest API Adapter, API adapter use cases :
Maps the REST API source request body signature to target request body signature and source response body signature to target response body signature and which has to be configurable.
For Example :
Source API expects Json :
{
"name" : "testing name 1"
}
Target API expects Json
{
"name_t1" : "testing name 1"
}
the name and name_t1 has to be mapped to two rest APIs to function and similarly for mapping of response bodies from source to target. This is a simple example the source and target request API has nested multi-dimensional arrays.
Is there any good framework which does this job?
Regards
Kris
I want to fetch the attachment details and attachment of testcase from VSTS using restapi.
Which restapi from 5.0 to be used to retrieve attachment details?
https://learn.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-5.0
I have created a PBI added 2 tasks and 2 tests to it as below:
Is the ID field the WORKITEMID?
Figure 1:
Figure 2:
Test Case is a work item type, so you can use the Attachments - Get REST API.
Downloads an attachment:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/attachments/{id}?api-version=5.0-preview.3
To get the attachment id you can use the Get Work Item API with $expand=al:
https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{workItemID}?api-version=5.0&$expand=all
You will get in the results the ID (in the url in the relations section):
"relations":[
{
"rel":"AttachedFile",
"url":"https://shaykia.visualstudio.com/_apis/wit/attachments/xxxxx-4453-40b0-acaf-ace14902484c",
So now you have the attachment id: xxxxx-4453-40b0-acaf-ace14902484c, to download the attachment use the API above (instaed ):
https://dev.azure.com/{organization}/{project}/_apis/wit/attachments/xxxxx-4453-40b0-acaf-ace14902484c?api-version=5.0-preview.3
I am Developing a plugin that exports Documents to SharePoint Repository after processing them. Along with the document, I need to send values for Custom Metadata columns defined in SharePoint.
I have figured out how to send across Files and Metadata to a specified location.
Problem: Initially, I do not know what custom metadata columns are available in the given folder.
Could someone shed light on any REST webservice that can fetch the available Metadata Columns for a given location in the repository.
Note: I am using pure Java for REST Requests using Apache HTTP Client.
The REST url for retrieving the custom fields in a list is:
_api/web/lists/GetByTitle('Custom List')/fields
I don't know much about parsing JSON in java but this will give you a list of all the columns and extensive details about them. I displayed some of the data returned below.
DefaultValue : null
Description : ""
EnforceUniqueValues : false
Id : "fa564e0f-0c70-4ab9-b863-0177e6ddd123"
Indexed : false
InternalName : "Title"
ReadOnlyField : false
Required : false
StaticName : "Title"
Title : "Title"
FieldTypeKind : 2
TypeAsString : "Text"
TypeDisplayName : "Single line of text"
If you need to get the available columns of a specific folder, and not a library:
_api/web/getfolderbyserverrelativeurl('/Shared%20Documents/Folder')/ListItemAllFields
SharePoint 2013 has a REST API endpoint that could retrieve and filter Metadata columns if you obtain the information through a POST request using CAML. If your requests were made from SharePoint itself, you would use the masterpage's RequestDigest, but since you are doing it remotely, you would have to get this parameter by querying /_api/contextinfo and obtaining the FormDigestValue. Here is an article on it:
http://www.cleverworkarounds.com/2013/09/23/how-to-filter-on-a-managed-metadata-column-via-rest-in-sharepoint-2013/
Also, you must enable CORS on your SharePoint data repository.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Is there a way to get the parameters set in a post-delete-put REST request? in a proxy or programmatically developing a mediator (i mean in the MessageContext object passed to the mediate method)?
I know that parameters are appended to the url in a GET request e they appear by
getProperty("REST_URL_POSTFIX");
What about the other CRUD commands?
To get programatically, you can retrive those details from Axis2 messagecontext.
HttpServletRequest obj = (HttpServletRequest)
msgContext.getProperty("transport.http.servletRequest");
System.out.println("Method :" + obj.getMethod());
Here is a detail post