3

I'm trying to use HttpsTransportSE in Ksoap, but I get a URISyntaxException, saying I've got a Malformed IPV6 address- which I guess makes sense as I'm passing a URL... but how do I fix it?

I found a similar query here but this relates to the Http as opposed to Https class and I don't have the overloaded method described.

I'm new to SOAP but my code so far is along the lines of:

    String SOAP_ACTION = "http://url.to.thingy";
String METHOD_NAME = "methodNameFromAsmx";
String NAMESPACE = "http://the.namespace";
String URL = ServerName;
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    request.addProperty("Address", UserName);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet=true;
    envelope.setOutputSoapObject(request);
    HttpsTransportSE androidHttpTransport = new HttpsTransportSE(URL, 443, "/relative/pathToAsmx", 5000);
    androidHttpTransport.call(SOAP_ACTION, envelope);

I've replaced the various properties with fudge for now as I'm hoping it's not relevant. My error shows the malformed IPV6 as: https:%2F%2Fmy.url.com

Community
  • 1
  • 1
James
  • 999
  • 2
  • 11
  • 22
  • whats inside your `URL`? – waqaslam Jan 31 '12 at 09:51
  • url is simply "h t t p s : / / some.server.com" - essentially the same that's returned in the error. I don't get why it thinks it's an IPV6 address when it's not... – James Jan 31 '12 at 10:01
  • remove `https://` from your url and give a try, because you are already making an `HttpsTransportSE` call – waqaslam Jan 31 '12 at 10:10
  • Thanks - same thing happens though – James Jan 31 '12 at 10:17
  • http://stackoverflow.com/questions/7518324/ksoap2-how-to-use-httpstransportse – waqaslam Jan 31 '12 at 12:05
  • Thanks - that was useful. I also found an update to fix accepting all SSL certificates- so now I remove the https:// part from my URL and it fixes that error... I get a new error now, but I don't think it's related so I'll probably post another question if I get stuck! – James Jan 31 '12 at 13:47
  • what do you mean `update to fix accepting all SSL certificates`? how to do that? – waqaslam Jan 31 '12 at 13:57
  • is your new error regarding socket.closed? – waqaslam Jan 31 '12 at 13:58
  • It suggested I chat to avoid excessive comments but as a new member I cannot. See here for SSL fix: http://stackoverflow.com/questions/2248147/andoird-ksoap2-https-problem new error is a parsing error. – James Jan 31 '12 at 20:46

1 Answers1

0

Use this format,

private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL = "192.168.30.8";
private static final String SERVICE = "/Wcf.WCF_.svc?wsdl";
private static String SOAP_ACTION = "http://tempuri.org/iWCF/";
Ali Bagheri
  • 3,068
  • 27
  • 28