j2meからphp Webサービスを呼び出すためにksoap/ksoap2 APIを使用しています。
ksoap の場合:
SoapObject client = new SoapObject(NAMESPACE, "ns2221:save_record");
client.addProperty("cc", "1234560789");
ByteArrayOutputStream bos = new ByteArrayOutputStream();
XmlWriter xw = new XmlWriter(new OutputStreamWriter(bos));
SoapEnvelope envelope = new SoapEnvelope(new ClassMap(Soap.VER11));
envelope.setEncodingStyle("http://schemas.xmlsoap.org/soap/encoding/");
envelope.setBody(client);
envelope.write(xw);
xw.flush();
bos.write('\r');
bos.write('\n');
byte[] requestData = bos.toByteArray();
String requestSOAPmesg = new String(requestData);
System.out.println("request Soap Message: " + requestSOAPmesg);
HttpTransport ht = new HttpTransport();
ht.setUrl(url);
ht.setSoapAction(NAMESPACE);
SoapObject o = (SoapObject) ht.call(client);
使った事のある..
そしてksoap2で
SoapObject client = new SoapObject("http://192.168.0.205:82/imageuploader/save_record.php#save_record", "ns8862:save_record");
client.addProperty("cc", "1234560789");
//Create Envelope for
Object so=soapMsg;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=false;
envelope.bodyOut=client;
System.out.println("Before Envelope");
HttpTransport ht = new HttpTransport(url);
ht.call("http://192.168.0.205:82/imageuploader/save_record.php#save_record", envelope);
SoapObject o=(SoapObject) envelope.getResponse();
使った事のある..
それは私を返します
障害文字列:
faultstring: '操作 'ns8862:save_record' は、このサービスの WSDL で定義されていません' faultactor: '' 詳細: org.kxml2.kdom.Node@ea0ef881
Web サービスでは、最初のタグ ns8862:save_record は、4 つの番号に対する要求が渡されるたびに変更されます。
解決策はありますか?