在调用SOAP Web服务时获取URISyntaxException

时间:2017-02-03 07:35:20

标签: java cxf soap-client

我正在使用SOAP Web服务。调用服务时,我得到了这个例外:

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

我试过了:

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

我收到了这个错误:

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)

1 个答案:

答案 0 :(得分:0)

确保您的网址值已经完成,这意味着它应该包含一个协议,一个主机,一个端口(主机和端口是基于协议的可选项,但对于http和https它们是必需的),其余的网址< / p>