WebService java 调用 .net方法
package com.test.servlet;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.message.SOAPHeaderElement;
public class WebService {
public void invode(){
// 服务端的url,需要根据情况更改。
String endpointURL = "http://10.32.0.76/Service/Certificat.asmx?WSDL";
//命名空间
String workspace = "http://tempuri.org/";
Service service = new Service();
try {
Call call = (Call) service.createCall();
//设置要执行的方法名
String methodName = "getName";
//设置这个方法中的参数名
String parameterName = "name";
call.setSOAPActionURI(workspace+methodName);
//设置WEBSERVICE地址
call.setTargetEndpointAddress(new java.net.URL(endpointURL));
// 设置操作的名称。
call.setOperationName(new QName(workspace, methodName));
&n
相关文档:
与线程休眠类似,线程的优先级仍然无法保障线程的执行次序。只不过,优先级高的线程获取CPU资源的概率较大,优先级低的并非没机会执行。
线程的优先级用1-10之间的整数表示,数值越大优先级越高,默认的优先级为5。
在一个线程中开启另外一个新线程,则新开线程称为该线程的子线程,子线程初始优先级与父 ......
Static Factory Methods
Four Advantages:
1) have names
2) not required to create a new object each time they are invoked
3) return an object of any subtype of their return type
4) reduce the verbosity of creating parameterized type instances.(for example: newInstance() method) ......
.net代码如下,
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
// [System.Web.Script.Services.ScriptService]
public class SysService : System.Web.Services.Web ......
一 相对路径的获得
说明:相对路径(即不写明时候到底相对谁)均可通过以下方式获得(不论是一般的java项目还是web项目)
String relativelyPath=System.getProperty("user.dir");
上述相对路径中,java项目中的 ......