Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I've exploring on the Internet about this problem for several days, but I dont know why I cant connect to my SOAP WebService. I ve seen that many others had this problem but many of them could solve it. Every time I face with this error in my Android app:
System.Net.WebException: The request failed with HTTP status 400: BadRequest
  at System.Web.Services.Protocols.SoapHttpClientProtocol.ReceiveResponse


What I have tried:

The Url is: http://10.0.2.2:51036/Areas/Admin/WebServices/SyncWebService.asmx
strRawJson = syncWebService.GetListInfo_GeneralCategory();

The SOAP WebService is into an MVC project.
Posted
Updated 1-Apr-20 4:27am
v2
Comments
ZurdoDev 1-Apr-20 10:04am    
I would suggest using something like PostMan to test the call. You're probably missing a header or something.
maysam_p82 1-Apr-20 10:30am    
But, I have tested it with another MVC application, (obviously with local host:http://localhost:51036/Areas/Admin/WebServices/SyncWebService.asmx)
it works pretty fine.
ZurdoDev 1-Apr-20 10:41am    
Yes, but you were testing .Net and now want Android to work. Which means .Net is adding something under the hood that you are not aware of. Which is why PostMan is a good option because then you have to set everything.
maysam_p82 1-Apr-20 10:44am    
That's true but I m not sure if Postman can consume 10.0.2.2 Android specific IP address. Anyway, I'm gonna try it right now.
Richard Deeming 1-Apr-20 10:30am    
The request you're sending doesn't match the format that the service is expecting to receive.

We can't see the code for your service, and we can't see the code that's calling it, so we can't tell you why, nor how to fix it.

You'll have to debug your code and examine the request that's being sent to try to find out what the problem is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900