2

This is not duplicated a question. I tried using ksoap2-android. its working without any issue.

It happens only on code generated by WSDL2Code @ http://www.wsdl2code.com. I tried many WSDLs:

It always throws an exception:

wsdl2code throws java.net.MalformedURLException: Protocol not found:

java.net.MalformedURLException: Protocol not found: at java.net.URL.(URL.java:176) at java.net.URL.(URL.java:125) at org.ksoap2.transport.ServiceConnectionSE.(ServiceConnectionSE.java:65) at org.ksoap2.transport.HttpTransportSE.getServiceConnection(HttpTransportSE.java:206) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:125) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95) at com.Wsdl2Code.WebServices.TempConvert.TempConvert.CelsiusToFahrenheit(TempConvert.java:177) at com.Wsdl2Code.WebServices.TempConvert.TempConvert.CelsiusToFahrenheit(TempConvert.java:162) at com.notification.android.testwsdl.MainActivity$1$1.run(MainActivity.java:38) at java.lang.Thread.run(Thread.java:818)

Maher Abuthraa
  • 17,493
  • 11
  • 81
  • 103

2 Answers2

1

I noted that Code2WSDL generates empty url. Here is Snippet of generated code from http://www.w3schools.com/xml/tempconvert.asmx?WSDL :

    public class TempConvert {

        public String NAMESPACE ="http://www.w3schools.com/xml/";
        public String url="";
        public int timeOut = 5000;
        public IWsdl2CodeEvents eventHandler;
        public SoapProtocolVersion soapVersion;
...

Just assign proper URL which is here in my case: http://www.w3schools.com/xml/tempconvert.asmx

That will solve the problem .. I've already reported this issue.

I hope that may help and save others' time.

Good luck,'.

Maher Abuthraa
  • 17,493
  • 11
  • 81
  • 103
0

The tool Code2WSDL generates empty url. So put the url in the empty String url="" resolve the problem.

javierZanetti
  • 288
  • 4
  • 17