一、首先,CXF的WS实现类由于实现了和Spring的无缝集成,因此可以采用Spring的单元测试来测试基本功能。

代码如下:

package com.defshare.sy.test.biz;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.UUID;
import javax.annotation.Resource;
import org.apache.commons.io.IOUtils;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.junit.Test;
import com.defshare.sy.ws.ISYWebService;
import com.defshare.sy.ws.po.Clinique;
import com.defshare.sy.ws.po.WorkList;
import com.defshare.sy.ws.po.WorkListPicFile;
public class SyWebServiceTest extends SpringTestTemplate{
@Test
public void testUploadWorkListPicFile(){
//JaxWsProxyFactoryBean proxy = new JaxWsProxyFactoryBean();
//proxy.setAddress("http://localhost:8090/sy/services/SYWebService");
//proxy.setServiceClass(ISYWebService.class);
//ISYWebService clientProxy = (ISYWebService)proxy.create();
//clientProxy.upLoadWorkListPic("", "",null);
WorkListPicFile file = new WorkListPicFile();
String serverFile = UUID.randomUUID().toString()+".DBF";
InputStream is = null;
try {
is = new FileInputStream("d:/QUESCTION.DBF");
file.setFileSize(is.available());
byte[] bytes = new byte[1024 * 1024];
int size=0;
do{
size = is.read(bytes);
if (size <= 0) {
break;
}
byte[] fixedBytes = Arrays.copyOfRange(bytes, 0, size);
file.setBytes(fixedBytes);
file.setServerFile(serverFile);
file.setWorkListId("WL0001");
int resp = syWebService.upLoadWorkListPic("WS访问账户","WS访问密码", file);
System.out.println(resp==0?"本次上传文件块成功":"本次上传文件块异常");
if (resp!=0)
break;
file.setPosition(file.getPosition() + fixedBytes.length);
}while(size>0);
} catch(IOException e) {
e.printStackTrace();
} finally {
if (is!=null)
try {
is.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
IOUtils.closeQuietly(is);
}
}
@Test
public void testremoveWorkList(){
正常输入数据1                 期望结果:成功          实际结果:
syWebService.removeWorkList("WS访问账户", "WS访问密码", "q");
}
@Test
public void testUpdateWorkList(){
WorkList wl = new WorkList();
wl.setGdbh("WL0001");
wl.setFggdbh("hehe-------");
syWebService.updateWorkList("WS访问账户", "WS访问密码", wl);
}
@Test
public void updateClinique(){
Clinique c = new Clinique();
c.setZsid("CL0001");
c.setDq("金牛区-------");
System.out.println("*******"+syWebService.updateClinique("WS访问账户", "WS访问密码", c));
}
@Resource(name="syWebService")
private ISYWebService syWebService;
@Resource(name="syWebService")
public void setSyWebService(ISYWebService syWebService) {
this.syWebService = syWebService;
}
}

二、待单元测试通过后在进行WebService调用测试,这需要发布这个WebService到服务器上:

我的这个WS发布后的WSDL如下:

http://192.168.1.89:92/services/SYWebService?wsdl

  <?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions name="SYWebService" targetNamespace="http://www.springframework.org/schema/beans" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.springframework.org/schema/beans" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.springframework.org/schema/beans" xmlns:tns="http://www.springframework.org/schema/beans" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:complexType name="WorkListPicFile">
- <xs:sequence>
<xs:element minOccurs="0" name="workListId" type="xs:string" />
<xs:element minOccurs="0" name="serverFile" type="xs:string" />
<xs:element name="position" type="xs:long" />
<xs:element name="fileSize" type="xs:long" />
<xs:element minOccurs="0" name="bytes" type="xs:base64Binary" />
</xs:sequence>
</xs:complexType>
- <xs:complexType name="WorkList">
- <xs:sequence>
<xs:element minOccurs="0" name="gdbh" type="xs:string" />
<xs:element minOccurs="0" name="fggdbh" type="xs:string" />
<xs:element minOccurs="0" name="zsid" type="xs:string" />
<xs:element minOccurs="0" name="ysxm" type="xs:string" />
<xs:element minOccurs="0" name="brxm" type="xs:string" />
<xs:element minOccurs="0" name="ywy" type="xs:string" />
<xs:element minOccurs="0" name="ssdq" type="xs:string" />
<xs:element minOccurs="0" name="fgyy" type="xs:string" />
<xs:element minOccurs="0" name="jjrq" type="xs:string" />
<xs:element minOccurs="0" name="cjrq" type="xs:string" />
<xs:element minOccurs="0" name="jzrq" type="xs:string" />
<xs:element minOccurs="0" name="xgrq" type="xs:string" />
<xs:element minOccurs="0" name="xgcs" type="xs:string" />
<xs:element minOccurs="0" name="luz" type="xs:string" />
<xs:element minOccurs="0" name="cjr" type="xs:string" />
<xs:element minOccurs="0" name="pics" type="xs:string" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="toothSpecs" nillable="true" type="tns:ToothSpec" />
</xs:sequence>
</xs:complexType>
- <xs:complexType name="ToothSpec">
- <xs:sequence>
<xs:element minOccurs="0" name="toothSpecId" type="xs:string" />
<xs:element minOccurs="0" name="gdbh" type="xs:string" />
<xs:element minOccurs="0" name="yclx" type="xs:string" />
<xs:element minOccurs="0" name="zl" type="xs:string" />
<xs:element minOccurs="0" name="ys" type="xs:string" />
<xs:element minOccurs="0" name="yw" type="xs:string" />
<xs:element minOccurs="0" name="dx" type="xs:string" />
<xs:element minOccurs="0" name="sl" type="xs:int" />
<xs:element minOccurs="0" name="addsl" type="xs:int" />
<xs:element minOccurs="0" name="jg" type="xs:int" />
<xs:element minOccurs="0" name="hbhid" type="xs:string" />
<xs:element minOccurs="0" name="gx" type="xs:string" />
</xs:sequence>
</xs:complexType>
- <xs:complexType name="Clinique">
- <xs:sequence>
<xs:element minOccurs="0" name="zsid" type="xs:string" />
<xs:element minOccurs="0" name="zsmm" type="xs:string" />
<xs:element minOccurs="0" name="dxts" type="xs:int" />
<xs:element minOccurs="0" name="zsmc" type="xs:string" />
<xs:element minOccurs="0" name="ysxm" type="xs:string" />
<xs:element minOccurs="0" name="lxdh" type="xs:string" />
<xs:element minOccurs="0" name="zsjx" type="xs:string" />
<xs:element minOccurs="0" name="zsdz" type="xs:string" />
<xs:element minOccurs="0" name="dq" type="xs:string" />
<xs:element minOccurs="0" name="dqbh" type="xs:string" />
<xs:element minOccurs="0" name="ywy" type="xs:string" />
<xs:element minOccurs="0" name="ywjl" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="removeWorkList" type="tns:removeWorkList" />
- <xs:complexType name="removeWorkList">
- <xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element minOccurs="0" name="arg2" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="removeWorkListResponse" type="tns:removeWorkListResponse" />
- <xs:complexType name="removeWorkListResponse">
- <xs:sequence>
<xs:element name="return" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="upLoadWorkListPic" type="tns:upLoadWorkListPic" />
- <xs:complexType name="upLoadWorkListPic">
- <xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element minOccurs="0" name="arg2" type="tns:WorkListPicFile" />
</xs:sequence>
</xs:complexType>
<xs:element name="upLoadWorkListPicResponse" type="tns:upLoadWorkListPicResponse" />
- <xs:complexType name="upLoadWorkListPicResponse">
- <xs:sequence>
<xs:element name="return" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="updateWorkList" type="tns:updateWorkList" />
- <xs:complexType name="updateWorkList">
- <xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element minOccurs="0" name="arg2" type="tns:WorkList" />
</xs:sequence>
</xs:complexType>
<xs:element name="updateWorkListResponse" type="tns:updateWorkListResponse" />
- <xs:complexType name="updateWorkListResponse">
- <xs:sequence>
<xs:element name="return" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="updateToothSpecGX" type="tns:updateToothSpecGX" />
- <xs:complexType name="updateToothSpecGX">
- <xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="updateToothSpecGXResponse" type="tns:updateToothSpecGXResponse" />
- <xs:complexType name="updateToothSpecGXResponse">
- <xs:sequence>
<xs:element name="return" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="upLoadWorkList" type="tns:upLoadWorkList" />
- <xs:complexType name="upLoadWorkList">
- <xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="arg2" type="tns:WorkList" />
</xs:sequence>
</xs:complexType>
<xs:element name="upLoadWorkListResponse" type="tns:upLoadWorkListResponse" />
- <xs:complexType name="upLoadWorkListResponse">
- <xs:sequence>
<xs:element name="return" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="updateClinique" type="tns:updateClinique" />
- <xs:complexType name="updateClinique">
- <xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element minOccurs="0" name="arg2" type="tns:Clinique" />
</xs:sequence>
</xs:complexType>
<xs:element name="updateCliniqueResponse" type="tns:updateCliniqueResponse" />
- <xs:complexType name="updateCliniqueResponse">
- <xs:sequence>
<xs:element name="return" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="upLoadClinique" type="tns:upLoadClinique" />
- <xs:complexType name="upLoadClinique">
- <xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string" />
<xs:element minOccurs="0" name="arg1" type="xs:string" />
<xs:element maxOccurs="unbounded" minOccurs="0" name="arg2" type="tns:Clinique" />
</xs:sequence>
</xs:complexType>
<xs:element name="upLoadCliniqueResponse" type="tns:upLoadCliniqueResponse" />
- <xs:complexType name="upLoadCliniqueResponse">
- <xs:sequence>
<xs:element name="return" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
- <wsdl:message name="upLoadWorkListPicResponse">
<wsdl:part element="tns:upLoadWorkListPicResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="updateClinique">
<wsdl:part element="tns:updateClinique" name="parameters" />
</wsdl:message>
- <wsdl:message name="upLoadWorkList">
<wsdl:part element="tns:upLoadWorkList" name="parameters" />
</wsdl:message>
- <wsdl:message name="upLoadCliniqueResponse">
<wsdl:part element="tns:upLoadCliniqueResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="updateWorkListResponse">
<wsdl:part element="tns:updateWorkListResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="updateWorkList">
<wsdl:part element="tns:updateWorkList" name="parameters" />
</wsdl:message>
- <wsdl:message name="removeWorkListResponse">
<wsdl:part element="tns:removeWorkListResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="upLoadClinique">
<wsdl:part element="tns:upLoadClinique" name="parameters" />
</wsdl:message>
- <wsdl:message name="upLoadWorkListResponse">
<wsdl:part element="tns:upLoadWorkListResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="upLoadWorkListPic">
<wsdl:part element="tns:upLoadWorkListPic" name="parameters" />
</wsdl:message>
- <wsdl:message name="updateToothSpecGX">
<wsdl:part element="tns:updateToothSpecGX" name="parameters" />
</wsdl:message>
- <wsdl:message name="updateToothSpecGXResponse">
<wsdl:part element="tns:updateToothSpecGXResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="removeWorkList">
<wsdl:part element="tns:removeWorkList" name="parameters" />
</wsdl:message>
- <wsdl:message name="updateCliniqueResponse">
<wsdl:part element="tns:updateCliniqueResponse" name="parameters" />
</wsdl:message>
- <wsdl:portType name="ISYWebService">
- <wsdl:operation name="removeWorkList">
<wsdl:input message="tns:removeWorkList" name="removeWorkList" />
<wsdl:output message="tns:removeWorkListResponse" name="removeWorkListResponse" />
</wsdl:operation>
- <wsdl:operation name="upLoadWorkListPic">
<wsdl:input message="tns:upLoadWorkListPic" name="upLoadWorkListPic" />
<wsdl:output message="tns:upLoadWorkListPicResponse" name="upLoadWorkListPicResponse" />
</wsdl:operation>
- <wsdl:operation name="updateWorkList">
<wsdl:input message="tns:updateWorkList" name="updateWorkList" />
<wsdl:output message="tns:updateWorkListResponse" name="updateWorkListResponse" />
</wsdl:operation>
- <wsdl:operation name="updateToothSpecGX">
<wsdl:input message="tns:updateToothSpecGX" name="updateToothSpecGX" />
<wsdl:output message="tns:updateToothSpecGXResponse" name="updateToothSpecGXResponse" />
</wsdl:operation>
- <wsdl:operation name="upLoadWorkList">
<wsdl:input message="tns:upLoadWorkList" name="upLoadWorkList" />
<wsdl:output message="tns:upLoadWorkListResponse" name="upLoadWorkListResponse" />
</wsdl:operation>
- <wsdl:operation name="updateClinique">
<wsdl:input message="tns:updateClinique" name="updateClinique" />
<wsdl:output message="tns:updateCliniqueResponse" name="updateCliniqueResponse" />
</wsdl:operation>
- <wsdl:operation name="upLoadClinique">
<wsdl:input message="tns:upLoadClinique" name="upLoadClinique" />
<wsdl:output message="tns:upLoadCliniqueResponse" name="upLoadCliniqueResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="SYWebServiceSoapBinding" type="tns:ISYWebService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="removeWorkList">
<soap:operation soapAction="" style="document" />
- <wsdl:input name="removeWorkList">
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output name="removeWorkListResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="upLoadWorkListPic">
<soap:operation soapAction="" style="document" />
- <wsdl:input name="upLoadWorkListPic">
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output name="upLoadWorkListPicResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="updateWorkList">
<soap:operation soapAction="" style="document" />
- <wsdl:input name="updateWorkList">
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output name="updateWorkListResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="upLoadWorkList">
<soap:operation soapAction="" style="document" />
- <wsdl:input name="upLoadWorkList">
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output name="upLoadWorkListResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="updateToothSpecGX">
<soap:operation soapAction="" style="document" />
- <wsdl:input name="updateToothSpecGX">
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output name="updateToothSpecGXResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="updateClinique">
<soap:operation soapAction="" style="document" />
- <wsdl:input name="updateClinique">
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output name="updateCliniqueResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="upLoadClinique">
<soap:operation soapAction="" style="document" />
- <wsdl:input name="upLoadClinique">
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output name="upLoadCliniqueResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="SYWebService">
- <wsdl:port binding="tns:SYWebServiceSoapBinding" name="SYWebService">
<soap:address location="http://192.168.1.89:92/services/SYWebService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Java的测试客户端如下:

package com.defshare.sy.test.ws;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.UUID;
import org.apache.commons.io.IOUtils;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.junit.Test;
import com.defshare.sy.po.ToothSpec;
import com.defshare.sy.ws.ISYWebService;
import com.defshare.sy.ws.po.Clinique;
import com.defshare.sy.ws.po.WorkList;
import com.defshare.sy.ws.po.WorkListPicFile;
public class syWebServiceClientTest {
/**
* 图片上传测试
*/
@Test
public void testUpLoadWorkListPic() {
JaxWsProxyFactoryBean proxy = new JaxWsProxyFactoryBean();
proxy.setAddress("http://localhost:8090/sy/services/SYWebService");
proxy.setServiceClass(ISYWebService.class);
ISYWebService clientProxy = (ISYWebService)proxy.create();
WorkListPicFile file = new WorkListPicFile();
String serverFile = UUID.randomUUID().toString()+".rar";
InputStream is = null;
try {
is = new FileInputStream("d:/webtemp.rar");
file.setFileSize(is.available());
file.setServerFile(serverFile);
byte[] bytes = new byte[1024 * 1024];
int size=0;
do{
size = is.read(bytes);
if (size <= 0) {
break;
}
byte[] fixedBytes = Arrays.copyOfRange(bytes, 0, size);
file.setBytes(fixedBytes);
file.setWorkListId("WL0001");
int resp = clientProxy.upLoadWorkListPic("WS访问账户","WS访问密码", file);
System.out.println(resp==0?"本次上传文件块成功"+fixedBytes.length+"字节,已上传"+(file.getPosition()+fixedBytes.length)+"/"+file.getFileSize()+"字节":"本次上传文件块异常");
if (resp!=0)
break;
file.setPosition(file.getPosition() + fixedBytes.length);
}while(size>0);
} catch(IOException e) {
e.printStackTrace();
} finally {
if (is!=null)
try {
is.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
IOUtils.closeQuietly(is);
}
}
@Test
public void testremoveWorkList(){
JaxWsProxyFactoryBean proxy = new JaxWsProxyFactoryBean();
proxy.setAddress("http://localhost:8080/sy/services/SYWebService");
proxy.setServiceClass(ISYWebService.class);
ISYWebService clientProxy = (ISYWebService)proxy.create();
clientProxy.removeWorkList("WS访问账户", "WS访问密码", "sdfghj");
}
@Test
public void testUpdateWorkList(){
JaxWsProxyFactoryBean proxy = new JaxWsProxyFactoryBean();
proxy.setAddress("http://localhost:8080/sy/services/SYWebService");
proxy.setServiceClass(ISYWebService.class);
ISYWebService clientProxy = (ISYWebService)proxy.create();
WorkList ws = new WorkList();
com.defshare.sy.ws.po.ToothSpec[] tt=new com.defshare.sy.ws.po.ToothSpec[2];
com.defshare.sy.ws.po.ToothSpec t=new com.defshare.sy.ws.po.ToothSpec();
ws.setGdbh("WL0001");
ws.setZsid("CL0001");
ws.setYsxm("王医生");
ws.setBrxm("张发亏");
// ws.setJjrq("2012-09-12");
t.setToothSpecId("sx001");
t.setGdbh("WL0005");
t.setYclx("进口烤瓷牙1111");
t.setYw("A1-B6");
t.setYs("A2");
t.setSl(2);
t.setAddsl(0);
t.setDx("大");
t.setZl("smsm");
t.setGx("接单中·····");
tt[0]=t;
com.defshare.sy.ws.po.ToothSpec ts=new com.defshare.sy.ws.po.ToothSpec();
ts.setGdbh("WL0001");
ts.setToothSpecId("sx002");
ts.setYclx("进口烤瓷牙22222");
ts.setYw("A1-B6");
ts.setYs("A2");
ts.setSl(2);
ts.setAddsl(0);
ts.setDx("大");
tt[1]=ts;
ws.setToothSpecs(tt);
System.out.println(clientProxy.updateWorkList("WS访问账户", "WS访问密码", ws));
}
@Test
public void upLoadClinique(){
JaxWsProxyFactoryBean proxy = new JaxWsProxyFactoryBean();
proxy.setAddress("http://localhost:8090/sy/services/SYWebService");
proxy.setServiceClass(ISYWebService.class);
ISYWebService clientProxy = (ISYWebService)proxy.create();
Clinique[] cliniques  = new Clinique[3];
cliniques[0] = new Clinique();
cliniques[0].setZsid("ZS004");
cliniques[0].setDq("成都区");
cliniques[0].setDqbh("1");
cliniques[0].setDxts(10);
cliniques[0].setLxdh("13699451030");
cliniques[0].setYsxm("蒋医生");
cliniques[0].setYwjl("黄经理");
cliniques[0].setYwy("小明");
cliniques[0].setZsdz("成都金牛区");
cliniques[0].setZsjx("asdf");
cliniques[0].setZsmc("中西医院");
cliniques[0].setZsmm("123456");
cliniques[1] = new Clinique();
cliniques[1].setZsid("ZS005");
cliniques[1].setDq("绵阳区");
cliniques[1].setDqbh("2");
cliniques[1].setDxts(15);
cliniques[1].setLxdh("15015157972");
cliniques[1].setYsxm("董医生");
cliniques[1].setYwjl("胡经理");
cliniques[1].setYwy("小强");
cliniques[1].setZsdz("成都金牛区");
cliniques[1].setZsjx("asdf");
cliniques[1].setZsmc("中西医院");
cliniques[1].setZsmm("123456");
cliniques[2] = new Clinique();
cliniques[2].setZsid("ZS006");
cliniques[2].setDq("湖北区");
cliniques[2].setDqbh("3");
cliniques[2].setDxts(10);
cliniques[2].setLxdh("13699451030");
cliniques[2].setYsxm("顾医生");
cliniques[2].setYwjl("赵经理");
cliniques[2].setYwy("小黄");
cliniques[2].setZsdz("成都金牛区");
cliniques[2].setZsjx("asdf");
cliniques[2].setZsmc("中西医院");
cliniques[2].setZsmm("123456");
clientProxy.upLoadClinique("WS访问账户", "WS访问密码", cliniques);
}
@Test
public void upLoadWorkList(){
JaxWsProxyFactoryBean proxy = new JaxWsProxyFactoryBean();
proxy.setAddress("http://localhost:8080/sy/services/SYWebService");
proxy.setServiceClass(ISYWebService.class);
ISYWebService clientProxy = (ISYWebService)proxy.create();
WorkList[] workList  = new WorkList[2];
workList[0] = new WorkList();
workList[0].setBrxm("小强哥");
workList[0].setCjr("某某");
workList[0].setCjrq("2012-12-12 13:10:00");
workList[0].setFggdbh("001");
workList[0].setFgyy("工单打回");
workList[0].setGdbh("w9527");
workList[0].setJjrq("2012-12-12 13:10:00");
workList[0].setJzrq("2012-12-12 13:10:00");
workList[0].setLuz("张山");
workList[0].setPics("asdfsadf.jsp");
workList[0].setSsdq("成都");
workList[0].setXgcs("1");
workList[0].setXgrq("2012-12-12 13:10:00");
workList[0].setYsxm("蒋医生");
workList[0].setYwy("李四");
workList[0].setZsid("ZS003");
workList[1] = new WorkList();
workList[1].setBrxm("王哥");
workList[1].setCjr("某某");
workList[1].setCjrq("2012-12-12 13:10:00");
workList[1].setFggdbh("002");
workList[1].setFgyy("工单打回");
workList[1].setGdbh("w9528");
workList[1].setJjrq("2012-12-12 13:10:00");
workList[1].setJzrq("2012-12-12 13:10:00");
workList[1].setLuz("张山");
workList[1].setPics("asdfsadf.jsp");
workList[1].setSsdq("成都");
workList[1].setXgcs("2");
workList[1].setXgrq("2012-12-12 13:10:00");
workList[1].setYsxm("蒋医生");
workList[1].setYwy("李四");
workList[1].setZsid("ZS003");
com.defshare.sy.ws.po.ToothSpec[] tt=new com.defshare.sy.ws.po.ToothSpec[2];
com.defshare.sy.ws.po.ToothSpec t=new com.defshare.sy.ws.po.ToothSpec();
// ws.setJjrq("2012-09-12");
t.setGdbh("WL0005");
t.setYclx("进口烤瓷牙");
t.setYw("A1-B6");
t.setYs("A2");
t.setSl(2);
t.setAddsl(0);
t.setDx("大");
tt[0]=t;
com.defshare.sy.ws.po.ToothSpec ts=new com.defshare.sy.ws.po.ToothSpec();
ts.setGdbh("WL0001");
ts.setYclx("进口烤瓷牙");
ts.setYw("A1-B6");
ts.setYs("A2");
ts.setSl(2);
ts.setAddsl(0);
ts.setDx("大");
tt[1]=ts;
workList[1].setToothSpecs(tt);
int result = clientProxy.upLoadWorkList("WS访问账户", "WS访问密码", workList);
System.out.println(result);
}
@Test
public void updateToothSpecGX(){
JaxWsProxyFactoryBean proxy = new JaxWsProxyFactoryBean();
proxy.setAddress("http://localhost:8080/sy/services/SYWebService");
proxy.setServiceClass(ISYWebService.class);
ISYWebService clientProxy = (ISYWebService)proxy.create();
int result = clientProxy.updateToothSpecGX("sx001", "11111");
System.out.println(result);
}
}

三、.NET测试客户端如下:

实现代码如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SYWSClient.ServiceRef;
using System.IO;
namespace SYWSClient
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
/**
* 上传诊所
**/
private void btnsyloadzs_Click(object sender, EventArgs e)
{
Clinique clinique = new Clinique();
if (this.txtzsid.Text == "")
{
MessageBox.Show("诊所编号不能为空.....");
return;
}
if (this.txtzsmc.Text == "")
{
MessageBox.Show("诊所名称不能为空.....");
return;
}
if (this.txtzsmm.Text == "")
{
MessageBox.Show("诊所密码不能为空.....");
return;
}
if (this.txtysmc.Text == "")
{
MessageBox.Show("诊所医生不能为空.....");
return;
}
//封装诊所的信息
clinique.zsid = this.txtzsid.Text;
clinique.zsmm = this.txtzsmm.Text;
clinique.zsmc = this.txtzsmc.Text;
clinique.ysxm = this.txtysmc.Text;
clinique.lxdh = this.txtlxdh.Text;
clinique.zsjx = this.txtzsjx.Text;
clinique.zsdz = this.txtzsdz.Text;
clinique.dq = this.txtzsdq.Text;
clinique.dqbh = this.txtdqbh.Text;
clinique.ywy = this.txtywy.Text;
clinique.ywjl = this.txtywjl.Text;
//实例webserverce客户端
SYWebServiceClient client = new SYWebServiceClient();
int flag = client.upLoadClinique("WS访问访问账户", "WS访问密码", new Clinique[] { clinique });
switch (flag)
{
case 0:
MessageBox.Show("上传诊所信息成功!");
break;
case 1:
MessageBox.Show("工单编号为空");
break;
case 2:
MessageBox.Show("诊所编号为空");
break;
case 3:
MessageBox.Show("没有文件信息上传");
break;
case 4:
MessageBox.Show("没有工单信息可以上传");
break;
case 5:
MessageBox.Show("没有工单图片文件可以上传");
break;
case 6:
MessageBox.Show("没有诊所信息可以上传");
break;
case 7:
MessageBox.Show("没有诊所信息可以上传");
break;
case 8:
MessageBox.Show("没有诊所信息可以更新");
break;
case 9:
MessageBox.Show("不安全的调用");
break;
case 10:
MessageBox.Show("不存在的工单[上传工单图片时检查]");
break;
case 11:
MessageBox.Show("输入输出异常");
break;
case 12:
MessageBox.Show("录入数据失败[存在重复数据]");
break;
case 13:
MessageBox.Show("应用程序异常");
break;
case 14:
MessageBox.Show("数据库异常");
break;
}
}
private void btnsyupdatezs_Click(object sender, EventArgs e)
{
Clinique clinique = new Clinique();
if (this.txtzsid.Text == "")
{
MessageBox.Show("诊所编号不能为空.....");
return;
}
if (this.txtzsmc.Text == "")
{
MessageBox.Show("诊所名称不能为空.....");
return;
}
if (this.txtzsmm.Text == "")
{
MessageBox.Show("诊所密码不能为空.....");
return;
}
if (this.txtysmc.Text == "")
{
MessageBox.Show("诊所医生不能为空.....");
return;
}
//封装诊所的信息
clinique.zsid = this.txtzsid.Text;
clinique.zsmm = this.txtzsmm.Text;
clinique.zsmc = this.txtzsmc.Text;
clinique.ysxm = this.txtysmc.Text;
clinique.lxdh = this.txtlxdh.Text;
clinique.zsjx = this.txtzsjx.Text;
clinique.zsdz = this.txtzsdz.Text;
clinique.dq = this.txtzsdq.Text;
clinique.dqbh = this.txtdqbh.Text;
clinique.ywy = this.txtywy.Text;
clinique.ywjl = this.txtywjl.Text;
ServiceRef.SYWebServiceClient c = new ServiceRef.SYWebServiceClient();
int flag = c.updateClinique("WS访问访问账户", "WS访问密码", clinique);
switch (flag)
{
case 0:
MessageBox.Show("修改诊所信息成功!");
break;
case 1:
MessageBox.Show("工单编号为空");
break;
case 2:
MessageBox.Show("诊所编号为空");
break;
case 3:
MessageBox.Show("没有文件信息上传");
break;
case 4:
MessageBox.Show("没有工单信息可以上传");
break;
case 5:
MessageBox.Show("没有工单图片文件可以上传");
break;
case 6:
MessageBox.Show("没有诊所信息可以上传");
break;
case 7:
MessageBox.Show("没有诊所信息可以上传");
break;
case 8:
MessageBox.Show("没有诊所信息可以更新");
break;
case 9:
MessageBox.Show("不安全的调用");
break;
case 10:
MessageBox.Show("不存在的工单[上传工单图片时检查]");
break;
case 11:
MessageBox.Show("输入输出异常");
break;
case 12:
MessageBox.Show("录入数据失败[存在重复数据]");
break;
case 13:
MessageBox.Show("应用程序异常");
break;
case 14:
MessageBox.Show("数据库异常");
break;
}
}
/// <summary>
/// 上传工单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnUploadWorkList_Click(object sender, EventArgs e)
{
WorkList w = new WorkList();
if (txtgdbh.Text == "")
{
MessageBox.Show("工单编号不能为空");
return;
}
w.gdbh = txtgdbh.Text;
if (txtfggdbh.Text == "")
{
MessageBox.Show("返工原单号不能为空!");
return;
}
w.fggdbh = txtfggdbh.Text;
if (txtzsidwokelist.Text == "")
{
MessageBox.Show("诊所编号不能为空");
return;
}
w.zsid = txtzsidwokelist.Text;
if (txtysxm.Text == "")
{
MessageBox.Show("医生姓名不能为空");
return;
}
w.ysxm = txtysxm.Text;
if (txtbrxm.Text == "")
{
MessageBox.Show("病人姓名不能为空");
return;
}
w.brxm = txtbrxm.Text;
if (textBox7.Text == "")
{
MessageBox.Show("业务员不能为空");
return;
}
w.ywy = textBox7.Text;
if (txtssdq.Text == "")
{
MessageBox.Show("所属地区不能为空");
return;
}
w.ssdq = txtssdq.Text;
if (txtfgyy.Text == "")
{
MessageBox.Show("返工原因不能为空");
}
//格式化日期
w.jjrq = ftpjjrq.Value.ToString("yyyy-mm-dd hh:mm:ss");
w.cjrq = ftpcjrq.Value.ToString("yyyy-mm-dd hh:mm:ss");
w.jzrq = dtpjzrq.Value.ToString("yyyy-mm-dd hh:mm:ss");
w.xgrq = dtpxgrq.Value.ToString("yyyy-mm-dd hh:mm:ss");
if (txtluz.Text == "")
{
MessageBox.Show("录入人不能为空");
return;
}
w.luz = txtcjr.Text;
ToothSpec ts = new ToothSpec();
if (txttoothSpecId.Text == "")
{
MessageBox.Show("规格编号不能为空");
return;
}
ts.toothSpecId = txttoothSpecId.Text;
if (txtlx.Text == "")
{
MessageBox.Show("牙齿类型不能为空");
return;
}
ts.yclx = txtlx.Text;
if (texzl.Text == "")
{
MessageBox.Show("牙齿总类不能为空");
return;
}
ts.zl = texzl.Text;
if (txtys.Text == "")
{
MessageBox.Show("牙齿颜色不能为空");
return;
}
ts.ys = txtys.Text;
if (txxjg.Text == "")
{
MessageBox.Show("JG不能为空");
return;
}
ts.jg = int.Parse(txxjg.Text);
if (textyw.Text == "")
{
MessageBox.Show("牙位不能为空");
return;
}
ts.yw = textyw.Text;
if (txtdx.Text == "")
{
MessageBox.Show("牙齿大小不能为空");
return;
}
ts.dx = txtdx.Text;
if (textsl.Text == "")
{
MessageBox.Show("数量1不能为空");
return;
}
ts.sl = int.Parse(textsl.Text);
if (textaddsl.Text == "")
{
MessageBox.Show("数量2不能为空");
return;
}
ts.addsl = int.Parse(textaddsl.Text);
if (txthbhid.Text == "")
{
MessageBox.Show("hbhid不能为空");
return;
}
ts.hbhid = txthbhid.Text;
if (txtgx.Text == "")
{
MessageBox.Show("工序不能为空");
return;
}
ts.gx = txthbhid.Text;
w.toothSpecs = new ToothSpec[] { ts };
SYWebServiceClient webService = new SYWebServiceClient();
int flag = webService.upLoadWorkList("WS访问访问账户", "WS访问密码", new WorkList[] { w });
switch (flag)
{
case 0:
MessageBox.Show("上传工单成功!");
break;
case 1:
MessageBox.Show("工单编号为空");
break;
case 2:
MessageBox.Show("诊所编号为空");
break;
case 3:
MessageBox.Show("没有文件信息上传");
break;
case 4:
MessageBox.Show("没有工单信息可以上传");
break;
case 5:
MessageBox.Show("没有工单图片文件可以上传");
break;
case 6:
MessageBox.Show("没有诊所信息可以上传");
break;
case 7:
MessageBox.Show("没有诊所信息可以上传");
break;
case 8:
MessageBox.Show("没有诊所信息可以更新");
break;
case 9:
MessageBox.Show("不安全的调用");
break;
case 10:
MessageBox.Show("不存在的工单[上传工单图片时检查]");
break;
case 11:
MessageBox.Show("输入输出异常");
break;
case 12:
MessageBox.Show("录入数据失败[存在重复数据]");
break;
case 13:
MessageBox.Show("应用程序异常");
break;
case 14:
MessageBox.Show("数据库异常");
break;
}
}
/// <summary>
/// 更新工单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnUpdateWorkList_Click(object sender, EventArgs e)
{
WorkList w = new WorkList();
if (txtgdbh.Text == "")
{
MessageBox.Show("工单编号不能为空");
return;
}
w.gdbh = txtgdbh.Text;
if (txtfggdbh.Text == "")
{
MessageBox.Show("返工原单号不能为空!");
return;
}
w.fggdbh = txtfggdbh.Text;
if (txtzsidwokelist.Text == "")
{
MessageBox.Show("诊所编号不能为空");
return;
}
w.zsid = txtzsidwokelist.Text;
if (txtysxm.Text == "")
{
MessageBox.Show("医生姓名不能为空");
return;
}
w.ysxm = txtysxm.Text;
if (txtbrxm.Text == "")
{
MessageBox.Show("病人姓名不能为空");
return;
}
w.brxm = txtbrxm.Text;
if (textBox7.Text == "")
{
MessageBox.Show("业务员不能为空");
return;
}
w.ywy = textBox7.Text;
if (txtssdq.Text == "")
{
MessageBox.Show("所属地区不能为空");
return;
}
w.ssdq = txtssdq.Text;
if (txtfgyy.Text == "")
{
MessageBox.Show("返工原因不能为空");
}
w.cjrq = ftpcjrq.Value.ToString("yyyy-mm-dd hh:mm:ss");
w.jzrq = dtpjzrq.Value.ToString("yyyy-mm-dd hh:mm:ss");
w.xgrq = dtpxgrq.Value.ToString("yyyy-mm-dd hh:mm:ss");
ToothSpec ts = new ToothSpec();
if (txttoothSpecId.Text == "") {
MessageBox.Show("规格编号不能为空");
return;
}
ts.toothSpecId = txttoothSpecId.Text;
if (txtluz.Text == "")
{
MessageBox.Show("录入人不能为空");
return;
}
w.luz = txtcjr.Text;
if (txtlx.Text == "")
{
MessageBox.Show("牙齿类型不能为空");
return;
}
ts.yclx = txtlx.Text;
if (texzl.Text == "")
{
MessageBox.Show("牙齿总类不能为空");
return;
}
ts.zl = texzl.Text;
if (txtys.Text == "")
{
MessageBox.Show("牙齿颜色不能为空");
return;
}
ts.ys = txtys.Text;
if (txxjg.Text == "")
{
MessageBox.Show("JG不能为空");
return;
}
ts.jg = int.Parse(txxjg.Text);
if (textyw.Text == "")
{
MessageBox.Show("牙位不能为空");
return;
}
ts.yw = textyw.Text;
if (txtdx.Text == "")
{
MessageBox.Show("牙齿大小不能为空");
return;
}
ts.dx = txtdx.Text;
if (textsl.Text == "")
{
MessageBox.Show("数量1不能为空");
return;
}
ts.sl = int.Parse(textsl.Text);
if (textaddsl.Text == "")
{
MessageBox.Show("数量2不能为空");
return;
}
ts.addsl = int.Parse(textaddsl.Text);
if (txthbhid.Text == "")
{
MessageBox.Show("hbhid不能为空");
return;
}
ts.hbhid = txthbhid.Text;
if (txtgx.Text == "")
{
MessageBox.Show("工序不能为空");
return;
}
ts.gx = txthbhid.Text;
w.toothSpecs = new ToothSpec[] { ts };
SYWebServiceClient webService = new SYWebServiceClient();
int flag = webService.updateWorkList("WS访问访问账户", "WS访问密码", w);
switch (flag)
{
case 0:
MessageBox.Show("更新工单成功!");
break;
case 1:
MessageBox.Show("工单编号为空");
break;
case 2:
MessageBox.Show("诊所编号为空");
break;
case 3:
MessageBox.Show("没有文件信息上传");
break;
case 4:
MessageBox.Show("没有工单信息可以上传");
break;
case 5:
MessageBox.Show("没有工单图片文件可以上传");
break;
case 6:
MessageBox.Show("没有诊所信息可以上传");
break;
case 7:
MessageBox.Show("没有诊所信息可以上传");
break;
case 8:
MessageBox.Show("没有诊所信息可以更新");
break;
case 9:
MessageBox.Show("不安全的调用");
break;
case 10:
MessageBox.Show("不存在的工单[上传工单图片时检查]");
break;
case 11:
MessageBox.Show("输入输出异常");
break;
case 12:
MessageBox.Show("录入数据失败[存在重复数据]");
break;
case 13:
MessageBox.Show("应用程序异常");
break;
case 14:
MessageBox.Show("数据库异常");
break;
}
}
/// <summary>
/// 删除工单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnRemoveWorklist_Click(object sender, EventArgs e)
{
if (txtgdbh.Text == "")
{
MessageBox.Show("要删除的工单编号不能为空");
return;
}
SYWebServiceClient webService = new SYWebServiceClient();
int flag = webService.removeWorkList("WS访问访问账户", "WS访问密码", txtgdbh.Text);
switch (flag)
{
case 0:
MessageBox.Show("删除工单成功!");
break;
case 1:
MessageBox.Show("工单编号为空");
break;
case 2:
MessageBox.Show("诊所编号为空");
break;
case 3:
MessageBox.Show("没有文件信息上传");
break;
case 4:
MessageBox.Show("没有工单信息可以上传");
break;
case 5:
MessageBox.Show("没有工单图片文件可以上传");
break;
case 6:
MessageBox.Show("没有诊所信息可以上传");
break;
case 7:
MessageBox.Show("没有诊所信息可以上传");
break;
case 8:
MessageBox.Show("没有诊所信息可以更新");
break;
case 9:
MessageBox.Show("不安全的调用");
break;
case 10:
MessageBox.Show("不存在的工单[上传工单图片时检查]");
break;
case 11:
MessageBox.Show("输入输出异常");
break;
case 12:
MessageBox.Show("录入数据失败[存在重复数据]");
break;
case 13:
MessageBox.Show("应用程序异常");
break;
case 14:
MessageBox.Show("数据库异常");
break;
}
}
/// <summary>
/// 上传工单图片
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnUpload_Click(object sender, EventArgs e)
{
if (txtpicwokelistid.Text == "")
{
MessageBox.Show("请输入工单编号");
return;
}
SYWebServiceClient webService = new SYWebServiceClient();
OpenFileDialog openFile = new OpenFileDialog();
openFile.ShowDialog();
WorkListPicFile file = new WorkListPicFile();
//获得唯一图片名字
String saveFile = Guid.NewGuid().ToString() + openFile.FileName.Substring(openFile.FileName.Length - 4, 4);
Console.WriteLine("图片名称:" + saveFile);
FileStream fs = null;
int filg = -1;
try
{
fs = new FileStream(openFile.FileName, FileMode.Open);
file.serverFile = saveFile;
file.fileSize = fs.Length;
Console.WriteLine("开始上传图片,文件总共大小为:" + fs.Length);
byte[] bytes = new byte[1024 * 1024];
int size = 0;
do
{
size = fs.Read(bytes, 0, 1024 * 1024);
if (size <= 0)
{
break;
}
byte[] fixedBytes = new byte[size];
Array.Copy(bytes, fixedBytes, size);
file.bytes = fixedBytes;
file.workListId = txtpicwokelistid.Text;
filg = webService.upLoadWorkListPic("WS访问访问账户", "WS访问密码", file);
if (filg != 0)
{
break;
}
file.position = (file.position + fixedBytes.Length);
Console.WriteLine("上传成功,已上传" + file.position + "字节");
} while (size > 0);
}
catch (Exception exce)
{
MessageBox.Show(exce.Message);
}
finally
{
if (null != fs)
{
fs.Close();
}
switch (filg)
{
case 0:
MessageBox.Show("上传工单图片成功!");
break;
case 1:
MessageBox.Show("工单编号为空");
break;
case 2:
MessageBox.Show("诊所编号为空");
break;
case 3:
MessageBox.Show("没有文件信息上传");
break;
case 4:
MessageBox.Show("没有工单信息可以上传");
break;
case 5:
MessageBox.Show("没有工单图片文件可以上传");
break;
case 6:
MessageBox.Show("没有诊所信息可以上传");
break;
case 7:
MessageBox.Show("没有诊所信息可以上传");
break;
case 8:
MessageBox.Show("没有诊所信息可以更新");
break;
case 9:
MessageBox.Show("不安全的调用");
break;
case 10:
MessageBox.Show("不存在的工单[上传工单图片时检查]");
break;
case 11:
MessageBox.Show("输入输出异常");
break;
case 12:
MessageBox.Show("录入数据失败[存在重复数据]");
break;
case 13:
MessageBox.Show("应用程序异常");
break;
case 14:
MessageBox.Show("数据库异常");
break;
}
}
}
/// <summary>
/// 修改牙齿工s序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnUpdate_Click(object sender, EventArgs e)
{
if (txtycbh.Text == "")
{
MessageBox.Show("请输入牙齿编号");
return;
}
if (txtycgx.Text == "")
{
MessageBox.Show("请输入工序");
return;
}
SYWebServiceClient webService = new SYWebServiceClient();
int filg = webService.updateToothSpecGX(txtycbh.Text, txtycgx.Text);
Console.WriteLine("修改状态:"+filg);
switch (filg)
{
case 0:
MessageBox.Show("修改牙齿工序成功!");
break;
case 1:
MessageBox.Show("工单编号为空");
break;
case 2:
MessageBox.Show("诊所编号为空");
break;
case 3:
MessageBox.Show("没有文件信息上传");
break;
case 4:
MessageBox.Show("没有工单信息可以上传");
break;
case 5:
MessageBox.Show("没有工单图片文件可以上传");
break;
case 6:
MessageBox.Show("没有诊所信息可以上传");
break;
case 7:
MessageBox.Show("没有诊所信息可以上传");
break;
case 8:
MessageBox.Show("没有诊所信息可以更新");
break;
case 9:
MessageBox.Show("不安全的调用");
break;
case 10:
MessageBox.Show("不存在的工单[上传工单图片时检查]");
break;
case 11:
MessageBox.Show("输入输出异常");
break;
case 12:
MessageBox.Show("录入数据失败[存在重复数据]");
break;
case 13:
MessageBox.Show("应用程序异常");
break;
case 14:
MessageBox.Show("数据库异常");
break;
}
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
}
}

CXF在项目中的真实运用--WS访问客户端编写[java、.net]相关推荐

  1. 解决“Maven项目中的Dynamic Web Module 3.0 requires Java 1.6 or newer”问题

    转载自   解决"Maven项目中的Dynamic Web Module 3.0 requires Java 1.6 or newer"问题 错误描述 当创建有动态web模块3.0 ...

  2. 【WEB API项目实战干货系列】- API访问客户端(WebApiClient适用于MVC/WebForms/WinForm)(四)

    目前最新的代码已经通过Sqlite + NHibernate + Autofac满足了我们基本的Demo需求. 按照既定的要求,我们的API会提供给众多的客户端使用, 这些客户端可以是各种Web站点, ...

  3. java项目中获取真实ip地址

    一.工具类 /*** 获取客户端IP** @param request 请求对象* @return IP地址*/public static String getIpAddr(HttpServletRe ...

  4. java和python可以在一个项目中同时使用么-可以同时用python和java开发一个app吗?...

    java属于高大上,适合12306这种有钱的金主,同样的项目要是用java做的,就能唬来成倍的钱,没钱搞java,只能晚上加班到10来点,在eclipse吭哧吭哧地编译完项目以后,在七八屏的堆栈信息里 ...

  5. 091023 T GIX4 项目中的 智能部署 和 智能客户端

    先说一下ClickOnce的使用方法: 先给一个要发布的工程设置安全和签名.然后发布到iis中.当用户访问该iis目录下的.application文件时,就会自动安装整个应用程序. 再说一下我们目前的 ...

  6. java项目中没有jdk包_彻底搞懂Java开发工具包(JDK)安装及环境变量配置

    一.Java 和 JDK 是什么 Java:Java是一种优秀的程序设计语言,它有非常多的语言特性,如简单性.面向对象.可移植性等.Java 并不只是一种语言,而是一个完整的平台,它有一个庞大的库,其 ...

  7. Npoi Web 项目中(XSSFWorkbook) 导出出现无法访问已关闭的流

    NPOI生产.xlsx文件件时,在使用book.Write(ms);后,会关闭流,这样导致再次使用Respons输出流的时候就出错了. 造成关闭流的主要原因有时其实是跨域,同域是没有问题的. //新建 ...

  8. maven install后,java -jar XXXX.jar运行---找不到主类问题 以及 虚拟机中执行jar包后 访问页面出现Java heap space等其他问题

    这是前几天遇到的问题了,当天晚上想写下来来着,后来有事情就一直搁置到现在了. 由于我想将SpringCloud项目都导出jar包在虚拟机上运行,然后本地访问,所以先将SpringCloud中的注册中心 ...

  9. java程序中默认包含的是_在编写 Java 程序时,如果不为类的成员变量定义初始值, Java 会给出它们的默认值,下列说法中不正确的一个是( )。...

    软件Linuxkernel的版本号为2.6.39.0,其中数字为"6"代表(). 口令中的突出主音是指(). 偏心受力构件进行钢筋代换时应按()分别代换 采用提净法炮制的药物是() ...

最新文章

  1. 网络营销期间选用冷门关键词网络营销效果会好吗?
  2. 自定义报表 java_报表为什么会没完没了?怎么解决这个问题?
  3. foreach循环符合就不往下走了_柴油发电机组冷却液循环故障解决方法
  4. 如何更新Win11系统网卡驱动
  5. 软考信息安全工程师备考笔记5:第五章应用系统安全基础备考要点
  6. Exchange Server 2016 独立部署/共存部署 (二)—— 先决条件
  7. 超市商品摆放图片_商品摆放舍不得拿、干净又卫生的马来西亚版大润发——NSK超市...
  8. python的程序变量名_python中变量的名称和程序效率
  9. 计算机命令提示符的使用,命令提示符(电脑系统命令提示符的打开方法)
  10. 梁武帝萧衍之代齐建梁行贿亡国,南北朝梁国之鉴!
  11. 已发送邮件如何撤回?
  12. mt管理器主题修改教程_领不了的QQ画图红包教程
  13. textarea层级问题
  14. TP-LINK TL-WDN7200H ubuntu18.04驱动安装
  15. virtualbox 虚拟机 win7 激活后开机黑屏,只有横杠
  16. discuz3.4安装php,Discuz!X3.4论坛源码下载 及 全新安装教程
  17. 数据中心对洪水风险应具备应急措施
  18. android github框架大全
  19. 今天,辛辛苦苦开发的雷超站终于上线了
  20. java 字符串驻留_JAVA 字符串驻留池

热门文章

  1. 【人工智能】AI与深度学习重点回顾,从研究到应用,这是一份2017年AI领域的最全面总结
  2. User Datagram Protocol:Internet 协议集支持一个无连接的传输协议
  3. 帆软 V9 Getshell 漏洞
  4. 个人准则、格言、作息
  5. Python 批量计算变量iv值
  6. 在线工具:简单修改网址解锁新世界
  7. DMVPN中心站点动态域名解析
  8. 双目立体视觉数学原理
  9. vue实现动态路由俩种方式
  10. 写代码后的学习与总结