i have been trying to call a simple .NET webservice (HelloWorld) via android using ksoap2 ( i already tried and succeeded for a different webservice) . but this one requires an authentication so i searched how to add a header for the authentication , but still , i have no result returned in my textview.
SoapObject Request = new SoapObject(NAMESPACE,METHOD_NAME);
List<HeaderProperty> headers = new ArrayList<HeaderProperty>();
headers.add(new HeaderProperty("Authorization", "Basic"+Base64.encode("Username:Password".getBytes())));
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(Request);
HttpTransportSE aht = new HttpTransportSE(URL);
try{
aht.call(SOAP_ACTION,envelope,headers);
SoapPrimitive resultString = (SoapPrimitive)envelope.getResponse();
tv.setText("yo :" + resultString);
}
catch(Exception e){
e.printStackTrace();
}
I have also an error in my Log :
ERROR : Thread Attached failed , but i don' think it's the source of
here is the wsdl for the HelloWorld method :
> <wsdl:types>
> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
> <s:element name="HelloWorld">
> <s:complexType/>
> </s:element>
> <s:element name="HelloWorldResponse">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string"/>
> </s:sequence>
> </s:complexType>
> </s:element>
my problem. Have anyone encountered this kind of problem , or my code is wrong at some point ?