package test;
import java.net.URL;
import java.security.Security;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.encoding.XMLType;
import org.apache.axis.AxisProperties;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis2.client.Options;
import com.chinacreator.online.comm.Global;
import com.chinacreator.online.webserviceclient.CrmImplServiceStub;
/**
* 项目名称:online 类名称:FetionWebservice 类描述: 创建人:zhonglianghuang 创建时间:2012-8-10
* 下午12:52:28 修改人:zhonglianghuang 修改时间:2012-8-10 下午12:52:28 修改备注:
*
* @version
*
*/
public class FetionWebservice {
public void testFetionWebservice() {
String url = "http://211.138.224.60/online/services/FetionWebservice";
try {
AxisProperties.setProperty("http.proxyHost","172.16.33.11");
AxisProperties.setProperty("http.proxyPort","808");
AxisProperties.setProperty("http.proxyUser","");
AxisProperties.setProperty("http.proxyPassword","");
System.setProperty("javax.net.ssl.trustStore","d:/10086.truststore");
System.setProperty("javax.net.ssl.trustStorePassword", "111111");
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL("https://www.hn.10086.cn/online/services/FetionWebservice"));
call.setOperationName(new QName(url, "CreateConnection"));
//call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);
//call.setProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_SOAP_ACTION,"NameSoap");
call.setReturnType(new QName(url, "CreateConnection"), String.class);
call.addParameter(new QName(url, "cSeq"), XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter(new QName(url, "fetionId"), XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter(new QName(url, "telNumber"), XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter(new QName(url, "sessionId"), XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter(new QName(url, "accessType"), XMLType.XSD_STRING,
ParameterMode.IN);
call.addParameter(new QName(url, "message"), XMLType.XSD_STRING,
ParameterMode.IN);
String cSeq = "11111123";
String fetionId = "222222";
String telNumber = "18874273554";
String sessionId = "333333";
String accessType = "5";
String message="上鬼i和的风格和东风鬼i读后感";
String param[] = { cSeq, fetionId, telNumber, sessionId, accessType, message };
String result = (String) call.invoke(param);
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new FetionWebservice().testFetionWebservice();
}
}
- 1
- 2
- 3
- 4
- 5
前往页