- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我从来没有在 java 中使用过任何 SOAP 库,所以对于这个问题的新颖性,我深表歉意。
我正在尝试利用 Tivoli Endpoint Manager 的 SOAP API。我已经使用 wsimport.exe(在 jdk 中提供)从提供的 WSDL 文件生成了必要的类。
现在我获得了大量的类,我认为这些类将信息打包成 xml 格式,但我不确定如何处理它们。我已经阅读了提供的文档,但它充其量是模糊的。
wsimport 生成的类如下:
根据文档,以下 Perl 代码可用于查询 Tivoli 的 API
use SOAP::Lite;
#arguments: [hostname] [username] [password] [relevance expression]
#hostname only, e.g. ’example.com’ rather than ’http://example.com/webreports’
my $host = $ARGV[0];
my $username = SOAP::Data->name(’username’ => $ARGV[1] );
my $password = SOAP::Data->name(’password’ => $ARGV[2] );
my $expr = SOAP::Data->name(’relevanceExpr’ => $ARGV[3] );
my $service = SOAP::Lite -> uri( ’http://’ . $host . ’/webreports?wsdl’ )
-> proxy( $host );
my $result = $service -> GetRelevanceResult( $expr, $username, $password );
if( $result->fault ) {
print "faultcode: " . $result->faultcode . "\n";
print "faultstring: " . $result->faultstring . "\n";
}
else {
foreach my $answer ( $result->valueof( "//GetRelevanceResultResponse/a" ) ) {
print $answer . "\n";
}
}
问题:Java 中等效的 SOAP 客户端库是什么? (我谷歌的那些都那么重 15mb+)
我如何为上面的 Perl 编写等效的 java stub 代码?
编辑 1
这是 stub 代码我认为找到了 WebReportsService.java 类
package connect.tivoli;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.4-b01
* Generated source version: 2.2
*
*/
@WebServiceClient(name = "WebReportsService", targetNamespace = "http://schemas.bigfix.com/Relevance", wsdlLocation = "http://temwebreports/webreports?wsdl")
public class WebReportsService
extends Service
{
private final static URL WEBREPORTSSERVICE_WSDL_LOCATION;
private final static WebServiceException WEBREPORTSSERVICE_EXCEPTION;
private final static QName WEBREPORTSSERVICE_QNAME = new QName("http://schemas.bigfix.com/Relevance", "WebReportsService");
static {
URL url = null;
WebServiceException e = null;
try {
url = new URL("http://temwebreports/webreports?wsdl");
} catch (MalformedURLException ex) {
e = new WebServiceException(ex);
}
WEBREPORTSSERVICE_WSDL_LOCATION = url;
WEBREPORTSSERVICE_EXCEPTION = e;
}
public WebReportsService() {
super(__getWsdlLocation(), WEBREPORTSSERVICE_QNAME);
}
public WebReportsService(WebServiceFeature... features) {
super(__getWsdlLocation(), WEBREPORTSSERVICE_QNAME, features);
}
public WebReportsService(URL wsdlLocation) {
super(wsdlLocation, WEBREPORTSSERVICE_QNAME);
}
public WebReportsService(URL wsdlLocation, WebServiceFeature... features) {
super(wsdlLocation, WEBREPORTSSERVICE_QNAME, features);
}
public WebReportsService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public WebReportsService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns RelevancePortType
*/
@WebEndpoint(name = "RelevancePort")
public RelevancePortType getRelevancePort() {
return super.getPort(new QName("http://schemas.bigfix.com/Relevance", "RelevancePort"), RelevancePortType.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns RelevancePortType
*/
@WebEndpoint(name = "RelevancePort")
public RelevancePortType getRelevancePort(WebServiceFeature... features) {
return super.getPort(new QName("http://schemas.bigfix.com/Relevance", "RelevancePort"), RelevancePortType.class, features);
}
/**
*
* @return
* returns UserManagementPortType
*/
@WebEndpoint(name = "UserManagementPort")
public UserManagementPortType getUserManagementPort() {
return super.getPort(new QName("http://schemas.bigfix.com/Relevance", "UserManagementPort"), UserManagementPortType.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns UserManagementPortType
*/
@WebEndpoint(name = "UserManagementPort")
public UserManagementPortType getUserManagementPort(WebServiceFeature... features) {
return super.getPort(new QName("http://schemas.bigfix.com/Relevance", "UserManagementPort"), UserManagementPortType.class, features);
}
/**
*
* @return
* returns DashboardVariablePortType
*/
@WebEndpoint(name = "DashboardVariablePort")
public DashboardVariablePortType getDashboardVariablePort() {
return super.getPort(new QName("http://schemas.bigfix.com/Relevance", "DashboardVariablePort"), DashboardVariablePortType.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns DashboardVariablePortType
*/
@WebEndpoint(name = "DashboardVariablePort")
public DashboardVariablePortType getDashboardVariablePort(WebServiceFeature... features) {
return super.getPort(new QName("http://schemas.bigfix.com/Relevance", "DashboardVariablePort"), DashboardVariablePortType.class, features);
}
private static URL __getWsdlLocation() {
if (WEBREPORTSSERVICE_EXCEPTION!= null) {
throw WEBREPORTSSERVICE_EXCEPTION;
}
return WEBREPORTSSERVICE_WSDL_LOCATION;
}
}
解决方案:
这比我认为 WSDL 生成完成所有工作要简单得多。以下是您如何使用这些生成的类。
包连接.tivoli;
public class testMain {
public static void main(String[] args) {
String relevanceQuery ="names of bes computers ";
WebReportsService wr = new WebReportsService();
RelevancePortType client;
client = wr.getPort(RelevancePortType.class);
System.out.println(client.getRelevanceResult(relevanceQuery, "ad\\username", "password"));
}
最佳答案
有一个maven插件,cxf-codegen-plugin ,这将从 WSDL 自动生成 java 类。如果您想了解如何使用生成的代码,它还会为您创建 stub 客户端。
编辑 2019-11-15
对于这个例子,我下载了 wsdl 位于 here * 并将其保存为 stockquote.wsdl。
* wsdl 从我最初下载它的地方不再可用。在下面找到此答案中包含的 wsdl。
$树
.
|-- cxf-wsdl2java-example.iml
|-- pom.xml
`-- src
|-- main
| |-- java
| | `-- com
| | `-- stackoverflow
| | `-- App.java
| `-- resources
| `-- stockquote.wsdl
`-- test
`-- java
`-- com
`-- stackoverflow
`-- AppTest.java
10 directories, 5 files
$猫pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.stackoverflow</groupId>
<artifactId>cxf-wsdl2java-example</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>cxf-wsdl2java-example</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.7</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/stockquote.wsdl</wsdl>
<extraargs>
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
$ mvn 生成源
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cxf-wsdl2java-example 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cxf-codegen-plugin:2.7.7:wsdl2java (generate-sources) @ cxf-wsdl2java-example ---
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.462s
[INFO] Finished at: Mon Oct 21 14:44:54 MDT 2013
[INFO] Final Memory: 11M/211M
[INFO] ------------------------------------------------------------------------
$ 树。
.
|-- cxf-wsdl2java-example.iml
|-- pom.xml
|-- src
| |-- main
| | |-- java
| | | `-- com
| | | `-- stackoverflow
| | | `-- App.java
| | `-- resources
| | `-- stockquote.wsdl
| `-- test
| `-- java
| `-- com
| `-- stackoverflow
| `-- AppTest.java
`-- target
|-- classes
|-- cxf-codegen-plugin-markers
`-- generated
`-- cxf
`-- net
`-- webservicex
|-- GetQuote.java
|-- GetQuoteResponse.java
|-- ObjectFactory.java
|-- package-info.java
|-- StockQuoteHttpGetImpl.java
|-- StockQuoteHttpGet.java
|-- StockQuoteHttpPostImpl.java
|-- StockQuoteHttpPost.java
|-- StockQuote.java
|-- StockQuoteSoapImpl1.java
|-- StockQuoteSoapImpl.java
`-- StockQuoteSoap.java
17 directories, 17 files
$ cat target/generated/cxf/net/webservicex/StockQuote.java
package net.webservicex;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;
/**
* This class was generated by Apache CXF 2.7.7
* 2013-10-21T14:44:54.749-06:00
* Generated source version: 2.7.7
*
*/
@WebServiceClient(name = "StockQuote",
wsdlLocation = "file:/home/axiopisty/projects/cxf-wsdl2java-example/src/main/resources/stockquote.wsdl",
targetNamespace = "http://www.webserviceX.NET/")
public class StockQuote extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://www.webserviceX.NET/", "StockQuote");
public final static QName StockQuoteHttpPost = new QName("http://www.webserviceX.NET/", "StockQuoteHttpPost");
public final static QName StockQuoteSoap = new QName("http://www.webserviceX.NET/", "StockQuoteSoap");
public final static QName StockQuoteSoap12 = new QName("http://www.webserviceX.NET/", "StockQuoteSoap12");
public final static QName StockQuoteHttpGet = new QName("http://www.webserviceX.NET/", "StockQuoteHttpGet");
static {
URL url = null;
try {
url = new URL("file:/home/axiopisty/projects/cxf-wsdl2java-example/src/main/resources/stockquote.wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(StockQuote.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "file:/home/axiopisty/projects/cxf-wsdl2java-example/src/main/resources/stockquote.wsdl");
}
WSDL_LOCATION = url;
}
public StockQuote(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public StockQuote(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public StockQuote() {
super(WSDL_LOCATION, SERVICE);
}
//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.
public StockQuote(WebServiceFeature ... features) {
super(WSDL_LOCATION, SERVICE, features);
}
//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.
public StockQuote(URL wsdlLocation, WebServiceFeature ... features) {
super(wsdlLocation, SERVICE, features);
}
//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.
public StockQuote(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns StockQuoteHttpPost
*/
@WebEndpoint(name = "StockQuoteHttpPost")
public StockQuoteHttpPost getStockQuoteHttpPost() {
return super.getPort(StockQuoteHttpPost, StockQuoteHttpPost.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns StockQuoteHttpPost
*/
@WebEndpoint(name = "StockQuoteHttpPost")
public StockQuoteHttpPost getStockQuoteHttpPost(WebServiceFeature... features) {
return super.getPort(StockQuoteHttpPost, StockQuoteHttpPost.class, features);
}
/**
*
* @return
* returns StockQuoteSoap
*/
@WebEndpoint(name = "StockQuoteSoap")
public StockQuoteSoap getStockQuoteSoap() {
return super.getPort(StockQuoteSoap, StockQuoteSoap.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns StockQuoteSoap
*/
@WebEndpoint(name = "StockQuoteSoap")
public StockQuoteSoap getStockQuoteSoap(WebServiceFeature... features) {
return super.getPort(StockQuoteSoap, StockQuoteSoap.class, features);
}
/**
*
* @return
* returns StockQuoteSoap
*/
@WebEndpoint(name = "StockQuoteSoap12")
public StockQuoteSoap getStockQuoteSoap12() {
return super.getPort(StockQuoteSoap12, StockQuoteSoap.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns StockQuoteSoap
*/
@WebEndpoint(name = "StockQuoteSoap12")
public StockQuoteSoap getStockQuoteSoap12(WebServiceFeature... features) {
return super.getPort(StockQuoteSoap12, StockQuoteSoap.class, features);
}
/**
*
* @return
* returns StockQuoteHttpGet
*/
@WebEndpoint(name = "StockQuoteHttpGet")
public StockQuoteHttpGet getStockQuoteHttpGet() {
return super.getPort(StockQuoteHttpGet, StockQuoteHttpGet.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns StockQuoteHttpGet
*/
@WebEndpoint(name = "StockQuoteHttpGet")
public StockQuoteHttpGet getStockQuoteHttpGet(WebServiceFeature... features) {
return super.getPort(StockQuoteHttpGet, StockQuoteHttpGet.class, features);
}
}
编辑 2017 年 9 月 11 日
这是 wsdl 文件的内容,以防服务它的网站消失。
股票报价.wsdl:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions 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.webserviceX.NET/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.webserviceX.NET/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET/">
<s:element name="GetQuote">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="symbol" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetQuoteResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetQuoteResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="string" nillable="true" type="s:string" />
</s:schema>
</wsdl:types>
<wsdl:message name="GetQuoteSoapIn">
<wsdl:part name="parameters" element="tns:GetQuote" />
</wsdl:message>
<wsdl:message name="GetQuoteSoapOut">
<wsdl:part name="parameters" element="tns:GetQuoteResponse" />
</wsdl:message>
<wsdl:message name="GetQuoteHttpGetIn">
<wsdl:part name="symbol" type="s:string" />
</wsdl:message>
<wsdl:message name="GetQuoteHttpGetOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="GetQuoteHttpPostIn">
<wsdl:part name="symbol" type="s:string" />
</wsdl:message>
<wsdl:message name="GetQuoteHttpPostOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:portType name="StockQuoteSoap">
<wsdl:operation name="GetQuote">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get Stock quote for a company Symbol</wsdl:documentation>
<wsdl:input message="tns:GetQuoteSoapIn" />
<wsdl:output message="tns:GetQuoteSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="StockQuoteHttpGet">
<wsdl:operation name="GetQuote">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get Stock quote for a company Symbol</wsdl:documentation>
<wsdl:input message="tns:GetQuoteHttpGetIn" />
<wsdl:output message="tns:GetQuoteHttpGetOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="StockQuoteHttpPost">
<wsdl:operation name="GetQuote">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get Stock quote for a company Symbol</wsdl:documentation>
<wsdl:input message="tns:GetQuoteHttpPostIn" />
<wsdl:output message="tns:GetQuoteHttpPostOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="StockQuoteSoap" type="tns:StockQuoteSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetQuote">
<soap:operation soapAction="http://www.webserviceX.NET/GetQuote" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="StockQuoteSoap12" type="tns:StockQuoteSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetQuote">
<soap12:operation soapAction="http://www.webserviceX.NET/GetQuote" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="StockQuoteHttpGet" type="tns:StockQuoteHttpGet">
<http:binding verb="GET" />
<wsdl:operation name="GetQuote">
<http:operation location="/GetQuote" />
<wsdl:input>
<http:urlEncoded />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="StockQuoteHttpPost" type="tns:StockQuoteHttpPost">
<http:binding verb="POST" />
<wsdl:operation name="GetQuote">
<http:operation location="/GetQuote" />
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded" />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="StockQuote">
<wsdl:port name="StockQuoteSoap" binding="tns:StockQuoteSoap">
<soap:address location="http://www.webservicex.net/stockquote.asmx" />
</wsdl:port>
<wsdl:port name="StockQuoteSoap12" binding="tns:StockQuoteSoap12">
<soap12:address location="http://www.webservicex.net/stockquote.asmx" />
</wsdl:port>
<wsdl:port name="StockQuoteHttpGet" binding="tns:StockQuoteHttpGet">
<http:address location="http://www.webservicex.net/stockquote.asmx" />
</wsdl:port>
<wsdl:port name="StockQuoteHttpPost" binding="tns:StockQuoteHttpPost">
<http:address location="http://www.webservicex.net/stockquote.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
关于java - 在给定 WSDL 文件的情况下在 Java 中创建 SOAP 客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19502158/
前言: 有时候,一个数据库有多个帐号,包括数据库管理员,开发人员,运维支撑人员等,可能有很多帐号都有比较大的权限,例如DDL操作权限(创建,修改,删除存储过程,创建,修改,删除表等),账户多了,管理
所以我用 Create React App 创建并设置了一个大型 React 应用程序。最近我们开始使用 Storybook 来处理和创建组件。它很棒。但是,当我们尝试运行或构建应用程序时,我们不断遇
遵循我正在创建的控件的代码片段。这个控件用在不同的地方,变量也不同。 我正在尝试编写指令来清理代码,但在 {{}} 附近插入值时出现解析错误。 刚接触 Angular ,无法确定我错过了什么。请帮忙。
我正在尝试创建一个 image/jpeg jax-rs 提供程序类,它为我的基于 post rest 的 Web 服务创建一个图像。我无法制定请求来测试以下内容,最简单的测试方法是什么? @POST
我一直在 Windows 10 的模拟器中练习 c。后来我改用dev C++ IDE。当我在 C 中使用 FILE 时。创建的文件的名称为 test.txt ,而我给出了其他名称。请帮助解决它。 下面
当我们创建自定义 View 时,我们将 View 文件的所有者设置为自定义类,并使用 initWithFrame 或 initWithCode 对其进行实例化。 当我们创建 customUITable
我正在尝试为函数 * Producer 创建一个线程,但用于创建线程的行显示错误。我为这句话加了星标,但我无法弄清楚它出了什么问题...... #include #include #include
今天在做项目时,遇到了需要创建JavaScript对象的情况。所以Bing了一篇老外写的关于3种创建JavaScript对象的文章,看后跟着打了一遍代码。感觉方法挺好的,在这里与大家分享一下。 &
我正在阅读将查询字符串传递给 Amazon 的 S3 以进行身份验证的文档,但似乎无法理解 StringToSign 的创建和使用方式。我正在寻找一个具体示例来说明 (1) 如何构造 String
前言:我对 C# 中任务的底层实现不太了解,只了解它们的用法。为我在下面屠宰的任何东西道歉: 对于“我怎样才能开始一项任务但不等待它?”这个问题,我找不到一个好的答案。在 C# 中。更具体地说,即使任
我有一个由一些复杂的表达式生成的 ILookup。假设这是按姓氏查找人。 (在我们简单的世界模型中,姓氏在家庭中是唯一的) ILookup families; 现在我有两个对如何构建感兴趣的查询。 首
我试图创建一个 MSI,其中包含 和 exe。在 WIX 中使用了捆绑选项。这样做时出错。有人可以帮我解决这个问题。下面是代码: 错误 error LGH
在 Yii 中,Create 和 Update 通常使用相同的形式。因此,如果我在创建期间有电子邮件、密码、...other_fields...等字段,但我不想在更新期间专门显示电子邮件和密码字段,但
上周我一直在努力创建一个给定一行和一列的 QModelIndex。 或者,我会满足于在已经存在的 QModelIndex 中更改 row() 的值。 任何帮助,将不胜感激。 编辑: QModelInd
出于某种原因,这不起作用: const char * str_reset_command = "\r\nReset"; const char * str_config_command = "\r\nC
现在,我有以下由 original.df %.% group_by(Category) %.% tally() %.% arrange(desc(n)) 创建的 data.frame。 DF 5),
在今天之前,我使用/etc/vim/vimrc来配置我的vim设置。今天,我想到了创建.vimrc文件。所以,我用 touch .vimrc cat /etc/vim/vimrc > .vimrc 所
我可以创建一个 MKAnnotation,还是只读的?我有坐标,但我发现使用 setCooperative 手动创建 MKAnnotation 并不容易。 想法? 最佳答案 MKAnnotation
在以下代码中,第一个日志语句按预期显示小数,但第二个日志语句记录 NULL。我做错了什么? NSDictionary *entry = [[NSDictionary alloc] initWithOb
我正在使用与此类似的代码动态添加到数组; $arrayF[$f+1][$y][$x+1] = $value+1; 但是我在错误报告中收到了这个: undefined offset :1 问题:尝试创
我是一名优秀的程序员,十分优秀!