0
SOAP請求中使用GlassFish Web服務測試程序測試傳遞參數從sudzC Java的web服務的iOS總是空
<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header/>
<S:Body>
<ns2:hello xmlns:ns2="http://WS/">
<name>asd</name>
</ns2:hello>
</S:Body>
SOAP響應
<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:helloResponse xmlns:ns2="http://WS/">
<return>Hello asd !</return>
</ns2:helloResponse>
</S:Body>
現在我打電話這個hello方法在我的ios上使用sudz將'name'參數傳遞給webservice。 所以這裏面createEnvelope代碼:
[s appendString: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"];
[s appendString:@"<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">"];
[s appendString:@"<S:Header/>"];
[s appendString:@"<S:Body>"];
[s appendString:@"<ns2:hello "];
[s appendString:@"xmlns:ns2=\"http://WS/"];
[s appendString:@"\"/>"];
[s appendString:@"<name>alvin</name>"];
[s appendString:@"</ns2:hello> "];
[s appendString:@"</S:Body>"];
[s appendString:@"</S:Envelope>"];
這裏是NetBeans的日誌時IOS時由Android
INFO: Received WS-I BP non-conformant Unquoted SoapAction HTTP header: http://WS/hello
INFO: berhasil Cornel
訪問,但它總是返回null參數訪問
INFO: Received WS-I BP non-conformant Unquoted SoapAction HTTP header: http://WS/hello
INFO: berhasil null
日誌和在android使用ksoap和它完美的作品。 與上面的那些信封我可以調用方法(你好),但它傳遞null參數。請幫助T_T
謝謝你的隊友的答案,其實我沒有繼續我的研究在這裏,所以我轉移到JSON代替。儘管json比這個肥皂更快。 :) – xeravim 2012-12-04 13:28:12