[英]Error: java.lang.IllegalArgumentException: Request must not be null
I am using B4A for calling ASMX service also used httputils2 library. 我正在使用B4A来调用ASMX服务,也使用了httputils2库。
I use the following code for calling service: 我使用以下代码调用服务:
Private httprequest As HttpJop
httprequest.Initialize("Job1", Me)
httprequest.PostString("http://192.168.1.104/service.asmx/query","mysql="&"insert into users (facebook_id) values ('ersdxc')")
When I run my application, I get this error: 运行应用程序时,出现以下错误:
java.lang.IllegalArgumentException: Request must not be null.
java.lang.IllegalArgumentException:请求不能为null。
How can I fix it? 我该如何解决?
You will have to : 你不得不 :
Private httprequest As HttpJop
httprequest.Initialize("Job1", Me)
httprequest.PostString("http://192.168.1.104/service.asmx/query", stringliteral)
httprequest.GetRequest.SetContentType("text/xml; charset=utf-8")
httprequest.GetRequest.SetHeader("SOAPAction", """REPLACE_WITH_YOUR_SOAP_ACTION_HERE""")
Please also note that the HttpUtils2 is deprecated and you will have to use the OkHttp and OkHttpUtils2 libraries. 另请注意,不推荐使用HttpUtils2,您将必须使用OkHttp和OkHttpUtils2库。 There is no difference in the code when using these two libraries.
使用这两个库时,代码没有区别。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.