package com.evergrandelife;
import java.io.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.XMLType;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
public class PolicyValidateServiceImplTestTuan {
	public static void main(String[] arg) throws Exception{
		/*<?xml version="1.0" encoding="utf-8"?>
		<LisCallRequest> 
		  <RequestHead> 
		    <AppId/>  
		    <Action/>  
		    <CheckDuplicate/>  
		    <TransactionId/>  
		    <Sync/>  
		    <CallTime/>  
		    <ClientId>CIR</ClientId>  
		    <ClientPassword/>  
		    <LanguageId/> 
		  </RequestHead>  
		  <RequestBody> 
		    <TranData> 
		      <Head> 
		        <TranDate/>  
		        <TranTime/>  
		        <TranCom/>  
		        <TranChannel/>  
		        <AgentCom/>  
		        <AgentCode/>  
		        <ManageCom/>  
		        <TranNo/>  
		        <ServiceId>COM-T0006-01</ServiceId> 
		      </Head>  
		      <Body> 
		        <reqData> 
		          <insuredFlag>03</insuredFlag>  
		          <idType>0101</idType>  
		          <customerId>420684198105150027</customerId>  
		          <minAmt>1000</minAmt>  
		          <lossDay>7</lossDay>  
		          <serialNo>000103201807091405514485</serialNo> 
		        </reqData> 
		      </Body> 
		    </TranData> 
		  </RequestBody> 
		</LisCallRequest>*/
		
		FileReader fr = new FileReader("e:\\PSV_validateTuan.xml");
		BufferedReader ss= new BufferedReader(fr);
		String message = "";  
		String line = null;  
		while((line = ss.readLine()) != null) {  
		    message += line;  
		}  
		ss.close();
		System.out.println(message);  
		
		//String xml = "{\"reqData\":{\"serialNo\":\"000103201807091405514485\",\"insuredFlag\":\"03\",\"idType\":\"0101\",\"customerId\":\"420684198105150027\",\"minAmt\":\"1000\",\"lossDay\":\"7\"}}";
		String xml = message;
		String returnxml="";
		try{
	//		String url = "http://10.163.47.31:2031/lis/services/InterfaceAdapterPortal?wsdl";//UAT
	//		String url = "http://plis.evergrandelife.com.cn/lis/services/InterfaceAdapterPortal?wsdl";//PRO
			String url = "http://10.163.1.17/lis/services/InterfaceAdapterPortal?wsdl";//PRO
			//url = "http://10.163.91.33:7132/lis/services/InterfaceAdapterPortal?wsdl";//个险预演
			//url = "http://10.163.91.9:7002/lis/services/ServerForSearchInterface?wsdl";//团险预演
			url = "http://10.163.91.10:7004/lis/services/ServerForSearchInterface?wsdl";// 团险预演
			//url = "http://10.155.66.59:8090/lis/services/InterfaceAdapterPortal?wsdl";//shixa
			org.apache.axis.client.Service service = new org.apache.axis.client.Service();
			Call call = (Call) service.createCall();
			call.setTargetEndpointAddress(url);
			call.setReturnType(XMLType.XSD_STRING);
			call.setOperationName("service");
			call.addParameter("inputXML", XMLType.XSD_STRING,
					ParameterMode.IN);
			returnxml= (String) call.invoke(new Object[] { xml });
			System.out.println(returnxml);
		}catch(Exception e){
			e.printStackTrace();
			//throw new Exception("请求个险核心webservice异常"+e);
		}
	}
	
}
原文:https://www.cnblogs.com/FHJKIUYTR2343455/p/13445144.html