webService 客户端调用及异常信息First Element must contain the local name, Envelope , but found definitions...

本文探讨了在调用WebService客户端时遇到的错误'First Element must contain the local name, Envelope, but found definitions'的原因。问题根源在于EndpointReference构造函数中使用的URL不正确。为解决此问题,建议检查并确保使用的URL指向有效的SOAP Envelope。" 107157073,8768333,使用jQuery和PHP构建实时搜索的Ajax网页,"['前端开发', 'PHP', '数据库', 'jQuery', 'Ajax']
摘要由CSDN通过智能技术生成

报错:“First Element must contain the local name, Envelope , but found definitions”;

 

原因:EndpointReference end = new EndpointReference(url) ,url错误;

 

源代码:

 1 import org.apache.axiom.om.OMAbstractFactory;
 2 import org.apache.axiom.om.OMElement;
 3 import org.apache.axiom.om.OMFactory;
 4 import org.apache.axiom.om.OMNamespace;
 5 import org.apache.axis2.AxisFault;
 6 import org.apache.axis2.addressing.EndpointReference; 7 import org.apache.axis2.client.Options; 8 import org.apache.axis2.client.ServiceClient; 9 10 public class Test { 11 public static void main(String[] args) throws AxisFault { 12 OMElement element = test("22","444","123"); 13  System.out.println(element.getText()); 14  } 15 16 private static OMElement test(String contractNo, String contractName, String auditMoney) thro
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值