ASP.NET调用JAVA接口
luocy 2010-05-10 10:13:23 TradeParameter.java代码如下:
package dto;
public class TradeParameter implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private int type;
private String enterString;
private int value;
private String outString;
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getEnterString() {
return enterString;
}
public void setEnterString(String enterString) {
this.enterString = enterString;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public String getOutString() {
return outString;
}
public void setOutString(String outString) {
this.outString = outString;
}
}
PlatServiceTest.java代码如下(java里的调用方法):
import java.util.Date;
import org.phprpc.PHPRPC_Client;
import com.juhe.bookplat.entity.Patient;
import dto.ParameterTrans;
import dto.TradeParameter;
import junit.framework.TestCase;
public class PlatServiceTest extends TestCase {
PHPRPC_Client client = null;
PlatService service = null;
protected void setUp() throws Exception {
client = new PHPRPC_Client("http://localhost/plat/service.jsp");
service = (PlatService)client.useService(PlatService.class);
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testFindPatient()throws Exception{
try{
TradeParameter tp = new TradeParameter();
tp.setType(15);
tp.setEnterString("hxd007|||||||");
TradeParameter r =service.exec(tp);
System.out.println("返回的字符串:"+r.getValue()+";"+r.getOutString());
assertEquals(1, r.getValue());
}catch(Exception e){
e.printStackTrace();
}
}
}
请问:在.net里面怎样写这个调用service.jsp接口的方法?不甚感激!