An error occurred while sending the request with PostAsJsonAsync - soap

I have a soap web service which is being consumed by an application. This web service when called from the application posts the data it receives by a call to another web service via POST request using "PostAsJsonAsync". Sometimes the call to the other web service goes through but sometimes it throws an error - "An error occurred while sending the request". There is no specific use case or data scenario when this happens. It just happens at random.
The other service uses a token authentication system. The token is getting generated correctly in every case but the call doesn't go through for some.
Could anyone please guide me what might be the root cause for this issue?

The issue was with certificate validation with request. Resolved by adding this piece of code before making the http post call - ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

Related

Has anyone succeeded in interfacing Cherwell with the Twilio REST API to send SMS messages?

I have been successful with sending messages to Twilio via C# and Powershell but trying to use a Web Service call in Cherwell has me stumped.
I have setup the web service call.
I'm passing all the authentication tests because I can perform a lookup for the last 50 messages (which requires authentication) but when I try to call the Messages POST with To, From and Body I get a 400 error.
Unfortunately Cherwell only shows me the 400 error and not the return text from Twilio so I can't debug any further.
If anyone has done this can you please let me know how?
Also if you could recommend a way to put an HTTPS proxy between my Cherwell server and the Twilio endpoint to view the result values, that would help me out.
The key to this is building the message body as a single block of text that should be used as the body of the Web Service call.
Essentially, what you would have is a value that looks like
From=+17195550199&To=+17195550100&Body=Your text message here
I ran into this same issue while building this mApp to provide outgoing SMS capabilities: https://synapsesoftware.com/portfolio/twilio-mapp

Asynchronous REST services testing with SoapUI

I'm attempting to use SoapUI (5.0.0 beta) to test a RESTful web service which issues asynchronous responses to a supplied Callback URL.
So far, I am able to invoke the service and confirm the initial synchronous response received. I have also created a 'REST MockService' that issues an appropriate response to the callback received from the server, and I supply the endpoint for this as the Callback URL in the initial request.
What I am now struggling with is creating a test case that ties the two together such that I can 'expect' the asynchronous callback before proceeding to another step in my test case. I tried adding a 'Mock Response' Test Step to my test case following the initial request. However, this just yields an unhelpful 'Missing SOAP Operations to Mock in Project' error message. I took a brief look at the SoapUI source for this error message and discovered the method returning the error is first checking if I am using a WSDL interface. Why I would be doing so with a REST project is beyond me, but there you have it!
Appreciate any guidance on how to proceed!
Having logged a query on the SoapUI Community Board, it seems there is currently not a good mechanism for achieving this, but my query has prompted an enhancement request at least!
http://forum.soapui.org/viewtopic.php?f=5&t=23697

getInsitutions failing on new user

In the .NetAggCatSample app, I've found that calling getInstitutions with an existing user context seems to work fine, but for new users, I'm getting an exceptions (message = "forbidden").
Could this be due to running into the max user limit in Dev mode (which I am in)?
Also, which API call actually creates the user at Intuit?
To add the answer,
Any API call after retrieving OAuth tokens from the SAML assertion will create the user in the system. As you mentioned, you are most likely getting the 403 error because you are at your max customer limit. Please enable logging and post the response XML from the call that returns a 403:
http://docs.developer.intuit.com/0020_Aggregation_Categorization_Apps/DevKits/0250.NET_AggCat_DevKit_1.0/0006_Logging#Request_and_Response_Log
thanks
Jarred

Consuming SOAP webservice - null response

In my iPhone project, I have to consume webservices (public - no need
of authentication) for most of the data that I have to display to the
users.
I am struck with retreiving the data, I am pretty sure that the xml
request I send is true, But I wonder why I am getting the (null)
response, But it says that xxx number of bytes has been received.
Surprisingly one or two webmethods works well, I dont say any
difference either in their definition in WSDL document.
I have checked the same webservices using android code, it works very
well for all the webmethods.
I also had a discussion with the server side developer (who has
written webservices using SOAP protocol), he said that both the
request and the response is true (he can trace the logs of the
requests when I called ). But couldnt able to figure out why I am
getting null.
It is neither throwing any exception nor showing any fault in the
request and I dont have any build or runtime warning
Thankyou in anticipation

Error code 100 (Can only call this method on valid test users for your app)

getting the error {"error":{"message":"(#100) Can only call this method on valid test users for your app","type":"OAuthException"}} whenever trying to write to any facebook end point. Reading (GET) works fine, writing (POST) fails. Does anybody know how to resolve this?
I have also opened a ticket on FB dev site:
http://developers.facebook.com/bugs/184198634991192?browse=search_4e93328871c8a3231774584
The problem does not occur is I would shoot the POST request from my browser as if I am the user.
The problem does occurs only when sending from our servers on behalf of the user from one of our dev machines which have other subdomain names instead of www (such as dev1.blablabla.com & dev2.blablabla.com, while the app is registered to www.blablabla.com).
So the question is, does facebook attempt to do a reverse DNS lookup on all write requests to verify the source?
I believe your requirement is to get the user details of the owner of Facebook access token (normally the currently logged in user)
For that you have to issue a GET request and not a POST request.
The reason why it works when fired from the browser is that when you submit a query through the address bar it is send as a GET request, and when sent from your server it is send as POST and fails producing the error message mentioned in your post.
Facebook doesn't do a reverse DNS lookup on your write request and not need to configure anything in your server related to it.
Hope the answer is clear enough for you.