send soap request from Android using Ksoap2 - android

i'm trying to send the following request to a webservice using ksoap. i managed to send a successfull log-in request and other requests, where it is not neccessary to send the "locale..." line. And that is exactly my problem, i have no idea how to add this line to my request. I've tried doing it as a complexType, but the result is always something like " country="de" .... and this the webservice is not accepting such a request.
I hope someone can give me a hint.
<request>
<locale country="DE" datCountryIndicator="de" language="de"/>
<sessionID>13vb4mf66m67b</sessionID>
<!--Optional:-->
<constructionTimeFrom>?</constructionTimeFrom>
<!--Optional:-->
<constructionTimeTo>?</constructionTimeTo>
<restriction>ALL</restriction>
</request>

From my experience with kSOAP2 - go right to the source.
I've found a few bugs in the version of kSOAP2 I was using (for BlackBerry & Android) and most of the time had more luck tracing the methods, rather than looking for info online.

Related

Communication between classic asp server and android app

I need help in this problem,I am just a student doing my university practices without any help, I have done some scripts in asp, and it is all okay but now I need to learn how can I communicate an android app which I am developing in Android Studio (first time) with an Asp Classic Server, For example a demo.asp like
<%
name=request(name)
address=request(address)
result=name&" "&address
%>
How can I send that parameters to the server and get its response in Android Studio, I hope you can help me. I would really appreciate it.
If you can figure out how to send an HTTP request to a server from your app, then the URL would look something like this:
http://example.com/test.asp?name=Hector&address=123+etc.
You showed a piece of the ASP code that processes these two parameters and concatenates them into a result string. To output that result string you would say:
response.write result
in the ASP script after the lines in your question.
Back in Java in your Android app, you would find the result from the server in the response to your HTTP request. There's a sample here that explains how to talk to a server and get a response.

Parsing SAP web service in Android or iOS

I want to parse the web service in Android/iOS, Which is
written in SAP, but not able to do that. Can I do this ? and How?
When I hit the request on browser I get this popup and after entering the valid details here then only i get the JSON response, But how to get this done in mobile development?
Thank you..
Add Authorization header to your request
Authorization: Basic <Base64of Username:Password>
For quick check, you can generate auth header here
You can try using PostMan chrome plugin to generate request and play with different set of input data.

Android cannot communicate with localdjango server?

I am trying to post data from my client android application to a django server.
for example I have User {login:---, email:---} and I wanna post them my LOCAL SERVER based on django.. what I should do ? any link or tutorial can be greatful, i can't find any thing really helpful.Thks
You need to make a HTTP request to your django server. Here is a similar question how to do a post request in android

Error When calling asp.net web service through android

such as E/dalvikvm(2193): Could not find class 'org.ksoap2.transport.AndroidHttpTransport', of android httpTransport and what to write in place of "input" request.addProperty("input", searchNameString); I want to get the result by calling web service to the android app but I could not able to display it please help me on how to retrieve result from the webservice and also how to display to the android app. Please help me on this.
Prefer URL which is post question by me.
create soap envelope with security header in android using ksoap2
If your ksoap2 library is not working fine then change another kshoap2 library.
You use AndroidHttpTransportSE instead of AndroidHttpTransport.

Android SOAP NTLM example?

I've tried to google around for a working example. I've tried KSOAP2 and JCIFS examples but no success. The web service i'm trying to connect is 3rd parties (Microsoft Dynamics NAV) and can't be modified. It uses SOAP and either SPNEGO or NTLM authentication. And I guess it's already NTLMv2 but I'm not sure on that.
Can anybody please suggest me a full code for the following SOAP request?
$<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:item="urn:microsoft-dynamics-schemas/page/items">
$ <soapenv:Header/>
$ <soapenv:Body>
$ <item:ReadMultiple>
$ <!--1 or more repetitions:-->
$ <item:filter>
$ <item:Field>No</item:Field>
$ <item:Criteria>1000</item:Criteria>
$ </item:filter>
$ <item:setSize>500</item:setSize>
$ </item:ReadMultiple>
$ </soapenv:Body>
$</soapenv:Envelope>
I've validated this request with soapUI and it works fine. But when I tried to run it with KSOAP2 and JCIFS I get an error message "Connection refused".
Important to note I am a beginner in Java and Android.
I have had limited experience with NAV and SOAP, however I had a similar issue with Authentication.
What I needed to do is actually run the request twice. For some reason the first request would never go through (maybe as part of a handshake?), but the second would return a valid response. The best debugging tool was a simple HTTP Proxy (such as Burpsuite) which let me see what exactly was being sent (in terms of headers etc) and what the response was.
Secondly, as I was manually creating this SOAP Request, I had missed out the SOAPAction header for NAV. I'm not sure if this is standard, but I needed to use the HTTP Proxy with a .NET Web Service connection (The official way of talking to NAV through SOAP) and discover how it was talking.

Categories

Resources