人家提供下面的信息给我,要我通过webservice取数据
POST /getteafarmer.asmx HTTP/1.1
Host: teacode.xhnw.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://teacode.xhnw.com:8080/GetTeaFarmerByCode"<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetTeaFarmerByCode xmlns="http://teacode.xhnw.com:8080/">
<strNo>string</strNo>
<strCode>string</strCode>
<strCRC>string</strCRC>
</GetTeaFarmerByCode>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetTeaFarmerByCodeResponse xmlns="http://teacode.xhnw.com:8080/">
<GetTeaFarmerByCodeResult>string</GetTeaFarmerByCodeResult>
</GetTeaFarmerByCodeResponse>
</soap:Body>
</soap:Envelope>
下面是我在网上找的调用方法public static void getAxisService(){
Service service = new Service();
Call call = null;
String result = null;
try {
call = (Call)service.createCall();
} catch (ServiceException e) {
e.printStackTrace();
}
try {
call.setTargetEndpointAddress("http://teacode.xhnw.com:8080/getteafarmer.asmx");
call.setOperationName("GetTeaFarmerByCode");
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://teacode.xhnw.com:8080/GetTeaFarmerByCode");
result = (String)call.invoke(new Object[]{"1461754","457898121455",""});
} catch (RemoteException e) {
e.printStackTrace();
}
System.out.println(result);
}请帮我看看 里面的几个参数该怎么写? 万分感激!
POST /getteafarmer.asmx HTTP/1.1
Host: teacode.xhnw.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://teacode.xhnw.com:8080/GetTeaFarmerByCode"<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetTeaFarmerByCode xmlns="http://teacode.xhnw.com:8080/">
<strNo>string</strNo>
<strCode>string</strCode>
<strCRC>string</strCRC>
</GetTeaFarmerByCode>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetTeaFarmerByCodeResponse xmlns="http://teacode.xhnw.com:8080/">
<GetTeaFarmerByCodeResult>string</GetTeaFarmerByCodeResult>
</GetTeaFarmerByCodeResponse>
</soap:Body>
</soap:Envelope>
下面是我在网上找的调用方法public static void getAxisService(){
Service service = new Service();
Call call = null;
String result = null;
try {
call = (Call)service.createCall();
} catch (ServiceException e) {
e.printStackTrace();
}
try {
call.setTargetEndpointAddress("http://teacode.xhnw.com:8080/getteafarmer.asmx");
call.setOperationName("GetTeaFarmerByCode");
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://teacode.xhnw.com:8080/GetTeaFarmerByCode");
result = (String)call.invoke(new Object[]{"1461754","457898121455",""});
} catch (RemoteException e) {
e.printStackTrace();
}
System.out.println(result);
}请帮我看看 里面的几个参数该怎么写? 万分感激!
什么参数?下面的java代码提出一个方法不可以吗?