我从供应商那里收到了以下WSDL.它背后的示例服务在Microsoft .NET上运行.我需要基于此WSDL在Java中创建Web服务.
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://www.somecompany.com/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://www.somecompany.com/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.somecompany.com/">
<s:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" />
<s:element name="getInventoryStatus">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DealerCode" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="SupplierCode" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="PartNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="Quantity" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="DeliveryLocation" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="getInventoryStatusResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="getInventoryStatusResult">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType> …Run Code Online (Sandbox Code Playgroud) 这似乎应该很简单.©当我将其作为文本输入时,使用转义序列不起作用.XPages引擎保持转义&符号,导致字符串被写为文字.
Spring 3.0.5不推荐使用SimpleJdbcCall.returningResultSet(ParameterizedBeanPropertyRowMapper).如何更改我的代码以使用此方法的非弃用版本?
private JdbcTemplate jdbcTemplate;
private SimpleJdbcCall procGetReportExtras;
public void setDataSource(DataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.setResultsMapCaseInsensitive(true);
this.procGetReportExtras =
new SimpleJdbcCall(jdbcTemplate)
.withCatalogName("package")
.withProcedureName("proc")
.returningResultSet("CURREPORTLIST",
ParameterizedBeanPropertyRowMapper.newInstance(Report.class));
}
Run Code Online (Sandbox Code Playgroud) 我在Java 6中运行HttpClient 4.3.6.当我运行以下代码时,身份验证似乎成功.返回的状态代码是200.但是,我在控制台中收到以下错误消息:
警告:NEGOTIATE身份验证错误:提供的名称无效(机制级别:无法加载配置文件C:\ Windows\krb5.ini(系统找不到指定的文件))
如何消除此警告?
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpContext localContext = new BasicHttpContext();
HttpGet method = new HttpGet(url);
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(
new AuthScope(host, 80),
new NTCredentials(userid, password, host, login_domain));
localContext.setAttribute(HttpClientContext.CREDS_PROVIDER, credsProvider);
String filePath = null;
// Execute the method.
CloseableHttpResponse clientResponse = httpclient.execute(method, localContext);
HttpEntity entity = clientResponse.getEntity();
int statusCode = clientResponse.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + method.getRequestLine());
}
Run Code Online (Sandbox Code Playgroud) 我支持旧的 Java 客户端应用程序,它可以在 Windows XP 上正常运行,但不能在 Windows 7 32 位上运行。问题出在用于启动应用程序的 BAT 文件中。BAT 文件包含的代码用于在注册表中查询 Java 的 CurrentVersion,然后使用该值来确定该 Java 版本在用户计算机上的路径。为了在 Java 客户端应用程序启动时将 rt.jar 包含在 CLASSPATH 中,这是必需的。以下代码在 Windows XP 上运行良好,但在 Windows 7 上返回:
“HKLM\SOFTWARE\JavaSoft\Java 运行时环境”\CurrentVersion 未找到。
:find_java
setlocal ENABLEEXTENSIONS
set KEY_NAME="HKLM\SOFTWARE\JavaSoft\Java Runtime Environment"
set VALUE_NAME=CurrentVersion
::
:: get the current version
::
FOR /F "usebackq skip=4 tokens=3" %%A IN (`REG QUERY "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" /v CurrentVersion 2^>nul`) DO (
set ValueValue=%%A
)
if defined ValueValue (
@echo the current Java runtime is %ValueValue% …Run Code Online (Sandbox Code Playgroud) java ×3
apache ×1
axis ×1
batch-file ×1
httpclient ×1
iis ×1
lotus-notes ×1
ntlm ×1
registry ×1
soap ×1
spring ×1
spring-jdbc ×1
web-services ×1
windows ×1
xpages ×1