简体   繁体   中英

Getting URISyntaxException in while calling SOAP web service

I'm consuming a SOAP web service. When the service is called, I get this exception:

java.io.IOException: java.net.URISyntaxException: Illegal character in path at index 66:

I tried:

encodedUrl = URLEncoder.encode(encodedUrl, "UTF-8");

and I got this error:

java.lang.IllegalArgumentException: URI is not absolute
    at java.net.URI.toURL(URI.java:1088) [rt.jar:1.8.0_91]
    at org.apache.cxf.transport.http.URLConnectionHTTPConduit.createConnection(URLConnectionHTTPConduit.java:92)
    at org.apache.cxf.transport.http.URLConnectionHTTPConduit.setupConnection(URLConnectionHTTPConduit.java:103)
    at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:478)
    at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)

确保您的URL值完整,这意味着它应该包含一个协议,一个主机,一个端口(主机和端口根据协议是可选的,但对于http和https是必填的),以及其余的url

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM