初学axis2遇到的问题

1 目前对xml标准不太熟悉,包括xmln

2 在用java调用.net的ws时,出现了一个问题:

Exception in thread "main" org.apache.axis2.AxisFault: 服务器未能识别 HTTP 头 SOAPAction 的值: urn:anonOutInOp

上代码先

public class Client {
	public static void main(String args[]) throws Exception
	{
		RPCServiceClient client=new RPCServiceClient();
		Options options=client.getOptions();
		EndpointReference targetEPR = new EndpointReference("http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx");
		options.setTo(targetEPR);
		//options.setAction("http://WebXml.com.cn/getMobileCodeInfo");
		QName opGet=new QName("http://WebXml.com.cn","getMobileCodeInfo");
	
		Object[] optionsGet=new Object[]{"13426211225"};
		Class[] clazz=new Class[]{String.class};
		Object[] response=client.invokeBlocking(opGet, optionsGet, clazz);
		System.out.println(response[0]);
		
	}
}

 查看log,目前还是小白,不知道怎么看发出去的消息。。

DEBUG [main] (HttpConnection.java:692) - Open connection to webservice.webxml.com.cn:80
DEBUG [main] (Wire.java:70) - >> "POST /WebServices/MobileCodeWS.asmx HTTP/1.1[\r][\n]"
DEBUG [main] (HttpMethodBase.java:1352) - Adding Host request header
DEBUG [main] (Wire.java:70) - >> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
DEBUG [main] (Wire.java:70) - >> "SOAPAction: "urn:anonOutInOp"[\r][\n]"
DEBUG [main] (Wire.java:70) - >> "User-Agent: Axis2[\r][\n]"
DEBUG [main] (Wire.java:70) - >> "Host: webservice.webxml.com.cn[\r][\n]"
DEBUG [main] (Wire.java:70) - >> "Transfer-Encoding: chunked[\r][\n]"
DEBUG [main] (Wire.java:70) - >> "[\r][\n]"

 

写入了一个SOAPAction值,可能默认是urn:anonOutInOp?好像axis2支持8种消息方式?

你可能感兴趣的:(java,apache,xml,.net,webservice)