Create product in Microsoft Dynamics 365 for Financials - postman

I try to create a product (item) using OData V4 URL available in Web Services section in Microsoft Dynamics 365 for Financials as shown below.
I use Postman to execute the POST request. Each request is proceed with an authenticated and valid account.
The POST OData V4 URL is taken from the Web Services sections example: https://xyz.financials.dynamics.com:7048/MS/ODataV4/Company('my-company')/Items
I also tried the entity "Item_Card", same result.
Here is the config set in Postman:
Headers
Body
When I execute the request, I get the following error:
What is the missing "Data object"? Is this a standard of OData V4 protocol? Do I must supply a "Data object" into the body?
Is there anyone encountered that error and could explain what is missing/not working?
Update 2017-05-10
It seems that the REST endpoint is not available for Microsoft Dynamics Financials build < 16552. I currenly use build 16259.
Update 2017-05-23
I am now running on build 16552. I still get the same error. The update seems to have no effect on the POST request.

I had a similar issue today.
I am using SoapUI for testing a simple webservice on a custom table in an on premise version nav2017.
In the end I found out that I was writing a Date on a Date field in NAV. After changing that to DateTime and sending a correct date time string it was working.
It probably does not answer your question as I see no date in your body, but maybe for others who are searching for the error "Data Object not provide" it might help to check if the datatypes used in the body matches the datatypes in NAV.
Regards, Henry Verheij

I receive this error as well. In my case I was adding a vendor and I missed the NO. (this field is not on the interface'vendor card', but it appears in the listing and is mandatory in the service, however no documentation about it). So my guess you probable is missing a mandatory field.
PS:I used OData v4 Client Code Generator to generate my proxy from the metadata.

Related

Power BI Web Source Wont Update through Gateway

I have an API source I am using on a report. It works fine on my Desktop, and I added the URL and Basic Login credentials to my Gateway. I get an error that my source is unable to update, but I don't know why. When I test the connection in my Gateway it says it connects fine. For some reason my published data set doesn't recognize the report's source as the same one as the one in my gateway.
Is there any additional step required in publishing a Web Data Source in order to make it use the gateway's web source?
This is the Error I get:
This is the Gateway's connection to the API:
This is the (Much Truncated) version of the Query I am using to retrieve the data:
let
Url = "https://rest.avatax.com/api/v2/companies/XXXX/transactions/",
RawData = Web.Contents(Url),
Json = Json.Document(RawData)
in
Json
This an incredibly annoying "feature", but the Power BI service does a different code analysis than Power BI Desktop. The way to overcome it is to present a static URL like this:
let
Source = Json.Document(Web.Contents("https://rest.avatax.com/api/v2/companies/XXXX/transactions/"))
in
Source
Chris Webb described this in more detail (along with hacks to make the URL dynamic) in this blog post:
https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power-bi/

API Gateway - Get StatusCode

This should have been such a simple issue and I don't understand why it hasn't come up through all my searching (maybe it's just been a long day).
I have an API Gateway API setup, and I am adding a Body Mapping Template to my Integration Response for a 400* error group: see image -
All I would like to get is the StatusCode of the current response (as this is a 400* group - e.g. 401 / 403 / 404 etc.)
The closest I came was through this site: AWS help documentation and I thought I would be able to use something like $context.statusCode - but no luck.
Am I going crazy, or is this just not something required often?
PS - Making changes to any Lambda functions being called, is not an option.
Thanks
There's currently no mapping template variable in API Gateway dedicated to the integration response status code.
We will certainly add this as a feature request.
At current time you are limited to hardcoding the status code value in your response templates. You would either need to define generic status codes (i.e "4XX") or define integration responses for every status code you want to capture. While this seems tedious, this could be managed relatively easily in a Swagger template.
At current time the only way to see the integration response status code is via CloudWatch Logs.
Thanks,
Ryan / Amazon API Gateway
If you are sending error codes from your server then you can easily map them.
I have done something similar but I have used different trick to do. I used to send my own error entities and codes from server.
You have to map those error entities and error codes coming from server to the response that comes from amazon servers. I will try and explain what I mean by this. Api Gateway doesn't send response coming from your own server to the client automatically. You have to map those responses. For example, map 200 as a SUCESS and response entity will be default, that is whatever coming from server.
Now, we default success response is managed but what about error codes and error entities. You have to map them manually.
There are two ways you can do this,
One is manual, go to your api. Create error entities or models. Map them manually for each response code.
This one uses swaggger,
Solution is to import swagger specification of error entities. Add response templates to the swagger specification and let amazon do their job.
I can help you more with swagger. It depends how you are setting up your api on amazon.
Visit this for amazon extenstions to swagger,
http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html#api-gateway-swagger-extensions-integration-response

How should I implement a dynamic partner link endpoint in WSO2 BPS?

I am trying to implement a partner link with a dynamically determined endpoint address in a WSO2 BPS BPEL process. The idea is that the request sent to the process contains an endpoint URL and that this URL is used as the address for a certain partner link. I have successfully used endpoint references stored in the registry before, but I can't use that approach here as the address can be different every time the process is called.
I have tried a number of different approaches (using WSO2 BPS 3.5.1 and WS02 Developer Studio 3.8.0):
The approach used in the DynPartner example referenced in https://stackoverflow.com/questions/11092515/dynamic-partner-links-and-dynamic-addressing-with-ode-bpel. This gives me the following validation error in Developer Studio: The from-spec of "<xs:simpleType "string">" is not compatible with to-spec of "<wsdl:portType
"DynResponderPortType">". Also, when I deploy and invoke the process, I get an error stating that the endpoint cannot be created (Couldnt create any endpoint for element ...)
Assigning a fixed value to the partner link, e.g. like this:
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com uep_schema.xsd">
<wsa:Address>http://localhost:8281/services/serviceaddress</wsa:Address>
</wsa:EndpointReference>
This works and does not give a validation error, but I haven't found a way to dynamically change the address that is used here based on the input my process is called with.
Create a variable that holds the endpoint reference, using a type that defines the content of an endpoint reference. I've tried several XSDs (http://docs.oasis-open.org/wsbpel/2.0/OS/serviceref/ws-bpel_serviceref.xsd, http://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/unified-endpoint/org.wso2.carbon.unifiedendpoint.core/4.2.0/src/main/resources/schema/uep_schema.xsd (which doesn't get validated without errors), the ws-addr.xsd from w3c, my own very simple XSD). I've had varying success with regarding how well Developer Studio could handle them and for instance generate initializations, but they all share the problem that I get a validation error stating something like The from-spec of "<element "EndpointReference">" is not compatible with to-spec of "<wsdl:portType
"ThisIsThePartnerLinkPortType">" -.
At this point, I am using the last approach with my own simple XSD. The process is actually working the way I intend it to, but I am still getting validation errors in Developer Studio which I would like to get rid of. Is there another and better way to approach this?
Thanks in advance for your help.
For anyone who is having the same issue: The approach is use now is that the BPS calls a specific proxy in the ESB (at a fixed location) and provides the endpoint URL to that proxy. The proxy then performs the actual call to the endpoint.
This has a number of advantages for me:
I get rid of the validation errors in the BPEL designer
Passing through the ESB allows me to perform validation on the message that I receive from the service located at the dynamic URL. Note that this is not possible in the BPS at the moment, as validation is not yet properly implemented. See also https://docs.wso2.com/display/BPS351/WS-BPEL+2.0+Specification+Compliance

What do I need to write to be able to communicate with a web service?

I've been tasked (I'm not a web developer) with creating something (a web service "client") that will connect to a web service, retrieve a list of files (url's) and then download them (HTTP Post) for further processing. I guess anything like a command line app that I can schedule to run daily will do (but I'm open to suggestions).
I have documentation for the web service, it uses SOAP 1.1 which I am somewhat familiar with (used it in a few web pages, but that was classic asp). They are even offering a WSDL to download in order to generate proxy classes, or you can create your own.
Below is the description of the objects that the WSDL creates:
There are six software entities that you will need to implement in your web service client. If your development environment automatically generates these from the WSDL, they will have the following names and purposes:
DownloadSvc
Response
ResponseCodeEnum
UserType
CertificationEnum
FileFormat.
DownloadSvc Class – This is the central object you will use. It implements the majority of the behavior needed to login to the service, to check the availability of a download and to obtain the download URL. For example, it has a Login and a GetURLS method. This class supports both full and change list (“delta”) downloads.
Response Class – Most methods of the DownloadSvc return this Response object. The fields in Response are as follows:
The Response.code field always describes the success or failure of a method call.
The Response.value field sometimes contains additional information.The remaining four items are simple enumerations that define the allowable values in the fields passed from or to the service.
ResponseCodeEnum – Describes the possible values of the Response.code field. For example, it may return a code of LoginOK or DownloadOK for successful calls, or an error-specific code for failures. You can see the specific code values listed in the sample SOAP responses in the SOAP Appendix.
UserType – Only used with the Login method. It identifies which password is being used to login: your Representative password or your Downloader password.
CertificationEnum – An enumeration that you use to certify your agreement with the FTC’s conditions for downloading these phone number files as specified on the download full or download change page.
FileFormat – An enumeration that lets you select a flat text file or an XML file format.
Here's my question: where do I start in Visual Studio? What type of project do I need? Thank you!

Consuming web services with claims-based authentication - SoapServerException

We have an application that periodically pulls data from a SharePoint list and integrates with another application. We've been using it for more than a year without a problem. Recently, however, we switched our farm to use claims-based authentication... and there went the app.
My code, at a high level, does the following:
SPWebRefs.Lists spl = new SPWebRefs.Lists();
spl.Credentials = System.Net.CredentialCache.DefaultCredentials;
//Build request here
XmlNode listItems = spl.GetListItems("My list", view, query, viewFields, null, queryOptions, null);
I get an "Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown" exception right there.
I'm looking through Fiddler, and I get the 401 challenge, quickly followed by a 200 response, which I assume means I'm in. But then I get a 500 error as soon as the GetListItems method is invoked.
I've tried this against a 2010 instance as well as a 2013 farm that we're getting ready to deploy. Same situation.
I'm using the 4.0 Framework at this point, but I've considered testing it out against the 4.5 Framework, which includes some new APIs for claims authentication. Would that make any difference?
Any thoughts would be greatly appreciated. Thanks so much in advance!
You must call SharePoint's Authentication WebService first. You will get a cookie from it, which you can pass to the Lists WebService.
See a sample here: http://www.tonytestasworld.com/post/2009/06/04/How-To-Authenticate-and-Use-SharePoint-Web-Services-in-an-FBA-SharePoint-site.aspx