VB 6.0 error while accessing web service: 2146697208 - web-services

I am getting error : -2146697208, while sending xml to payment gateway web service. The application is developed in VB6.0 and the OS is Microsoft windows server 2003.
And also the code works fine in Windows XP, and i verified the same with third party tools for testing Web Services (SOAP UI) in Windows Embedded Standard system and it works fine. Looks like the issue is related to VB6.0 and the OS. Please help.
Code Snippet:
On Error GoTo 0
'Set XMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
PaymentURL = "https://testpayments.globalone.me/merchant/xmlpayment"
Dim http As Object
Set http = CreateObject("MSXML2.XMLHTTP.6.0")
http.Open "POST", PaymentURL, False
http.setRequestHeader "Content-Type", "text/xml"
http.setRequestHeader "User-Agent", "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405"
http.send (xmldata) (error is thrown here)
Please help me.
Thanks

Related

Verification with the new Google rest apis requirements (15.01.2019)

in the requirements for using the Gmail REST APIs: https://developers.google.com/terms/api-services-user-data-policy#additional-requirements-for-specific-api-scopes
There is the statement:
Do not mislead Google about an application's operating environment. You must accurately represent the environment in which the authentication page appears. For example, don't claim to be an Android application in the user agent header if your application is running on iOS, or represent that your application's authentication page is rendered in a desktop browser if instead the authentication page is rendered in an embedded web view.
We have an Electron version of our app, that is only wrapping the web version URL in a desktop app. So we are using the OAuth flow for Web Server applications for both the web app and the desktop app. Can this be considered a valuation of the User Data Policy?
The key is agent header. This corresponds with the HTTP header User-Agent.
What Google is asking is that you use a User-Agent string that matches the platform that you are running on (android, iOS, Windows 10, ...). This link will give you more information about User-Agent.
You can test what strings are included by your browser using this site. This should give you a better understanding. For example on my Windows 10 desktop using Chrome:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
This link is the RFC7231 standard.
If your software is running in the browser, you don't need to do anything except don't override the User-Agent value. If you are writing your own custom software, then do some research and specify a User-Agent string that identifies the platform and append your software / company name.
Electron publishes a list of its User-Agent strings. My initial recommendation is just leave the User-Agent header alone and let Electron manage this for you.
This StackOverflow answer shows how to set the Electron User-Agent header if you choose to do so.

What's wrong with Yahoo finance webservice v1? API changed?

I was used to type in a browser : http://finance.yahoo.com/webservice/v1/symbols/YHOO,AAPL/quote?bypass=true&format=json&view=detail and parse the answer...
It's not working anymore, see: Has Yahoo finance web service disappeared? API changed? Down temporarily?
The command
curl -A "Mozilla/5.0 (Linux; Android 6.0.1; MotoG3 Build/MPI24.107-55) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537.36" http://finance.yahoo.com/webservice/v1/symbols/YHOO,AAPL/quote?bypass=true&format=json&view=detail
gives also
not a valid parameter.
Any idea what's wrong in the request?
Any idea on the way to send the http request directly so it works in a desktop browser?
If you use the headers below in your GET request, it will work...
"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 9_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13E230 Safari/601.1"

Should I do something about this possible attacks in my django App?

I've set my django 1.8 app to warn me when some user gets 404 or any crash.
Then I started constantly getting emails from my server pointing to requests like this one:
Referrer: <my_ip>:80/web-console/ServerInfo.jsp
Requested URL: /web-console/ServerInfo.jsp
User agent: Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; 2Pac; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
IP address: 127.0.0.1
And this one:
Referrer: <my_ip>:80/invoker/JMXInvokerServlet
Requested URL: /invoker/JMXInvokerServlet
User agent: Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; 2Pac; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
IP address: 127.0.0.1
It's a huge number of different url's. It seems a server is shooting tons of requests to several servers trying to discover some entrypoint to attack. Right?
My question is: should I do something? Assuming I don't even use the technologies this requests are looking for? Can this cause me any damage?
A few days ago security researchers has disclosed a very critical vulnerability on Java Serialization methods (Details : http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/) .Right after that publication, I've seen some exploitation attempts in the wild that try to exploit exactly same vulnerability . I'm telling this story because your log shows exactly same exploitation attempts. As long as you DON'T support Jboss or other Java technologies on your server, you will be secure against these kind of attacks.

Connecting to TFS with SOAP using C++

I have a C++ (QT5) application and now I wanted to connect to TFS and get the projects and few other details of the project. The main intention is to pull out the Test Cases from MTM.
So many examples using their API with C# and easily solving this problem. However I am having no such luck with C++. I am not sure how to proceed, should I write my own web service using the SDK and then use it or does TFS provide SOAP support.
I thought it did and hence fired fiddler to get to it, but never saw an auth method anywhere. All the requests I saw was GET. And there was a NTLM authorization as shown below.
GET http://localhost:8080/tfs HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAvAjAAAADw==
Any suggestions I can have or tips I would be grateful. I wish there was some documentation or samples/examples using C++.
If it has SOAP functions (WSDL) I could use KdSoap and use it with my application.
Thanks.
There is no way to bypass the API.
While you can connect to the web services for TFS directly there is no support for this method. Your code can break with any update to TFS. I would recommend that you create a web service with c# and then call that from your code. I would expect that the rest api's will become available on premises at some point.
Another option, although I am dubious of the support would be to create a hybrid DLL, C++ Managed, that can call the C# API's. You can then call the hybrid code from the native code. This is one extra level of wrapper and is really designed to help teams migrate from C++ to C#, but I believe that it will work.
http://en.wikipedia.org/wiki/C%2B%2B/CLI

How to add a User Agent to the SoapClient generated by Visual Studio?

I'm trying to invoke a webservice using the classes generated by Visual Studio in an ASP MVC project, here is my code:
var serviceClient = new UserSoapClient("UserSoap");
var isValid = serviceClient.CheckEmail(email);
ViewBag.ServiceOutput = isValid? "Email is valid" : "Email is not valid";
return View();
However, the message is timing out and it seems that the problem is that the request header of the SoapClient is not sending the User-Agent property because I tried executing the same service with SOAP UI and that was the only difference. Is there any way of setting the User Agent because I'm looking at the documentation and it doesn't seem to be very obvious.
I have faced with a similar problem while trying to consume a service with SoapClient. I was able to get response from the service via browser but when I execute the code within the project service was returning Protocol Exception with The remote server returned an error: (502) Bad Gateway. message.
After several hours of tracing I have realised that the Exception was caused by the user-agent definition. I have tried to add user-agent to the Soap request header but no way. You can not add user-agent to Soap request registered as Service Reference. But it is possible to define user-agent header to a request registered as Web Service Reference.
What my solution is:
Remove the Service Reference from the project
Add the same reference as Web Reference from the advanced menu of Add Service Reference Window
Create a new object and define UserAgent property like below.
var svc = new ServiceReference.QueryService();
svc.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36";