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
相关文档:
class Link
{
private Node head;
public Link(Node head)
{
this.head=head;
}
public void addNode(Node node)
{
Node p=head;
while(true)
{
if(!p.hasNext())
{
p.setNext(node);
break;
}
p=p.getNext();
}
}
//插入节
public void insertNode(Node p,Node q)
{
q.setNext(p.getNext());
p.se ......
SCJP5学习笔记
线程交互是比较复杂的问题,SCJP要求不很基础:给定一个场景,编写代码来恰当使用等待、通知和通知所有线程。
一、线程交互的基础知识
SCJP所要求的线程交互知识点需要从java.lang.Object
的类的三个方法来学习:
void notify()
  ......
与线程休眠类似,线程的优先级仍然无法保障线程的执行次序。只不过,优先级高的线程获取CPU资源的概率较大,优先级低的并非没机会执行。
线程的优先级用1-10之间的整数表示,数值越大优先级越高,默认的优先级为5。
在一个线程中开启另外一个新线程,则新开线程称为该线程的子线程,子线程初始优先级与父 ......
.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项目中的 ......