OK,
this thing works now.
Example is extremly simple 'though.
Service (
ServiceHello.asmx.cs):
PHP Code:
xxx91;WebMethodxxx93;
public string HelloWorld()
{
return "HelloWorld!";
}
Method to use it BlackBerry:
PHP Code:
String serviceNamespace = "http://tempuri.org/";
String serviceAsmx = "ServiceHello.asmx";
String serviceURL = serviceNamespace + serviceAsmx;
String serviceMethod = "HelloWorld";
String soapAction = serviceNamespace + serviceMethod;
HttpTransport ht = new HttpTransport(serviceURL);
ht.debug = true;
SoapObject request = new SoapObject(serviceNamespace, serviceMethod);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = request;
ht.call(soapAction, envelope);
String getRsp = envelope.getResponse().toString();
Important things were (IMHO):
1. Use
asmx file instead of
wsdl in
HttpTransport call.
Maybe because that was MS Web service (?)
2. To set
soapAction.
3. Direct use of toString() instead of
PHP Code:
SoapObject result = (SoapObject)envelope.getResponse();
String getResp = result.toString();
which caused (for me) that
ClassCastException.