调用webservice出错。。。。在线等待高手

王者天下ii 2013-11-07 02:08:04
完整类;
package com.creaway.blackout.schedule;

import java.net.MalformedURLException;
import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;
import javax.xml.namespace.QName;

public class test {

static org.apache.axis.client.Call call=null;
static java.net.URL url=null;
static Object o = null;

static{
try {
url=new java.net.URL("http://10.96.0.216:9734/2EC66A60-24CF-0131-983C-00505696004F?wsdl");
} catch (MalformedURLException e) {
e.printStackTrace();
}
}


//调用接口
public static String getjkXML(String strXML){
try {
org.apache.axis.client.Service service =new org.apache.axis.client.Service();
call = (org.apache.axis.client.Call) service.createCall();
call.setTargetEndpointAddress(url);
call.setOperationName(new QName("http://www.tbi.ydtf.com.cn/","exec"));
call.addParameter("Request", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_STRING);
o = call.invoke(new Object[]{strXML});
System.out.println(o);
} catch (ServiceException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
return o.toString();
}

public static void main(String[] args) {
String strXML="<?xml version="1.0" encoding="UTF-8"?><RESULT><ZDHXXS><ZDHXX><DYBM>182</DYBM><TDJSRQ>20131106</TDJSRQ><SBBH>10000790</SBBH><JLDH>8077214</JLDH><XLBH>14584</XLBH><TDKSRQ>20131106</TDKSRQ><TDJSSJ>073000</TDJSSJ><YHBH>3000232264</YHBH><TDXC>1</TDXC><TDSC>270</TDSC><JGBM>302</JGBM><ZDBH>63000458</ZDBH><TDKSSJ>030000</TDKSSJ><SBBZ>2</SBBZ><PCBH>520</PCBH></ZDHXX><RECORDCOUNT>1</RECORDCOUNT></ZDHXXS></RESULT>";
System.out.println(getjkXML(strXML));
}
}
错误信息:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Bad envelope tag: definitions
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:71)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
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.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
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)
at com.creaway.blackout.schedule.test.getjkXML(test.java:33)
at com.creaway.blackout.schedule.test.main(test.java:45)

{http://xml.apache.org/axis/}hostname:chuangwe-c432c6

org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
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)
at com.creaway.blackout.schedule.test.getjkXML(test.java:33)
at com.creaway.blackout.schedule.test.main(test.java:45)
Caused by: org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:71)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
... 10 more
Exception in thread "main" java.lang.NullPointerException
at com.creaway.blackout.schedule.test.getjkXML(test.java:40)
at com.creaway.blackout.schedule.test.main(test.java:45)
...全文
1258 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
bantia 2016-01-08
  • 打赏
  • 举报
回复
引用 20 楼 yan470925731 的回复:
[quote=引用 18 楼 u010327503 的回复:] [quote=引用 15 楼 yan470925731 的回复:] [quote=引用 13 楼 u010327503 的回复:] 试一下调用getjkXML()方法不带参数,把o = call.invoke(new Object[]{strXML}); 改成 String temp = "测试";String o = (String)call.invoke(new Object[]{temp}); 看看结果会怎样
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.同样的错[/quote]call.addParameter("Request", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);这句是接口的参数,但是不知道你的Request是什么。[/quote] 哥门谢谢,就是这个问题,类型不对[/quote] 楼主,哪块的类型不对,是调用接口传的参数类型不对吗?
Jason_ho 2013-11-07
  • 打赏
  • 举报
回复
引用 21 楼 yan470925731 的回复:
[quote=引用 18 楼 u010327503 的回复:] [quote=引用 15 楼 yan470925731 的回复:] [quote=引用 13 楼 u010327503 的回复:] 试一下调用getjkXML()方法不带参数,把o = call.invoke(new Object[]{strXML}); 改成 String temp = "测试";String o = (String)call.invoke(new Object[]{temp}); 看看结果会怎样
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.同样的错[/quote]call.addParameter("Request", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);这句是接口的参数,但是不知道你的Request是什么。[/quote] 分数送上[/quote]哈哈 我这算是误打误撞得到分数吗
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 18 楼 u010327503 的回复:
[quote=引用 15 楼 yan470925731 的回复:] [quote=引用 13 楼 u010327503 的回复:] 试一下调用getjkXML()方法不带参数,把o = call.invoke(new Object[]{strXML}); 改成 String temp = "测试";String o = (String)call.invoke(new Object[]{temp}); 看看结果会怎样
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.同样的错[/quote]call.addParameter("Request", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);这句是接口的参数,但是不知道你的Request是什么。[/quote] 分数送上
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 18 楼 u010327503 的回复:
[quote=引用 15 楼 yan470925731 的回复:] [quote=引用 13 楼 u010327503 的回复:] 试一下调用getjkXML()方法不带参数,把o = call.invoke(new Object[]{strXML}); 改成 String temp = "测试";String o = (String)call.invoke(new Object[]{temp}); 看看结果会怎样
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.同样的错[/quote]call.addParameter("Request", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);这句是接口的参数,但是不知道你的Request是什么。[/quote] 哥门谢谢,就是这个问题,类型不对
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
<wsdl:part name="Request" type="xsd:anyType" /> Request 是别人定义的参数,就是接口exec(String Request)
引用 18 楼 u010327503 的回复:
[quote=引用 15 楼 yan470925731 的回复:] [quote=引用 13 楼 u010327503 的回复:] 试一下调用getjkXML()方法不带参数,把o = call.invoke(new Object[]{strXML}); 改成 String temp = "测试";String o = (String)call.invoke(new Object[]{temp}); 看看结果会怎样
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.同样的错[/quote]call.addParameter("Request", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);这句是接口的参数,但是不知道你的Request是什么。[/quote]
Jason_ho 2013-11-07
  • 打赏
  • 举报
回复
引用 15 楼 yan470925731 的回复:
[quote=引用 13 楼 u010327503 的回复:] 试一下调用getjkXML()方法不带参数,把o = call.invoke(new Object[]{strXML}); 改成 String temp = "测试";String o = (String)call.invoke(new Object[]{temp}); 看看结果会怎样
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.同样的错[/quote]call.addParameter("Request", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);这句是接口的参数,但是不知道你的Request是什么。
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 12 楼 etfired 的回复:

<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://passage.soap.infrastructure.dls.fytech.net/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="passage" targetNamespace="http://passage.soap.infrastructure.dls.fytech.net/">
  <wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://passage.soap.infrastructure.dls.fytech.net/" elementFormDefault="unqualified" targetNamespace="http://passage.soap.infrastructure.dls.fytech.net/" version="1.0">
<xs:element name="casLogin" type="tns:casLogin"/>
<xs:element name="casLoginResponse" type="tns:casLoginResponse"/>
<xs:element name="logout" type="tns:logout"/>
<xs:element name="logoutResponse" type="tns:logoutResponse"/>
<xs:complexType name="casLogin">
    <xs:sequence>
      <xs:element minOccurs="0" name="arg0" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
<xs:complexType name="casLoginResponse">
    <xs:sequence>
      <xs:element minOccurs="0" name="return" type="tns:passageDTO"/>
    </xs:sequence>
  </xs:complexType>
<xs:complexType name="passageDTO">
    <xs:sequence>
      <xs:element name="admin" type="xs:boolean"/>
      <xs:element minOccurs="0" name="applicationId" type="xs:string"/>
      <xs:element minOccurs="0" name="code" type="xs:string"/>
      <xs:element minOccurs="0" name="email" type="xs:string"/>
      <xs:element minOccurs="0" name="environmentId" type="xs:string"/>
      <xs:element minOccurs="0" name="environmentName" type="xs:string"/>
      <xs:element minOccurs="0" name="groupId" type="xs:string"/>
      <xs:element minOccurs="0" name="id" type="xs:string"/>
      <xs:element minOccurs="0" name="name" type="xs:string"/>
      <xs:element minOccurs="0" name="orgName" type="xs:string"/>
      <xs:element minOccurs="0" name="password" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
<xs:complexType name="logout">
    <xs:sequence>
      <xs:element minOccurs="0" name="arg0" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
<xs:complexType name="logoutResponse">
    <xs:sequence/>
  </xs:complexType>
</xs:schema>
  </wsdl:types>
  <wsdl:message name="casLoginResponse">
    <wsdl:part element="tns:casLoginResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="logout">
    <wsdl:part element="tns:logout" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="casLogin">
    <wsdl:part element="tns:casLogin" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="logoutResponse">
    <wsdl:part element="tns:logoutResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="IPassageSOAPService">
    <wsdl:operation name="casLogin">
      <wsdl:input message="tns:casLogin" name="casLogin">
    </wsdl:input>
      <wsdl:output message="tns:casLoginResponse" name="casLoginResponse">
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="logout">
      <wsdl:input message="tns:logout" name="logout">
    </wsdl:input>
      <wsdl:output message="tns:logoutResponse" name="logoutResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="passageSoapBinding" type="tns:IPassageSOAPService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="casLogin">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="casLogin">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="casLoginResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="logout">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="logout">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="logoutResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="passage">
    <wsdl:port binding="tns:passageSoapBinding" name="IPassageSOAPServicePort">
      <soap:address location="http://demo.crd.fytech.net/dls/services/passageLogin"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
这是一份WSDL,由CXF生成出来的,刚好

<soap:address location="http://demo.crd.fytech.net/dls/services/passageLogin"/>
指向的正是Endpoint
不明白,能不能说清楚点,第一次搞这个
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 14 楼 s346658910 的回复:
[quote=引用 9 楼 yan470925731 的回复:] [quote=引用 8 楼 etfired 的回复:] 你用的XFire还是CXF的框架??还是其他? wsdl是给webservice工具使用的,其作用是用来生成代码,不同的工具生成出来的代码打包后可以当作工具类来使用,直接使用wsdl是不能作为WebService的访问地址的。 Endpoint在WSDL中会有描述,但是非常不好读,毕竟它只是一份说明文件,如果LZ用的是CXF,可以尝试用他的工具接续wsdl导出代码,如果WebService是你自己写的话,看你的配置中的Endpoint地址是多少
wsdl我早去了,看看中间帖子在发表[/quote] 表示楼主态度有问题[/quote] 什么事情不先都了解下,就发表。那凉快那呆着
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 13 楼 u010327503 的回复:
试一下调用getjkXML()方法不带参数,把o = call.invoke(new Object[]{strXML}); 改成 String temp = "测试";String o = (String)call.invoke(new Object[]{temp}); 看看结果会怎样
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.同样的错
知风23_ 2013-11-07
  • 打赏
  • 举报
回复
引用 9 楼 yan470925731 的回复:
[quote=引用 8 楼 etfired 的回复:] 你用的XFire还是CXF的框架??还是其他? wsdl是给webservice工具使用的,其作用是用来生成代码,不同的工具生成出来的代码打包后可以当作工具类来使用,直接使用wsdl是不能作为WebService的访问地址的。 Endpoint在WSDL中会有描述,但是非常不好读,毕竟它只是一份说明文件,如果LZ用的是CXF,可以尝试用他的工具接续wsdl导出代码,如果WebService是你自己写的话,看你的配置中的Endpoint地址是多少
wsdl我早去了,看看中间帖子在发表[/quote] 表示楼主态度有问题
Jason_ho 2013-11-07
  • 打赏
  • 举报
回复
试一下调用getjkXML()方法不带参数,把o = call.invoke(new Object[]{strXML}); 改成 String temp = "测试";String o = (String)call.invoke(new Object[]{temp}); 看看结果会怎样
etfired 2013-11-07
  • 打赏
  • 举报
回复

<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://passage.soap.infrastructure.dls.fytech.net/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="passage" targetNamespace="http://passage.soap.infrastructure.dls.fytech.net/">
  <wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://passage.soap.infrastructure.dls.fytech.net/" elementFormDefault="unqualified" targetNamespace="http://passage.soap.infrastructure.dls.fytech.net/" version="1.0">
<xs:element name="casLogin" type="tns:casLogin"/>
<xs:element name="casLoginResponse" type="tns:casLoginResponse"/>
<xs:element name="logout" type="tns:logout"/>
<xs:element name="logoutResponse" type="tns:logoutResponse"/>
<xs:complexType name="casLogin">
    <xs:sequence>
      <xs:element minOccurs="0" name="arg0" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
<xs:complexType name="casLoginResponse">
    <xs:sequence>
      <xs:element minOccurs="0" name="return" type="tns:passageDTO"/>
    </xs:sequence>
  </xs:complexType>
<xs:complexType name="passageDTO">
    <xs:sequence>
      <xs:element name="admin" type="xs:boolean"/>
      <xs:element minOccurs="0" name="applicationId" type="xs:string"/>
      <xs:element minOccurs="0" name="code" type="xs:string"/>
      <xs:element minOccurs="0" name="email" type="xs:string"/>
      <xs:element minOccurs="0" name="environmentId" type="xs:string"/>
      <xs:element minOccurs="0" name="environmentName" type="xs:string"/>
      <xs:element minOccurs="0" name="groupId" type="xs:string"/>
      <xs:element minOccurs="0" name="id" type="xs:string"/>
      <xs:element minOccurs="0" name="name" type="xs:string"/>
      <xs:element minOccurs="0" name="orgName" type="xs:string"/>
      <xs:element minOccurs="0" name="password" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
<xs:complexType name="logout">
    <xs:sequence>
      <xs:element minOccurs="0" name="arg0" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
<xs:complexType name="logoutResponse">
    <xs:sequence/>
  </xs:complexType>
</xs:schema>
  </wsdl:types>
  <wsdl:message name="casLoginResponse">
    <wsdl:part element="tns:casLoginResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="logout">
    <wsdl:part element="tns:logout" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="casLogin">
    <wsdl:part element="tns:casLogin" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="logoutResponse">
    <wsdl:part element="tns:logoutResponse" name="parameters">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="IPassageSOAPService">
    <wsdl:operation name="casLogin">
      <wsdl:input message="tns:casLogin" name="casLogin">
    </wsdl:input>
      <wsdl:output message="tns:casLoginResponse" name="casLoginResponse">
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="logout">
      <wsdl:input message="tns:logout" name="logout">
    </wsdl:input>
      <wsdl:output message="tns:logoutResponse" name="logoutResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="passageSoapBinding" type="tns:IPassageSOAPService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="casLogin">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="casLogin">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="casLoginResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="logout">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="logout">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="logoutResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="passage">
    <wsdl:port binding="tns:passageSoapBinding" name="IPassageSOAPServicePort">
      <soap:address location="http://demo.crd.fytech.net/dls/services/passageLogin"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
这是一份WSDL,由CXF生成出来的,刚好

<soap:address location="http://demo.crd.fytech.net/dls/services/passageLogin"/>
指向的正是Endpoint
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 10 楼 etfired 的回复:
不是让你去掉wsdl,你用你的WEbService框架的工具去解析wsdl,生成出源代码来
试下吧,不知道怎么搞
etfired 2013-11-07
  • 打赏
  • 举报
回复
不是让你去掉wsdl,你用你的WEbService框架的工具去解析wsdl,生成出源代码来
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 8 楼 etfired 的回复:
你用的XFire还是CXF的框架??还是其他? wsdl是给webservice工具使用的,其作用是用来生成代码,不同的工具生成出来的代码打包后可以当作工具类来使用,直接使用wsdl是不能作为WebService的访问地址的。 Endpoint在WSDL中会有描述,但是非常不好读,毕竟它只是一份说明文件,如果LZ用的是CXF,可以尝试用他的工具接续wsdl导出代码,如果WebService是你自己写的话,看你的配置中的Endpoint地址是多少
wsdl我早去了,看看中间帖子在发表
etfired 2013-11-07
  • 打赏
  • 举报
回复
你用的XFire还是CXF的框架??还是其他? wsdl是给webservice工具使用的,其作用是用来生成代码,不同的工具生成出来的代码打包后可以当作工具类来使用,直接使用wsdl是不能作为WebService的访问地址的。 Endpoint在WSDL中会有描述,但是非常不好读,毕竟它只是一份说明文件,如果LZ用的是CXF,可以尝试用他的工具接续wsdl导出代码,如果WebService是你自己写的话,看你的配置中的Endpoint地址是多少
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 6 楼 rui888 的回复:
你xml格式不对把 。我没法测试。给你个参照
你好,格式肯定是正确的
tony4geek 2013-11-07
  • 打赏
  • 举报
回复
你xml格式不对把 。我没法测试。给你个参照
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
有木有牛人啊?帮忙把类粘贴下去,跑下看看,帮忙调下,告诉问题所在,要有一个很有说服理问题所在的理由
王者天下ii 2013-11-07
  • 打赏
  • 举报
回复
引用 2 楼 td492162921 的回复:
1、先测试URL 是否正确。 2、如果正确的,把call.addParameter("Request", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.setReturnType(org.apache.axis.Constants.XSD_STRING); 这两行给注释掉 看看。
url正确,我给那个去了 org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384) at org.apache.axis.client.Call.invoke(Call.java:2467) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.creaway.blackout.schedule.test.getjkXML(test.java:34) at com.creaway.blackout.schedule.test.main(test.java:46) AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384) at org.apache.axis.client.Call.invoke(Call.java:2467) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.creaway.blackout.schedule.test.getjkXML(test.java:34) at com.creaway.blackout.schedule.test.main(test.java:46) {http://xml.apache.org/axis/}hostname:chuangwe-c432c6 org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.client.Call.invoke(Call.java:2470) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.creaway.blackout.schedule.test.getjkXML(test.java:34) at com.creaway.blackout.schedule.test.main(test.java:46) Caused by: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384) at org.apache.axis.client.Call.invoke(Call.java:2467) ... 4 more 出现了这个,说什么对象没被序列话,我那就是个字符串的XML形式上面代码中就有,为什么会出现这个
加载更多回复(3)

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧