simpligility / ksoap2-android Goto Github PK
View Code? Open in Web Editor NEWThis project forked from karlmdavis/ksoap2-android
ksoap2-android - SOAP support for Android
Home Page: http://simpligility.github.io/ksoap2-android/
License: Other
This project forked from karlmdavis/ksoap2-android
ksoap2-android - SOAP support for Android
Home Page: http://simpligility.github.io/ksoap2-android/
License: Other
Hi,
while using HttpsTransportSE() , it throws exception
"java.net.UnknownHostException: Unable to resolve host "my.host.com": No address associated with hostname" in Android PIE while working fine in other android versions and simple HttpTransportSE() is also working fine.
Please help how to resolve this.
Ideally this project would be migrated to a new groupId com.simpligility.* and published to the Central Repository.
This potentially includes any dependencies that are forks or assessing if upstream version can be used.
when i call web service dump object contains text "Bad Request"
here is the code;
`` SoapObject request = new SoapObject(NAMESPACE, prms[0].MethodName);
for (PropertyInfo pi : prms[0].Params) {
request.addProperty(pi.name, pi.getValue());
}
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
envelope.setOutputSoapObject(request);
envelope.env = "http://schemas.xmlsoap.org/soap/envelope/";
envelope.dotNet = true;
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
try {
androidHttpTransport.debug = true;
SOAP_ACTION1 += prms[0].MethodName;
androidHttpTransport.call(SOAP_ACTION1, envelope);``
I can not pass the basic authenticate,and I do not know the head ,but i know the username and password,how can i set the defaultauthenticate
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
soapenv:Header/
soapenv:Body
tem:UploadStoreOrderData
tem:objDS
<xs:schema id="_x0032_0170421144049" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="_x0032_0170421144049" msdata:IsDataSet="true" msdata:Locale="en-US">
xs:complexType
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Info">
xs:complexType
xs:sequence
<xs:element name="ORDER_DATE" type="xs:string" minOccurs="0"/>
<xs:element name="ABI_ARTICLE_ID" type="xs:string" minOccurs="0"/>
<xs:element name="PO_BATCH_QTY" type="xs:string" minOccurs="0"/>
<xs:element name="INPUT_DATE" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<_x0032_0170421144049 xmlns="">
<ORDER_DATE>20170422</ORDER_DATE>
<ABI_ARTICLE_ID>11010405</ABI_ARTICLE_ID>
<MIN_PO_BATCH_QTY>1</MIN_PO_BATCH_QTY>
<MAX_PO_BATCH_QTY>3</MAX_PO_BATCH_QTY>
<ORDER_DATE>20170422</ORDER_DATE>
<ABI_ARTICLE_ID>11020001</ABI_ARTICLE_ID>
<MIN_PO_BATCH_QTY>1</MIN_PO_BATCH_QTY>
<MAX_PO_BATCH_QTY>999</MAX_PO_BATCH_QTY>
</_x0032_0170421144049>
</diffgr:diffgram>
</tem:objDS>
tem:strFileNameOrderInfo_31301701318557_20170429175900</tem:strFileName>
</tem:UploadStoreOrderData>
</soapenv:Body>
</soapenv:Envelope>
Above is a webservice request.
How to make a soapobject request like this in android?
maybe at least with Javadoc and sources.
Hi,
any suggestion ?
I work with the latest release 3.5.0 but it doesn't work.
If i use version 3.0.0-RC.4 it works.
Hello I am getting an error when using okhttp 3.6.0, but when I change to okhttp 3.2.0 the error goes away. Is there a way to use the newer verstion of okhttp or just have to wait for support of 3.6.0 gets release?
Caused by: java.lang.VerifyError: okhttp3/internal/huc/HttpURLConnectionImpl at org.ksoap2.transport.OkHttpServiceConnectionSE.<init>(OkHttpServiceConnectionSE.java:63) at org.ksoap2.transport.OkHttpServiceConnectionSE.<init>(OkHttpServiceConnectionSE.java:54) at org.ksoap2.transport.OkHttpTransportSE.getServiceConnection(OkHttpTransportSE.java:54) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:154) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:113) at com.tecsiq.warrantiq.network.SoapSettings.makeSoapCall(SoapSettings.java:84) at com.tecsiq.warrantiq.ui.activities.LoginActivity$performLoginRequestAsyncTask.doInBackground(LoginActivity.java:242) at com.tecsiq.warrantiq.ui.activities.LoginActivity$performLoginRequestAsyncTask.doInBackground(LoginActivity.java:178) at android.os.AsyncTask$2.call(AsyncTask.java:287) at java.util.concurrent.FutureTask.run(FutureTask.java:234) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:841)
Good afternoon,
I have a problem with a very large request. When this request is sent to our webservice it only returns when timeout is reached. The server returns in about 20 minutes before timeout is received.
The communication works well with small requests, is there any issue with slow responses? (Around 10~15 minutes)
Javadoc seems to be bombing out at least
Hi
I'm using ksoap-3.6.0 to call SAP webservices. I got a strange behavior when timeout (2000ms) is reached, as if it wasn't respected. Any hints on why this happens? I'm testing without active connection to server (VPN not enabled) in order to check out slow/bad-performing network. I'm using IP (no DNS resolution involved).
03-22 10:18:01.777 2324-3808/myapp I/MyAppDeskApp: Loading from SAP (qrcode 123456789), timeout 2 seconds
03-22 10:18:03.849 2324-3850/myapp D/dalvikvm: GC_FOR_ALLOC freed 2691K, 25% free 12483K/16464K, paused 16ms, total 16ms
03-22 10:18:03.909 2324-3850/myapp D/dalvikvm: GC_FOR_ALLOC freed 3203K, 28% free 11869K/16464K, paused 17ms, total 17ms
03-22 10:18:03.965 2324-3850/myapp D/dalvikvm: GC_FOR_ALLOC freed 3055K, 28% free 11867K/16464K, paused 12ms, total 12ms
03-22 10:18:04.009 2324-3850/myapp D/dalvikvm: GC_FOR_ALLOC freed 3054K, 28% free 11867K/16464K, paused 11ms, total 11ms
03-22 10:18:04.049 2324-3850/myapp D/dalvikvm: GC_FOR_ALLOC freed 3053K, 28% free 11867K/16464K, paused 11ms, total 11ms
03-22 10:18:04.097 2324-3850/myapp D/dalvikvm: GC_FOR_ALLOC freed 3053K, 28% free 11867K/16464K, paused 13ms, total 13ms
03-22 10:18:04.145 2324-3850/myapp D/dalvikvm: GC_FOR_ALLOC freed 3053K, 28% free 11867K/16464K, paused 12ms, total 12ms
[ad libitum]
03-22 11:20:58.401 7042-7309/MyApp E/MyAppDeskApp: Error: sendto failed: ETIMEDOUT (Connection timed out)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: java.net.SocketException: sendto failed: ETIMEDOUT (Connection timed out)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:499)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at libcore.io.IoBridge.sendto(IoBridge.java:468)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.net.PlainSocketImpl.write(PlainSocketImpl.java:507)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at com.splunk.mint.network.io.OutputStreamMonitor.write(OutputStreamMonitor.java:54)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.io.BufferedOutputStream.flushInternal(BufferedOutputStream.java:185)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:85)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at com.android.okhttp.internal.http.HttpTransport.flushRequest(HttpTransport.java:107)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:642)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:179)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at com.altevie.MyApp.deskapp.UsersActivity$TestTask.doInBackground(UsersActivity.java:229)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at com.altevie.MyApp.deskapp.UsersActivity$TestTask.doInBackground(UsersActivity.java:214)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:288)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at java.lang.Thread.run(Thread.java:841)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: Caused by: libcore.io.ErrnoException: sendto failed: ETIMEDOUT (Connection timed out)
03-22 11:20:58.401 7042-7309/MyApp W/System.err: at libcore.io.Posix.sendtoBytes(Native Method)
03-22 11:20:58.405 7042-7309/MyApp W/System.err: at libcore.io.Posix.sendto(Posix.java:156)
03-22 11:20:58.405 7042-7309/MyApp W/System.err: at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
03-22 11:20:58.405 7042-7309/MyApp W/System.err: at libcore.io.IoBridge.sendto(IoBridge.java:466)
03-22 11:20:58.405 7042-7309/MyApp W/System.err: ... 19 more
Is it planned to make a release containing the latest module added for okhttp ?
How does one go about using certificate pinning with ksoap2?
Any support?
Package version ksoap2-android-assembly-3.4.0-jar-with-dependencies.jar throw EOFException in any cases the invoke method call throw the EOFException.
It occurs in random cases for the same address, in the webserver log the request isn't registered.
I'm using S3 with android 4.3.
Does anyone know why this happens ?
...
transport.call(""" + NAMESPACE + METHOD +""", envelope);
...
08-15 15:45:54.625: W/System.err(27006): java.io.EOFException
08-15 15:45:54.635: W/System.err(27006): at libcore.io.Streams.readAsciiLine(Streams.java:203)
08-15 15:45:54.635: W/System.err(27006): at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:579)
08-15 15:45:54.635: W/System.err(27006): at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:827)
08-15 15:45:54.635: W/System.err(27006): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
08-15 15:45:54.635: W/System.err(27006): at ibcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
08-15 15:45:54.635: W/System.err(27006): at org.ksoap2.transport.ServiceConnectionSE.getResponseCode(ServiceConnectionSE.java:103)
08-15 15:45:54.635: W/System.err(27006): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:192)
08-15 15:45:54.635: W/System.err(27006): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118)
08-15 15:45:54.635: W/System.err(27006): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:113)
I'm soap for billing api.
WSDL URL : http://94.206.70.106:8181/cxf/services/UnifiedPartner?wsdl
My request is :
<?xml version="1.0" encoding="UTF-8"?>
<v:Envelope xmlns:v="http://schemas.xmlsoap.org/soap/envelope/" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<v:Header />
<v:Body>
<purchaseConsumeProduct xmlns="https://94.206.70.106:8181/">
<userId>97XXXXXXX</userId>
<serviceId>S-KXXXXX</serviceId>
<premiumResourceType>MP-xxx-xx-xxxx-Sub-B2-D-xx</premiumResourceType>
<productId>Daily MAP Test Sub V2 IN</productId>
<purchaseMetas>
<key>du:assetDescription</key>
<value>Subscription</value>
</purchaseMetas>
<!--Zero or more repetitions:-->
<billingMetas>
<key>du:assetID</key>
<value>-</value>
</billingMetas>
<billingMetas>
<key>du:contentType</key>
<value>mobileApp</value>
</billingMetas>
<billingMetas>
<key>du:channel</key>
<value>COMMERCE_API</value>
</billingMetas>
<!--Zero or more repetitions:-->
<usageMetas>
<key>du:externalid</key>
<value>S-XXXXXX</value>
</usageMetas>
</purchaseConsumeProduct>
</v:Body>
</v:Envelope>
But they need like below
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.api.sdp.ericsson.com/">
<soapenv:Header/>
<soapenv:Body>
<ws:purchaseConsumeProduct>//Method name
<userId>97XXXXXXX</userId>
<serviceId>S-KXXXXX</serviceId>
<premiumResourceType>MP-xxx-xx-xxxx-Sub-B2-D-xx</premiumResourceType>
<productId>Daily MAP Test Sub V2 IN</productId>
<purchaseMetas>
<key>du:assetDescription</key>
<value>Subscription</value>
</purchaseMetas>
<!--Zero or more repetitions:-->
<billingMetas>
<key>du:assetID</key>
<value>-</value>
</billingMetas>
<billingMetas>
<key>du:contentType</key>
<value>mobileApp</value>
</billingMetas>
<billingMetas>
<key>du:channel</key>
<value>COMMERCE_API</value>
</billingMetas>
<!--Zero or more repetitions:-->
<usageMetas>
<key>du:externalid</key>
<value>S-XXXXXX</value>
</usageMetas>
</ws:purchaseConsumeProduct>
</soapenv:Body>
</soapenv:Envelope>
How i can achieve above request with Ksoap.I have tried lots of way but not got any success.
Please help me here.
I've a method that returns 7426 records, and XML looks like..
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getLocationsWSResponse xmlns:ns2="">
<return>
<data>
<code>S11DC14P01</code>
<preferred>false</preferred>
<system>false</system>
</data>
<data>
<code>S11DC14P02</code>
<preferred>false</preferred>
<system>false</system>
</data>
<data>
<code>S11DC14P03</code>
<preferred>false</preferred>
<system>false</system>
</data>
.....
.....
....
<message>returned 7426 records</message>
<messageCode>00</messageCode>
</return>
</ns2:getLocationsWSResponse>
</S:Body>
</S:Envelope>
I put a log before http transport call, and after.. it takes about 3 minutes....
I'm using ksoap2-android-assembly-3.5.0-jar-with-dependencies.jar library.
What is the problem??
Hi.
I am facing with the issue described here.
Because of 'n0' prefix, sevice does not accept login request.
I'm Working in android and using
ksoap2-android-3.6.1
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<func_POS_KotSave_App xmlns="http://tempuri.org/">
<Shift_Id>int</Shift_Id>
<Waiter_Id>decimal</Waiter_Id>
<Table_Id>long</Table_Id>
<Noof_Pax>int</Noof_Pax>
<Hold_No>decimal</Hold_No>
<Location_Id>int</Location_Id>
<Bill_Date>dateTime</Bill_Date>
<CustVend_Id>decimal</CustVend_Id>
<CustVend_Name>string</CustVend_Name>
<User_Id>decimal</User_Id>
<POs_Id>int</POs_Id>
<KotDetList>
<KotDetails>
<SlNo>int</SlNo>
<ItemCode>decimal</ItemCode>
<Description>string</Description>
<Received>decimal</Received>
<TotalQty>decimal</TotalQty>
<UM>decimal</UM>
<Cost>decimal</Cost>
<DiscountValue>decimal</DiscountValue>
<DiscountPercent>decimal</DiscountPercent>
<DiscountAmount>string</DiscountAmount>
<CostAfterDiscount>decimal</CostAfterDiscount>
<TaxCode>decimal</TaxCode>
<ProductAmount>decimal</ProductAmount>
<TaxAmount>decimal</TaxAmount>
<LandedCost>decimal</LandedCost>
<Amount>decimal</Amount>
<ItemNote>string</ItemNote>
</KotDetails>
<KotDetails>
<SlNo>int</SlNo>
<ItemCode>decimal</ItemCode>
<Description>string</Description>
<Received>decimal</Received>
<TotalQty>decimal</TotalQty>
<UM>decimal</UM>
<Cost>decimal</Cost>
<DiscountValue>decimal</DiscountValue>
<DiscountPercent>decimal</DiscountPercent>
<DiscountAmount>string</DiscountAmount>
<CostAfterDiscount>decimal</CostAfterDiscount>
<TaxCode>decimal</TaxCode>
<ProductAmount>decimal</ProductAmount>
<TaxAmount>decimal</TaxAmount>
<LandedCost>decimal</LandedCost>
<Amount>decimal</Amount>
<ItemNote>string</ItemNote>
</KotDetails>
</KotDetList>
<ItemSerailList>
<ItemSeriel_class>
<Supplier>string</Supplier>
<ItemId>int</ItemId>
<ItemCode>decimal</ItemCode>
</ItemSeriel_class>
<ItemSeriel_class>
<Supplier>string</Supplier>
<ItemId>int</ItemId>
<ItemCode>decimal</ItemCode>
</ItemSeriel_class>
</ItemSerailList>
<TaxDetList>
<TaxDetails_class>
<Rank>decimal</Rank>
<ItemId>decimal</ItemId>
<TaxGrId>decimal</TaxGrId>
<TaxId>decimal</TaxId>
<TaxPer>decimal</TaxPer>
<TaxAmt>decimal</TaxAmt>
<TaxBasedOnAmt>decimal</TaxBasedOnAmt>
</TaxDetails_class>
<TaxDetails_class>
<Rank>decimal</Rank>
<ItemId>decimal</ItemId>
<TaxGrId>decimal</TaxGrId>
<TaxId>decimal</TaxId>
<TaxPer>decimal</TaxPer>
<TaxAmt>decimal</TaxAmt>
<TaxBasedOnAmt>decimal</TaxBasedOnAmt>
</TaxDetails_class>
</TaxDetList>
</func_POS_KotSave_App>
</soap:Body>
</soap:Envelope>
this is my request format and i cant create a request like this. Already try KvmSerializable and marshal. how can i set a list of data to kotDetails? on my try it show exception and only one value of list is taken to request.
what i am doing is ..
PropertyInfo pi11 = new PropertyInfo();
pi11.name = "KotDetList";
pi11.setValue(kotDetails);
pi11.setType(kotDetails.getClass());
request.addProperty(pi11);
envelope.addMapping(AppConstants.NAMESPACE, "KotDetails", kotDetails.getClass());
that class kotDetails is implimented KvmSerializable. Whats can i do?
Hi,
i would use this library with OkHttp.
I use generated Soap classes from EasyWSDL and there is a way to override the default transport used.
The problem is:
If I use OkHttpTransportSE
, i get a java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/huc/OkHttpURLConnection;
if used with OkHttp 3.14.2,
While I'm not able to use OkHttpTransport
because it is not extending the Transport
interface which is required by the generated classes.
Is there a way to solve this problem?
Thank you
I want to get the latest release .jar
3.6.2
but I have no idea how to build.....
I have just jumped to V3.6.2 from V3.30, and got the following error:
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: okhttp3/Address.class
I assume that I just need a quick tip from someone who has dealt with this before to handle this.
I am following this link.
http://stackoverflow.com/questions/3440062/ksoap-2-android-with-https
It has an example to use HttpTransportSE.
HttpTransportSE aht = new HttpTransportSE(URL);
aht.call(SOAP_ACTION, envelope);
Likewise,
Can you give me example with HttpsTransportSE ?
It has come with parameter like proxy, server etc.
I have to connect this URL
https://www.therasoftonline.com/tms/myhealthpro.asmx
Can you please help?
Hello everyone, here is my problem:
I'm successful made a connection to a SOAP webservice that need a certificate authentication the establish a connection, using the Eclipse, with this code:
SoapSerializationEnvelope envelope = SoapEnvelopeCreator.createSOAPRequest();
HttpTransportSE androidHttpTransport = new HttpTransportSE(url);
androidHttpTransport.call(SOAP_ACTION), envelope);
result = (SoapObject) envelope.getResponse();
It's a very simple code, not fancy at all.
And I make the connection configuration using this code:
private void setupSystem() {
System.clearProperty("javax.net.ssl.keyStore");
System.clearProperty("javax.net.ssl.keyStorePassword");
System.clearProperty("javax.net.ssl.trustStore");
System.clearProperty("javax.net.ssl.trustStorePassword");
System.clearProperty("https.protocols");
System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
System.setProperty("javax.net.ssl.keyStore", this.infoCert.getCertPath());
System.setProperty("javax.net.ssl.keyStorePassword", this.infoCert.getCertPassword());
System.setProperty("javax.net.ssl.trustStoreType", "JKS");
System.setProperty("javax.net.ssl.trustStore", "src/main/resources/cacerts/cacertsProd");
System.setProperty("javax.net.ssl.trustStorePassword", CACERT_PASSWORD);
System.setProperty("https.protocols", "TLSv1.2");
}
It worked fine on my Eclipse's tests but, when I tried to use the same code on an Android device, I get this error:
FATAL EXCEPTION: AsyncTask #1
yada yada..
Caused by: java.lang.NullPointerException:
Attempt to invoke virtual method 'java.lang.Object com.android.org.conscrypt.SSLParametersImpl.clone()' on a null object reference
at com.android.org.conscrypt.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:102)
at com.android.okhttp.Connection.upgradeToTls(Connection.java:171)
at com.android.okhttp.Connection.connect(Connection.java:151)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:217)
at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:25)
at org.ksoap2.transport.ServiceConnectionSE.openOutputStream(ServiceConnectionSE.java:130)
at org.ksoap2.transport.HttpTransportSE.sendData(HttpTransportSE.java:295)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:184)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:113)
at mypackage(SendRequisition.java:124)
I don't get it. What am I doing wrong and how do I solve this?
SoapObject inseriranimal = new SoapObject(namespace, inserir);
SoapObject pet = new SoapObject(namespace, "a");
pet.addProperty("id", a.getId());
pet.addProperty("tipo", a.getTipo());
pet.addProperty("nome", a.getNome());
// como eu coloco um objeto usuario aqui para pegar o id e atribuir junto com essa requisição para o web service ?
inseriranimal.addSoapObject(pet);
remove usage of github plugin and use scm publish just like in the android maven plugin setup
Hi guys,
in Ksoap2-base / org.ksoap2.transport.Transport.java :
constant Transport.USER_AGENT is statically declared as :
protected static final String USER_AGENT = "ksoap2-android/2.6.0+";
This is quite confusing when checking/sniffing soap communication between mobile and server.
As a result, communication between my server and my mobile device starts with that header :
POST <script>.php?wsdl HTTP/1.1
User-Agent: ksoap2-android/2.6.0+
SOAPAction: getLogin
Content-Type: text/xml;charset=utf-8
Accept-Encoding: gzip
Content-Length: 508
Host: <myhost>:<myhost_port>
Connection: Keep-Alive
<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">....</v:Envelope>
Is someone able to do it ?
(i would love to take time for this, but i'm stuck in another problem)
In Android 7.1.2 we expereince crashes with error:
Detected problems with app native libraries
Do you have plans to release a new version with fix?
timeOut is passed to HttpTransportSE.
HttpTransportSE httpTransport = new HttpTransportSE(url, timeOut);
HttpTransportSE accepts the input into this constructor:
public HttpTransportSE(String url, int timeout) {
super(url, timeout);
}
super(url, timeout) - super is Transport.java. Looking into that, I find the constructor using only url, timeout.
public Transport(String url, int timeout) {
this.timeout = 20000;
this.readTimeout = 20000;
this.xmlVersionTag = "";
this.bufferLength = 262144;
this.prefixes = new HashMap();
this.url = url;
this.timeout = timeout;
*** line missing here should be
this.readTimeout = timeout;
}
It seems there is a relatively new implementation of "readtimeout" that is not getting set to the timeout passed. Every other constructor signature used will set this.readtimeout = the passed timeout. So it would seem that without this.readtimeout getting set, it will always use the default which is 20 seconds.
To get around this I just call
HttpTransportSE httpTransport = new HttpTransportSE(null, url, timeOut);
Passing "null" to the proxy parameter, which forces it to use the method which properly sets this.readtimeout to the passed value. Testing with this change, my web service calls were no longer timing out at 20 seconds, but at 60 like I asked it to.
My web service works fine except from one of the website when i don't get response but i get this error
org.xmlpull.v1.XmlPullParserException: expected: '>' actual: '�' (position:END_TAG @8:19 in java.io.InputStreamReader@41e579c8)
due to some character i am getting the exception.
I am using the ksoap2-android-assembly-3.0.0-jar-with-dependencies jar file.
Use MIT or point to license info page.
i am getting below exception while accesing a WCF service using ksoap2 in android
org.xmlpull.v1.XmlPullParserException: unexpected type (position:TEXT
--uuid:095
Is this issue been taken care of in the new version
I am still getting it.
Repository seems to be down with status 503
By following documented "releases" link:
https://oss.sonatype.org/content/repositories/ksoap2-android-releases/
Or by resolution with given Gradle dependency config:
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
dependencies {
implementation 'com.google.code.ksoap2-android:ksoap2-android:3.6.4'
}
Hi @simpligility,
I can not add this library to gradle.
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.0'
when I sync i get this error:
Error:(58, 13) Failed to resolve: com.google.code.ksoap2-android:ksoap2-android:3.6.0
Could not resolve all dependencies for configuration ':app:_repositoriesCompile'.
Could not resolve com.google.code.ksoap2-android:ksoap2-android:3.6.0.
Required by:
SyntonaLogic:app:unspecified
> Could not resolve com.google.code.ksoap2-android:ksoap2-android:3.6.0.
> Could not get resource 'https://github.com/omadahealth/omada-nexus/raw/master/release/com/google/code/ksoap2-android/ksoap2-android/3.6.0/ksoap2-android-3.6.0.pom'.
> Could not GET 'https://github.com/omadahealth/omada-nexus/raw/master/release/com/google/code/ksoap2-android/ksoap2-android/3.6.0/ksoap2-android-3.6.0.pom'.
> peer not authenticated
> Could not resolve com.google.code.ksoap2-android:ksoap2-android:3.6.0.
> Could not get resource 'https://jcenter.bintray.com/com/google/code/ksoap2-android/ksoap2-android/3.6.0/ksoap2-android-3.6.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/code/ksoap2-android/ksoap2-android/3.6.0/ksoap2-android-3.6.0.pom'.
> peer not authenticated
> Could not resolve com.google.code.ksoap2-android:ksoap2-android:3.6.0.
> Could not get resource 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/com/google/code/ksoap2-android/ksoap2-android/3.6.0/ksoap2-android-3.6.0.pom'.
> Could not GET 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/com/google/code/ksoap2-android/ksoap2-android/3.6.0/ksoap2-android-3.6.0.pom'.
> peer not authenticated
I have the below code to perform 2-way SSL
requests with ksoap2
.
private static String callSOAPServer(String methodName,HashMap<String, String> parameter) throws IOException, UnrecoverableKeyException, CertificateException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
String response = null;
METHOD_NAME=methodName;
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
TLSSocketFactory socketFactory=new TLSSocketFactory();
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
PropertyInfo pi = new PropertyInfo();
pi.setName("des");
pi.setValue(parameter.get("des"));
request.addProperty(pi);
envelope.bodyOut= request;
HttpsTransportSE httpsTransportSE=new KeepAliveHttpsTransportSE(HOST,PORT,SERVICE,500000);
((HttpsServiceConnectionSE) httpsTransportSE.getServiceConnection()).setSSLSocketFactory(socketFactory);
try {
httpsTransportSE.call(NAMESPACE+METHOD_NAME, envelope);
SoapPrimitive resp = (SoapPrimitive)envelope.getResponse();
response=resp.toString();
} catch (Exception e) {
e.printStackTrace();
}
return response;
}
Now this returns connection closed by peer exception, which means certificates has not been sent with request. I had a feeling that ((HttpsServiceConnectionSE) httpsTransportSE.getServiceConnection()).setSSLSocketFactory(socketFactory);
should set the SSLSocketFactory
to the request, but it doesn't.
When I dig deep, it is noticed that httpsTransportSE.call()
method, it internally calls HttpTransportSE
's call method, sinceHttpsTransportSE
class is extended with HttpTransportSE
. But when debugged, there isn't any SSLSocketFactory
context attached with the request.
How this should be working? Am I assuming something wrong here? How am I actually supposed to attach my socketFactory
to the httpsTransportSE
? Hope to get some help.
Here is the detailed SO Question link
kSOAP2 refuses to parse a SOAP response I'm getting because it contains 2 elements with the same id value.
The thing is that in the XML Schema, this id is of type anyURI, not xs:ID, so it doesn't have any unicity semantic:
https://github.com/oehf/ipf/blob/8a22c51a47fab1af6fea7da81f9e5d8de636e225/commons/ihe/xds/src/main/resources/wsdl/schema/ebRS30/rim.xsd#L103
Is that a bug in kSOAP2 or is there a way to disable that exception?
I have been using Ksoap2 library in my application from past 11 months. Since then i have started serious programming.
From the day one in android development i am bit facing this every day or other "java.io.IOException: BufferedInputStream is closed" . There is much information available on the www. However i feel, the information is discrete and not much relevant.
By relevant means
How come increasing timeout to to around 60000 will solve the problem.
How come putting the soap request in a infinite loop is the solution to the answer.
It will be very helpful if you help me out in sorting this problem, as my application is heavily depended on SOAP API.
I just want information reading this context. Why my buffered input stream is being closed? What checks, counter action should be taken in order to prevent and resolve it.
Thanks
Trying to use ksoap2 with a current android project, I came to the point where I have to generate ksoap2 java code for android by using the wsdl2ksoap2-android script. But the linked page at your landing page links to this page at google code. The Download link just gives me a 401 with following message:
401: Anonymous users does not have storage.objects.get access to object google-code-archive/v2/code.google.com/wsdl2ksoap2-android/downloads-page-1.json.
This error frequently occurs on Android emulators when HttpTransportSE.call() is executed:
cause = {java.net.ProtocolException@8112} "java.net.ProtocolException: unexpected end of stream"
backtrace = {java.lang.Object[10]@8124}
0 = {int[18]@8127}
1 = {java.lang.Class@2858} "class com.android.okhttp.internal.http.Http1xStream$FixedLengthSource"
2 = {java.lang.Class@2880} "class com.android.okhttp.okio.RealBufferedSource$1"
3 = {java.lang.Class@3793} "class java.io.BufferedInputStream"
4 = {java.lang.Class@3793} "class java.io.BufferedInputStream"
5 = {java.lang.Class@3793} "class java.io.BufferedInputStream"
6 = {java.lang.Class@6708} "class org.ksoap2.transport.HttpTransportSE"
7 = {java.lang.Class@6708} "class org.ksoap2.transport.HttpTransportSE"
8 = {java.lang.Class@6708} "class org.ksoap2.transport.HttpTransportSE"
Wireshark traces shows the responses are normal.
This usually can be remedied by calling HttpTransportSE.getServiceConnection().disconnect() followed by HttpTransportSE.call() again.
Could anyone shed some light on this?
I'm using Magento API to make android app, but I don't know how to parse ArrayOfString in complex_filter.
Such as: I want to filter by category_ids or website_ids in http://devdocs.magento.com/guides/m1x/api/soap/catalog/catalogProduct/catalog_product.list.html. Please help me. Thanks.
Posted on Oct 2, 2014 by Grumpy Lion
This occurs frequently on newer Android due to bug in HTTPTransportSE. Also reported here: http://stackoverflow.com/questions/15411213/android-httpsurlconnection-eofexception
To Fix: Add line
connection.setRequestProperty("Connection", "close");
in HttpTransportSE.java around line 173, i.e. after calling ServiceConnection connection = getServiceConnection() This is in module ksoap2-jse in org.ksoap2.transport
Hi all,
I have just been given the task of adding a retry interceptor to an Android app that uses ksoap2-android and the OkHttp3.
For non-soap requests, I've added an interceptor to the OkHttp client and this has worked well for LTE/low bandwidth connections. However, the interceptor is not even called when the OkHttp client is passed into the ksoap2-android lib (in OkHttp3ServiceConnectionSE, line ~60).
I would love to contribute this functionality to the library but I'm not sure how. @mosabua I'm mentioning you as I hope you might be able point me in the right direction. I'm using both OkHttp3TransportSE and OkHttp3ServiceConnectionSE in my app.
Cheers,
Adam
I think this method have to return String-class. Because written as "AsString".
Is their any solution for Url Redirection issue by Ksoap api.
I am currently using ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar
java.io.IOException: HTTP request failed, HTTP status: 301
01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:195) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:116) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:111) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at com.webkul.mobikul.Connection.SoapConnection.getDataFromServer(SoapConnection.java:115) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at com.webkul.mobikul.Connection.SoapConnection.doInBackground(SoapConnection.java:61) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at com.webkul.mobikul.Connection.SoapConnection.doInBackground(SoapConnection.java:21) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:288) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 01-21 20:11:09.555 32159-32232/com.webkul.mobikul W/System.err: at java.lang.Thread.run(Thread.java:841)
Hello,
Does someone knows a tutorial on hot to do a mutual authentification and a server side ssl,wihtout allowing all the certificates.
Thanks!
Maybe deprecate the j2se one and move all the content from it here.
Hi, I'm using this code to see generated xml in the Log, but I see just empty string there.
httpTransport.debug = true;
httpTransport.call(SOAP_ACTION, envelope);
AppLog.e(httpTransport.requestDump);
AppLog.e(httpTransport.responseDump);
What I'm doing wrong? Why generated xml don't display?
Hi,
I am using v.3.6.0 and I still get
java.io.EOFException
at com.android.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:95) > at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:179)
...
This is my code for sending soap (I am adding ("Connection", "close") header in createHttpHeaders):
HttpTransportSE transport = new HttpTransportSE(url.toString(), TIMEOUT_VALUE));
try {
//transport.getServiceConnection().setRequestProperty("Connection", "close");
transport.call(null, soapEnvelope, createHttpHeaders());
Are there more sollutions to this problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.