2

I am working towards an android application. I need to use a web service. I have a .NET web service. I generated Java files from WSDL2Code converter, but I don't know how can I use service with these files, because there are no examples. I'm implementing client side. If Anyone know how to solve this please help me..

bCliks
  • 2,918
  • 7
  • 29
  • 52
  • will you need to know how to consume the webservice in android? – Android_coder Feb 25 '13 at 12:31
  • yes.. i follow this tutorial.. http://www.codeproject.com/Articles/304302/Calling-Asp-Net-Webservice-ASMX-From-an-Android-Ap they r use a sample web service ans it worked fine. But when i use my web service it s not worked. after googling i found WSDL2Code.com site they are giving a java files to consume webservice. but i dont know how to use that files. – bCliks Feb 25 '13 at 12:50
  • @bCliks did you solve this issue? – kinkajou Apr 10 '17 at 06:21

3 Answers3

0

in this site there is an example section, and u cant contact support@wsdl2code.com for help...

in general the class - "servicename" has all the methods for example (copy paste from the site)

 SampleService srv1 = new SampleService();
 req = new Request();                     
 req.companyId = "1";
 req.userName = "userName";                                     
 req.password = "pas";
 Response response =    srv1.ServiceSample(req);
Bennya
  • 554
  • 5
  • 10
0

Check on the generated file, "SampleService.java" the attribute "url", maybe is empty. Fill with your web service URL.

public String NAMESPACE ="http://************/";
public String url="";
public int timeOut = 60000;
public IWsdl2CodeEvents eventHandler;
public SoapProtocolVersion soapVersion;
agustinm20
  • 138
  • 1
  • 7
0

If you read the service class (eg : Log_Service), you can see that the url property is empty. before consuming the methods, you can set it in the instance.

 ls = new Log_Service();
 ls.setUrl('http://ws.whatyouwant.here');

and then make your request.

DjimOnDev
  • 389
  • 3
  • 13