简体   繁体   English

调用SOAP Web服务时获取URISyntaxException

[英]Getting URISyntaxException in while calling SOAP web service

I'm consuming a SOAP web service. 我正在使用SOAP Web服务。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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