Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is the web service:TraditionalSimplifiedWebService[^]
e,I input the parameter named sText 冯小刚,and it return the right result <string xmlns="http://webxml.com.cn/">馮小剛.But when I write the code,it return null.What's wrong with my code?

Java
String endpoint="http://www.webxml.com.cn/WebServices/TraditionalSimplifiedWebService.asmx?wsdl";
				String namespaceurl="http://www.webxml.com.cn/";
				Service service = new Service();
				Call call = (Call) service.createCall();
				call.setTargetEndpointAddress(endpoint);
				 call.setOperationName("toTraditionalChinese"); 
	            call.addParameter("sText",XMLType.SOAP_STRING, ParameterMode.IN);
	             call.setUseSOAPAction(true);
	            call.setSOAPActionURI("http://webxml.com.cn/toTraditionalChinese");
				 call.setReturnType(XMLType.SOAP_STRING);
				String userID="";String sText="冯小刚";
				 Object[] obj = {sText};
				try {
					String result =(String)call.invoke(obj);
					System.out.println(result);
				} catch (RemoteException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
Posted
Updated 31-Jan-16 6:58am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900