package com.ws;
import java.io.FileOutputStream;
import java.io.IOException;
import javax.xml.namespace.QName;
import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
import com.ibatis.sqlmap.client.SqlMapClient;
public class MathServiceImpl {
private SqlMapClient sqlClient;
public void setSqlClient(SqlMapClient sqlClient) {
this.sqlClient = sqlClient;
}
public String uploadFile(byte[] handler) {
FileOutputStream fos = null;
try {
fos = new FileOutputStream("文件名");
fos.write(handler);
fos.flush();
fos.close();
} catch (Exception e) {
e.printStackTrace();
return "文件上传失败";
} finally {
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
}
}
}
return "文件上传成功";
}
public static void main(String[] args) throws AxisFault {
final RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference("http://localhost:8080/PosAxis/services/MathService");
options.setTo(targetEPR);
options.setTimeOutInMilliSeconds(50000);// 不设则默认为30秒
QName opAddEntry = new QName("http://ws.com", "add");// targetNamespace必须匹配
Object[] opAddEntryArgs = new Object[] { 1, 9 };// 参数
// serviceClient.invokeRobust(opAddEntry, opAddEntryArgs);
serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
WebServiceTest.rar (91个子文件)
WebServiceTest
src
com
ws
MathServiceImpl.java 2KB
configure
ibatis
SqlMapConfig.xml 708B
vssver.scc 64B
WebServiceSqlMap.xml 193B
dbresource
vssver.scc 48B
proxool.properties 553B
.project 1KB
WebRoot
META-INF
MANIFEST.MF 39B
WEB-INF
web.xml 2KB
classes
com
ws
MathServiceImpl.class 2KB
configure
ibatis
SqlMapConfig.xml 708B
vssver.scc 64B
WebServiceSqlMap.xml 193B
dbresource
vssver.scc 48B
proxool.properties 553B
lib
geronimo-annotation_1.0_spec-1.1.jar 12KB
axis2-java2wsdl-1.6.1.jar 27KB
xalan-2.7.0.jar 2.6MB
woden-impl-dom-1.0M9.jar 48KB
commons-codec-1.3.jar 46KB
axis2-transport-http-1.6.1.jar 149KB
neethi-3.0.1.jar 69KB
geronimo-jaxws_2.2_spec-1.0.jar 59KB
axis2-xmlbeans-1.6.1.jar 27KB
commons-fileupload-1.2.jar 52KB
jaxb-api-2.1.jar 88KB
proxool-0.9.0RC3.jar 430KB
axis2-jaxws-1.6.1.jar 727KB
bcel-5.1.jar 504KB
antlr-2.7.7.jar 435KB
log4j-1.2.9.jar 344KB
geronimo-ws-metadata_2.0_spec-1.1.2.jar 14KB
jaxb-xjc-2.1.7.jar 2.98MB
mail-1.4.jar 380KB
axis2-codegen-1.6.1.jar 248KB
XmlSchema-1.4.7.jar 145KB
woden-api-1.0M9.jar 147KB
commons-httpclient-3.1.jar 298KB
postgresql-8.1-409.jdbc3.jar 396KB
geronimo-stax-api_1.0_spec-1.0.1.jar 28KB
axis2-saaj-1.6.1.jar 88KB
juli-6.0.16.jar 19KB
woden-impl-commons-1.0M9.jar 182KB
commons-logging-1.1.1.jar 59KB
activation-1.1.jar 62KB
jsr311-api-1.0.jar 43KB
jaxws-tools-2.1.3.jar 497KB
mex-1.6.1-impl.jar 32KB
axis2-fastinfoset-1.6.1.jar 16KB
ibatis-sqlmap-2.jar 275KB
ibatis-dao-2.jar 59KB
jaxb-impl-2.1.7.jar 835KB
axis2-adb-1.6.1.jar 672KB
xml-resolver-1.2.jar 82KB
axiom-dom-1.2.12.jar 156KB
axis2-transport-local-1.6.1.jar 16KB
axis2-adb-codegen-1.6.1.jar 176KB
httpcore-4.0.jar 169KB
wstx-asl-3.2.9.jar 512KB
jaxen-1.1.1.jar 222KB
axis2-kernel-1.6.1.jar 1016KB
axiom-impl-1.2.12.jar 120KB
jibx-run-1.2.jar 126KB
regexp-1.2.jar 29KB
jettison-1.0-RC2.jar 53KB
axis2-soapmonitor-servlet-1.6.1.jar 33KB
axis2-clustering-1.6.1.jar 95KB
axis2-mtompolicy-1.6.1.jar 14KB
xmlbeans-2.3.0.jar 2.54MB
axiom-api-1.2.12.jar 420KB
axis2-jaxbri-1.6.1.jar 28KB
tribes-6.0.16.jar 223KB
geronimo-saaj_1.3_spec-1.0.1.jar 29KB
axis2-spring-1.6.1.jar 11KB
commons-cli-1.2.jar 40KB
axis2-json-1.6.1.jar 19KB
ibatis-common-2.jar 83KB
geronimo-jta_1.1_spec-1.1.jar 15KB
wsdl4j-1.6.2.jar 145KB
axis2-corba-1.6.1.jar 144KB
axis2-jibx-1.6.1.jar 35KB
axis2-metadata-1.6.1.jar 422KB
commons-io-1.4.jar 106KB
spring2.5.jar 2.71MB
jibx-bind-1.2.jar 398KB
services
services.list 18B
test
META-INF
services.xml 898B
version-1.6.1.aar 8KB
applicationContext.xml 3KB
.mymetadata 315B
.classpath 6KB
.myeclipse
共 91 条
- 1
-烦-
- 粉丝: 0
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页