html – SAXException:错误的信封标记

html – SAXException:错误的信封标记,第1张

概述我正在尝试连接到通过Web服务客户端保护的Web服务https. Eclipse生成了一个基于存根的Web服务客户端,对我来说很好看.当我尝试从webservice调用方法时出现问题: String a = (String)webservice.userProfileServices(xml); 我还使用以下SOAP标头: esgGatewayPort = (new EsgGatewayLocat 我正在尝试连接到通过Web服务客户端保护的Web服务https. Eclipse生成了一个基于存根的Web服务客户端,对我来说很好看.当我尝试从webservice调用方法时出现问题:

String a = (String)webservice.userProfileServices(xml);

我还使用以下SOAP标头:

esgGatewayPort = (new EsgGatewayLocator()).getesgGatewayPort();//setting the authentication headerPrefixedQname name = new PrefixedQname("http://schemas.xmlsoap.org/ws/2002/07/secext","Security","wsse");System.out.println("Setting headers for authentication");org.apache.axis.message.soAPheaderElement sh = new org.apache.axis.message.soAPheaderElement(name);SOAPElement sub;try {      String clntUsername="myUser";      String clntPassword="myPassword";      sub = sh.addChildElement("UsernameToken");      SOAPElement element = sub.addChildElement("Username");      element.addTextNode(clntUsername);      element = sub.addChildElement("Password");      element.addTextNode(clntPassword);      ((org.apache.axis.clIEnt.Stub) esgGatewayPort).setheader(sh);} catch (SOAPException e) {      e.printstacktrace();}

我收到以下内容:

AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode:  faultString: org.xml.sax.SAXException: Bad envelope tag:  HTML faultActor:  faultNode:  faultDetail:     {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Bad envelope tag:  HTML    at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:71)    at org.apache.axis.enCoding.DeserializationContext.startElement(DeserializationContext.java:1048)    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(UnkNown Source)    at com.sun.org.apache.xerces.internal.impl.XMLNSdocumentScannerImpl.scanStartElement(UnkNown Source)    at com.sun.org.apache.xerces.internal.impl.XMLNSdocumentScannerImpl$NSContentDriver.scanRootElementHook(UnkNown Source)    at com.sun.org.apache.xerces.internal.impl.XMLdocumentFragmentScannerImpl$FragmentContentDriver.next(UnkNown Source)    at com.sun.org.apache.xerces.internal.impl.XMLdocumentScannerImpl$PrologDriver.next(UnkNown Source)    at com.sun.org.apache.xerces.internal.impl.XMLdocumentScannerImpl.next(UnkNown Source)    at com.sun.org.apache.xerces.internal.impl.XMLNSdocumentScannerImpl.next(UnkNown Source)    at com.sun.org.apache.xerces.internal.impl.XMLdocumentFragmentScannerImpl.scandocument(UnkNown Source)    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(UnkNown Source)    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(UnkNown Source)    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(UnkNown Source)    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(UnkNown Source)    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(UnkNown Source)    at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133)    at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:153)    at javax.xml.parsers.SAXParser.parse(UnkNown Source)    at org.apache.axis.enCoding.DeserializationContext.parse(DeserializationContext.java:227)    at org.apache.axis.soAPPart.getAsSOAPEnvelope(SOAPPart.java:696)    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)    at org.apache.axis.transport.http.httpSender.readFromSocket(httpSender.java:796)    at org.apache.axis.transport.http.httpSender.invoke(httpSender.java:144)    at org.apache.axis.strategIEs.InvocationStrategy.visit(InvocationStrategy.java:32)    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)    at org.apache.axis.clIEnt.AxisClIEnt.invoke(AxisClIEnt.java:165)    at org.apache.axis.clIEnt.Call.invokeEngine(Call.java:2784)    at org.apache.axis.clIEnt.Call.invoke(Call.java:2767)    at org.apache.axis.clIEnt.Call.invoke(Call.java:2443)    at org.apache.axis.clIEnt.Call.invoke(Call.java:2366)    at org.apache.axis.clIEnt.Call.invoke(Call.java:1812)

任何帮助将得到真正的赞赏.

解决方法 端点格式错误

例如:http://localhost:8080/YourService/

例如:http://localhost:8080/YourService?wsdl

更正端点格式以设置构造函数

例如:http://localhost:8080/YourService

总结

以上是内存溢出为你收集整理的html – SAXException:错误的信封标记全部内容,希望文章能够帮你解决html – SAXException:错误的信封标记所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1069109.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存