java 调用 .net的web service出错(在线等)

ywh005 ywh005 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

我用java写客户端调用asp的WEB SERVICE,
ASP的 web service在这里:
http://www.fundxy.com/public/fundvalueapi.htm

下面是我的代码:


//AXIS 代码
try {

Integer i = new Integer(1);

Integer j = new Integer(0);
Integer z = new Integer(0);

String endpoint="http://www.fundxy.com/fundxy/Common/FundxyService.asmx ";



Service service = new Service();

Call call = (Call)service.createCall();



call.setTargetEndpointAddress(new java.net.URL(endpoint));

call.setOperationName(new QName("http://www.fundxy.com";,"GetNewFundValue"));//请问一下,前面的http://www.fundxy.com这个值怎么写??我在它提供的文档中没找到



call.addParameter("FundType",org.apache.axis.encoding.XMLType.XSD_DATE,javax.xml.rpc.ParameterMode.IN);

call.addParameter("SortType",org.apache.axis.encoding.XMLType.XSD_DATE,javax.xml.rpc.ParameterMode.IN);
call.addParameter("AscFlag",org.apache.axis.encoding.XMLType.XSD_DATE,javax.xml.rpc.ParameterMode.IN);

call.setReturnType(org.apache.axis.encoding.XMLType.XSD_INT);

call.setUseSOAPAction(true);

call.setSOAPActionURI("http://www.fundxy.com");//请问这个地方我写什么?好像在asp文档中没有找到





List k = (List)call.invoke(new Object[]{i,j,z});



System.out.println( "result is " + k.toString() + ".");

}

catch (Exception e) {System.err.println(e.toString());}

}

结果报错:服务器未能识别 HTTP 头 SOAPAction 的值:http://www.fundxy.com

大家说说,我怎么知道web service那边的名字空间?
怎么样能成功。谢谢了
...全文
评论 13
收藏 已收藏
分享
返回顶部
ywh005
Java EE 67,535 成员 225,843 内容