gpt4 book ai didi

java - 由于异常 : XML reader error: WstxUnexpectedCharException: Unexpected character '[' ,JAX-WS 错误无法创建 SOAP 消息

转载 作者:搜寻专家 更新时间:2023-11-01 03:43:33 27 4
gpt4 key购买 nike

它显示以下错误,我不知道为什么,有人可以帮助我吗?

错误是:

Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '[' (code 91) in prolog; expected '<' at [row,col {unknown-source}]: [1,1]

我调用的函数是:

private static ContractTermsDownloadReply contractTermsDownloadOperation(
ContractTermsDownloadRequest body) {
ContractTermsDownload service = null;
try {
URI uri = new URI("https://companyname.com/ContractTermsDownload");
service = new ContractTermsDownload(uri.toURL());
} catch (Exception ex) {
Logger.getLogger(JavaApplication1.class.getName()).log(
Level.SEVERE, null, ex);
}

ariba.sourcing.vrealm_1461.ContractTermsDownloadPortType port = service
.getContractTermsDownloadPortType();
BindingProvider prov = (BindingProvider) port;
prov.getRequestContext().put("authorization",
"Basic User2011:Password2011");

try {
ContractTermsDownloadReply reply = port
.contractTermsDownloadOperation(body);
return reply;
} catch (Exception exc) {
System.out.println(exc.getMessage());
}
return null;
}

最佳答案

如果您使用的是 BasicAuth,则凭据通常采用 Base64 编码。请关注这一行,包括语法:

prov.getRequestContext().put("authorization", "Basic User2011:Password2011");

关于java - 由于异常 : XML reader error: WstxUnexpectedCharException: Unexpected character '[' ,JAX-WS 错误无法创建 SOAP 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8674179/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com