• 安装文件下载:

jdk1.7.0_13

安装步骤参考文章:http://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html

tomcat7.0.65

安装步骤参考文章:http://jingyan.baidu.com/article/870c6fc33e62bcb03fe4be90.html

axis2 1.6.3,官网http://axis.apache.org/axis2/java/core/download.cgi下载:WAR Distribution zip

下载到文件为:axis2-1.6.3-war.zip

sqljdbc4.jar

百度搜索sqljdbc,找到Microsoft JDBC Driver for SQL Server(微软官网)点开链接,建议下载sqljdbc_4.0.2206.100_enu.tar.gz,解压后把

参考文章:http://www.open-open.com/lib/view/1329999223671

http://blog.csdn.net/keenweiwei/article/details/7332261

eclipse,到官网下载即可。

  • 安装及配置:

1,)安装Java Jdk到E:\Java\Java_Jdk1.7目录

2,)解压tomcat到E:\Java\apache-tomcat-7.0.65

3,)sqljdbc.jar文件存放路径为:E:\Java\sqljdbc\sqljdbc4.jar

4,)将axis2-1.6.3-war.zip加压,将解压出来的axis2.war文件拷贝到E:\Java\apache-tomcat-7.0.65\webapps下

5,)环境变量配置:

CLASSPATH
.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;E:\Java\sqljdbc\sqljdbc4.jar
JAVA_HOME
E:\Java\Java_Jdk1.7\jdk1.7.0_13
CATALINA_HOME
E:\Java\apache-tomcat-7.0.65
Path
追加%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

6,)安装tomcat7.0,cmd进入目录E:\Java\apache-tomcat-7.0.65\bin 执行service.bat install命令,等待安装完成双击E:\Java\apache-tomcat-7.0.65\bin\tomcat7w.exe,并运行该服务

7,)浏览器中输入地址:http:\\localhost:8080回车,如果出现tomcat首页说明环境配置成功

8,)访问地址http:\\localhost:8080\axis2出现axis2页面说明axis2安装成功

9,)解压eclipse文件,并创建桌面快捷方式。

10,)拷贝E:\Java\sqljdbc\sqljdbc4.jar到E:\Java\apache-tomcat-7.0.65\lib下

  • 开发

1,)运行eclipse,配置运行java jdk为为当前jdk,sever为当前tomcat7.0;

2,)创建web站点(web\dynamic web project),起名为test.

3,)将E:\Java\apache-tomcat-7.0.65\workapps\axis2\WEB-INF\下的lib、conf、modules、services文件夹拷贝到test工程的WEB-INF下。

4,)清空工程WEB-INF\services\下的文件,新建目录test\META-INF\,再在WEB-INF\services\test\META-INF\下新建文件services.xml,内容填写为:

<?xml version="1.0" encoding="UTF-8"?>
<service name="AccountService">
<description>
HelloWorld Service Example
</description>
<parameter name="ServiceClass">
com.dt.webservices.AccountService
</parameter>
<operation name="addUserInfo">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
<operation name="modifyUserInfo">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
<operation name="delUser">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
<operation name="modifyPwd">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
<operation name="queryUsers">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
</service>

5,)修改工程下\WEB-INF\web.xml内容为:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<servlet>
<servlet-name>AxisServlet</servlet-name>
<servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

6,)src下新建包com.dt.webservices,新建类AccountService.java

7,)新加入包E:\Java\sqljdbc\sqljdbc4.jar

8,)编辑AccountService.java为:

 package com.dt.webservices;

 import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement; import java.io.StringReader; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.xml.sax.InputSource; public class AccountService {
/**
* 新增接口
*
* @param userInfos
* @return 返回參數信息 xml格式。
*/
public String addUserInfo(String userInfos) {
String result = ""; Boolean hasAnyError = false;
String accId = "";
String userPassword = "";
String name = "";
String email = "";
StringBuffer accIds = new StringBuffer(); try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(userInfos))); Element root = doc.getDocumentElement();
NodeList accounts = root.getChildNodes();
if (accounts != null) {
Class.forName(SQL2008R2Config.SQL2008R2_JDBC_DIRVER);
Connection connection = DriverManager.getConnection(SQL2008R2Config.SQL2008R2_JDBC_URL,
SQL2008R2Config.SQL2008R2_ACCOUNT, SQL2008R2Config.SQL2008R2_PWD);
Statement stmt = connection.createStatement(); for (int i = 0; i < accounts.getLength(); i++) {
Node accountNode = accounts.item(i);
//...
} stmt.close();
connection.close();
} else {
hasAnyError = true;
}
} catch (Exception ex) {
hasAnyError = true;
ex.printStackTrace();
} if (hasAnyError) {
result = "...";
} else {
result = "...";
} return result;
} /**
* 修改接口
*
* @param userInfos
* @return 返回操作是否成功信息 xml格式。
*/
public String modifyUserInfo(String userInfos) {
String result = "";
Boolean hasAnyError = false;
String accId = "";
String name = "";
String email = "";
StringBuffer accIds = new StringBuffer(); try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(userInfos))); Element root = doc.getDocumentElement();
NodeList accounts = root.getChildNodes();
if (accounts != null) {
Class.forName(SQL2008R2Config.SQL2008R2_JDBC_DIRVER);
Connection connection = DriverManager.getConnection(SQL2008R2Config.SQL2008R2_JDBC_URL,
SQL2008R2Config.SQL2008R2_ACCOUNT, SQL2008R2Config.SQL2008R2_PWD);
Statement stmt = connection.createStatement(); for (int i = 0; i < accounts.getLength(); i++) {
Node accountNode = accounts.item(i);
//....
} stmt.close();
connection.close();
} else {
hasAnyError = true;
}
} catch (Exception ex) {
hasAnyError = true;
ex.printStackTrace();
} if (hasAnyError) {
result = "...";
} else {
result = "...";
} return result;
} /**
* 删除接口
*
* @param userIDs
* @return 返回操作状态信息 xml格式。
*/
public String delUser(String userIDs) {
String result = "";
Boolean hasAnyError = false;
String accId = "";
StringBuffer accIds = new StringBuffer(); try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(userIDs))); Element root = doc.getDocumentElement();
NodeList accounts = root.getChildNodes();
if (accounts != null) {
Class.forName(SQL2008R2Config.SQL2008R2_JDBC_DIRVER);
Connection connection = DriverManager.getConnection(SQL2008R2Config.SQL2008R2_JDBC_URL,
SQL2008R2Config.SQL2008R2_ACCOUNT, SQL2008R2Config.SQL2008R2_PWD);
Statement stmt = connection.createStatement(); for (int i = 0; i < accounts.getLength(); i++) {
Node accountNode = accounts.item(i);
//....
} stmt.close();
connection.close();
} else {
hasAnyError = true;
}
} catch (Exception ex) {
hasAnyError = true;
ex.printStackTrace();
} if (hasAnyError) {
result = "xxxx";
} else {
result = "xxxx";
} return result;
} /**
* 修改
*
* @param userInfos
* @return 操作信息结果 xml
*/
public String modifyPwd(String userInfos) {
String result = "";
Boolean hasAnyError = false;
String accId = "";
String userPassword = ""; try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(userInfos))); Element root = doc.getDocumentElement();
NodeList accounts = root.getChildNodes();
if (accounts != null) {
Class.forName(SQL2008R2Config.SQL2008R2_JDBC_DIRVER);
Connection connection = DriverManager.getConnection(SQL2008R2Config.SQL2008R2_JDBC_URL,
SQL2008R2Config.SQL2008R2_ACCOUNT, SQL2008R2Config.SQL2008R2_PWD);
Statement stmt = connection.createStatement(); for (int i = 0; i < accounts.getLength(); i++) {
Node accountNode = accounts.item(i);
if (accountNode.getNodeName() == "account") {
NodeList accountMembers = accountNode.getChildNodes();
accId = "";
userPassword = ""; // ........
}
} stmt.close();
connection.close();
} else {
hasAnyError = true;
}
} catch (Exception ex) {
hasAnyError = true;
ex.printStackTrace();
} if (hasAnyError) {
result = "/....";
} else {
result = "/....";
} return result;
} /**
*
* @param 无
* @return String
*/
public String queryUsers() {
String result = ""; Connection connection = null;
Statement stmt = null;
ResultSet rs = null; try {
Class.forName(SQL2008R2Config.SQL2008R2_JDBC_DIRVER);
connection = DriverManager.getConnection(SQL2008R2Config.SQL2008R2_JDBC_URL,
SQL2008R2Config.SQL2008R2_ACCOUNT, SQL2008R2Config.SQL2008R2_PWD); String sql = "select * from dbo.test"; stmt = connection.createStatement();
rs = stmt.executeQuery(sql); result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
result += "<as>"; if (!rs.wasNull()) {
while (rs.next()) {
result += " <a>";
result += " <name>" + rs.getString("RealName") + "</name>";
result += " </a>";
}
}
result += "</as>"; rs.close();
stmt.close();
connection.close();
} catch (Exception ex) {
ex.printStackTrace();
} return result;
}
}
 package com.dt.webservices;

 import java.sql.*;

 public class SQL2008R2Config {
public static final String SQL2008R2_SERVER = "17.1.1.1\\dk";
public static final String SQL2008R2_DBNAME = "db_test";
public static final String SQL2008R2_ACCOUNT = "sa";
public static final String SQL2008R2_PWD = "123";
public static final String SQL2008R2_JDBC_URL = "jdbc:sqlserver://"+SQL2008R2_SERVER+";databaseName="+SQL2008R2_DBNAME;
public static final String SQL2008R2_JDBC_DIRVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
};

9,)发布服务到tomcat7.0下

10,)访问地址http://localhost:8080/test/services/AccountService?wsdl

  • 客户端调用测试

1,)使用svcutil.exe生成client.cs,和app.config

app.config

 <?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="AccountServiceSoap11Binding" />
</basicHttpBinding>
<customBinding>
<binding name="AccountServiceSoap12Binding">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:8080/test/services/AccountService.AccountServiceHttpSoap11Endpoint/"
binding="basicHttpBinding" bindingConfiguration="AccountServiceSoap11Binding"
contract="AccountServicePortType" name="AccountServiceHttpSoap11Endpoint" />
<endpoint address="http://localhost:8080/test/services/AccountService.AccountServiceHttpSoap12Endpoint/"
binding="customBinding" bindingConfiguration="AccountServiceSoap12Binding"
contract="AccountServicePortType" name="AccountServiceHttpSoap12Endpoint" />
</client>
</system.serviceModel>
</configuration>

client.cs

 //------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.18408
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://webservices.dt.com", ConfigurationName="AccountServicePortType")]
public interface AccountServicePortType
{ [System.ServiceModel.OperationContractAttribute(Action="urn:queryUsers", ReplyAction="urn:queryUsersResponse")]
[return: System.ServiceModel.MessageParameterAttribute(Name="return")]
string queryUsers(); [System.ServiceModel.OperationContractAttribute(Action="urn:addUserInfo", ReplyAction="urn:addUserInfoResponse")]
[return: System.ServiceModel.MessageParameterAttribute(Name="return")]
string addUserInfo(string userInfos); [System.ServiceModel.OperationContractAttribute(Action="urn:modifyPwd", ReplyAction="urn:modifyPwdResponse")]
[return: System.ServiceModel.MessageParameterAttribute(Name="return")]
string modifyPwd(string userInfos); [System.ServiceModel.OperationContractAttribute(Action="urn:modifyUserInfo", ReplyAction="urn:modifyUserInfoResponse")]
[return: System.ServiceModel.MessageParameterAttribute(Name="return")]
string modifyUserInfo(string userInfos); [System.ServiceModel.OperationContractAttribute(Action="urn:delUser", ReplyAction="urn:delUserResponse")]
[return: System.ServiceModel.MessageParameterAttribute(Name="return")]
string delUser(string userIDs);
} [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface AccountServicePortTypeChannel : AccountServicePortType, System.ServiceModel.IClientChannel
{
} [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class AccountServicePortTypeClient : System.ServiceModel.ClientBase<AccountServicePortType>, AccountServicePortType
{ public AccountServicePortTypeClient()
{
} public AccountServicePortTypeClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
} public AccountServicePortTypeClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
} public AccountServicePortTypeClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
} public AccountServicePortTypeClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
} public string queryUsers()
{
return base.Channel.queryUsers();
} public string addUserInfo(string userInfos)
{
return base.Channel.addUserInfo(userInfos);
} public string modifyPwd(string userInfos)
{
return base.Channel.modifyPwd(userInfos);
} public string modifyUserInfo(string userInfos)
{
return base.Channel.modifyUserInfo(userInfos);
} public string delUser(string userIDs)
{
return base.Channel.delUser(userIDs);
}
}

2,)测试调用代码:

 static void Main(string[] args)
{
using (AccountServicePortTypeClient client = new AccountServicePortTypeClient("AccountServiceHttpSoap11Endpoint"))
{
string addUserInfoParameter = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
addUserInfoParameter += "<accounts>";
addUserInfoParameter += " <account>";
addUserInfoParameter += " <accId>test22</accId>";
addUserInfoParameter += " <userPassword>z3ux4rpW0H3QbY47pjZa6w==</userPassword>";
addUserInfoParameter += " <name>test22</name>";
addUserInfoParameter += " <description>描述</description>";
addUserInfoParameter += " <email>test22@catt.cn</email>";
addUserInfoParameter += " <nation>汉族</nation>";
addUserInfoParameter += " </account>";
addUserInfoParameter += " <account>";
addUserInfoParameter += " <accId>test23</accId>";
addUserInfoParameter += " <userPassword>z3ux4rpW0H3QbY47pjZa6w==</userPassword>";
addUserInfoParameter += " <name>test23</name>";
addUserInfoParameter += " <description>描述</description>";
addUserInfoParameter += " <email>test23@catt.cn</email>";
addUserInfoParameter += " <nation>汉族</nation>";
addUserInfoParameter += " </account>";
addUserInfoParameter += "</accounts>";
Console.WriteLine("addUserInfo:{0}", client.addUserInfo(addUserInfoParameter)); string modifyUserInfoParameter = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
modifyUserInfoParameter += "<accounts>";
modifyUserInfoParameter += " <account>";
modifyUserInfoParameter += " <accId>test22</accId>";
modifyUserInfoParameter += " <userPassword>z3ux4rpW0H3QbY47pjZa6w==</userPassword>";
modifyUserInfoParameter += " <name>test232</name>";
modifyUserInfoParameter += " <description>描述</description>";
modifyUserInfoParameter += " <email>test232@catt.cn</email>";
modifyUserInfoParameter += " <nation>汉族</nation>";
modifyUserInfoParameter += " </account>";
modifyUserInfoParameter += " <account>";
modifyUserInfoParameter += " <accId>test23</accId>";
modifyUserInfoParameter += " <userPassword>z3ux4rpW0H3QbY47pjZa6w==</userPassword>";
modifyUserInfoParameter += " <name>test233</name>";
modifyUserInfoParameter += " <description>描述</description>";
modifyUserInfoParameter += " <email>test233@catt.cn</email>";
modifyUserInfoParameter += " <nation>汉族</nation>";
modifyUserInfoParameter += " </account>";
modifyUserInfoParameter += "</accounts>";
Console.WriteLine("modifyUserInfo:{0}", client.modifyUserInfo(modifyUserInfoParameter)); string modifyParameter = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
modifyParameter += "<accounts>";
modifyParameter += " <account>";
modifyParameter += " <accId>admin</accId>";
modifyParameter += " <userPassword>z3ux4rpW0H3QbY47pjZa6w==</userPassword>";
modifyParameter += " </account>";
modifyParameter += "</accounts>"; Console.WriteLine("modifyPwd:{0}", client.modifyPwd(modifyParameter)); string delUserParameter = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
delUserParameter += "<accounts>";
delUserParameter += " <accId>test</accId>";
delUserParameter += " <accId>admin</accId>";
delUserParameter += "</accounts>";
Console.WriteLine("delUser:{0}", client.delUser(delUserParameter)); Console.WriteLine("queryUsers:{0}", client.queryUsers()); } Console.ReadKey();
}

参考文章:

axis2 1.6.3+tomcat7.0+jdk7.0+sqlserver
tomcat
http://jingyan.baidu.com/article/870c6fc33e62bcb03fe4be90.html
jdk
http://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html
demo
http://www.cnblogs.com/javawebsoa/archive/2013/05/19/3087234.html
http://jingyan.baidu.com/article/a3761b2bbe092c1576f9aa29.html
map foreach
http://blog.csdn.net/tjcyjd/article/details/11111401
客户端调用:
http://m.blog.csdn.net/blog/jiqiujia/37097249
http://blog.csdn.net/yhhah/article/details/4158487

Java Axis2 1.6.3+JDK1.7.0_13+Tomcat7.0.65+eclipse搭建web service的更多相关文章

  1. Centos7.0挂载优盘安装jdk1.7和tomcat7.0

    Centos7.0挂载优盘安装jdk1.7和tomcat7.0 前言: 笔者发现用wget方法直接在服务器下载jdk和tomcat速度很慢,而且jdk1.7用wget方法下载链接不好找,不如直接从官网 ...

  2. 【转】基于CXF Java 搭建Web Service (Restful Web Service与基于SOAP的Web Service混合方案)

    转载:http://www.cnblogs.com/windwithlife/archive/2013/03/03/2942157.html 一,选择一个合适的,Web开发环境: 我选择的是Eclip ...

  3. Java RESTful Web Service相关概念

    原文地址:http://1.liangtao.sinaapp.com/?p=647 接上一篇文章REST|RESTful初步认识:p=639">http://1.liangtao.si ...

  4. Ubuntu12.04 配置Java开发环境:JDK1.7+Eclipse+Tomcat7.0

    软硬件环境 Ubuntu12.04+JDK1.7+Eclipse+Tomcat7.0 内容列表 1.安装JDK1.7,配置JAVA环境 2.安装Eclipse 3.安装Tomcat7.0 1.安装JD ...

  5. Jdk1.7+eclipse搭建Java开发环境

    Jdk1.7+eclipse搭建Java开发环境 1.    下载jdk1.7 http://www.oracle.com/technetwork/java/javase/downloads/jdk7 ...

  6. Java axis2.jar包详解及缺少jar包错误分析

    Java  axis2.jar包详解及缺少jar包错误分析 一.最小开发jar集 axis2 开发最小jar包集: activation-1.1.jar axiom-api-1.2.13.jar ax ...

  7. Java主流Web Service框架介绍:CXF和Axis2

    CXF和Axis2是目前java平台上最主流的两个框架,虽然两个项目都隶属ASF,但却是基于不同思想和风格实现的,因此也各有所长.   CXF:http://cxf.apache.org/ 是由过去的 ...

  8. JDK安装及JAVA环境变量配置(JDK1.8版本)

    一:JDK官网下载地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html JD ...

  9. Servlet实现表单提交(MyEclipse10,Tomcat7.0,JDK1.7,)——Java Web练习(一)

    1.MyEclipse|File|New|Project|Web Project    填写Project Name:exServlet,点选Java EE 6.0(配套Tomcat7.0) 2.代码 ...

随机推荐

  1. PHP pear安装

    PHP pear安装 Posted on 2012-07-06 10:19 bug yang 阅读(5787) 评论(0) 编辑 收藏 转自:http://wangye.org/blog/archiv ...

  2. cursor:pointer

    .cursor_hand{ cursor:pointer; }

  3. Java Web项目调优原则

    1. 根据oracle生成的awr文件排除是否是数据库或者sql问题 2.配置中间件的dump文件路径,gc log文件路径 3.通过 MemoryAnalyzer 分析 dump文件 4.通过exc ...

  4. [have_fun] 好玩哒小游戏

    好玩哒,打字小游戏:http://zty.pe/ 可好玩了,一起来玩吧!

  5. sql CRUD 增删改查复习汇总

    1.创建数据库create database 数据库名称删除数据库drop database 数据库名称2.创建表create table 表名(    列名 类型(长度) 自增长 主键 非空,)自增 ...

  6. 64 位win 7或windows 8下的visual studio不能连接Oracle数据库调试网站的问题

    在64 位win 7或windows 8系统下,visual studio直接F5运行网站调试,你会发现不能连接Oracle数据库,会报一个“ORA-06413: Connection not ope ...

  7. .Net搭建的WebService测试页使用TextArea大文本框方便调试

    用.Net搭建的WebService,系统默认提供了测试页,供大家输入参数进行测试.但因为参数输入框使用的是单行input控件,导致无法输入换行文本,使得有些参数(如换行的xml)无法输入,及其不便. ...

  8. [收藏]Asp.net MVC生命周期

    一个HTTP请求从IIS移交到Asp.net运行时,Asp.net MVC是在什么时机获得了控制权并对请求进行处理呢?处理过程又是怎样的? 以IIS7中asp.net应用程序生命周期为例,下图是来自M ...

  9. 已禁用对分布式事务管理器(MSDTC)的网络访问。请使用组件服务管理工具启用 DTC 以便在 MSDTC 安全配置中进行网络访问。

    今天写ASP.NET程序,在网页后台的c#代码里写了个事务,事务内部对一张表进行批量插入,对另外一张表进行查询与批量插入. 结果第二张表查询后foreach迭代操作时报错:已禁用对分布式事务管理器(M ...

  10. 在XE5中 VCL空窗体的3个线程

    中午看到技术群里有人讨论, XE5一个空窗体程序就包含了3个线程, 赶忙打开XE5开了个空窗体一看, 果然如此 再打开D7和2010看了一下, 都是一个线程 这时看到有人说一个是输入法, 一个是GDI ...