webservice调用时怎么传参数

<?xml version="1.0" encoding="UTF-8"?>

-

-

-xsd:schema

/xsd:schema

-

-

-

-

-

-

-

-

-

-

下面是我的调用代码:

 Service service = new Service();
        Call call = (Call) service.createCall();
        String url = "http://192.1.1.64:8082/Service/ServiceHello?wsdl";
        call.setTargetEndpointAddress(url);
        call.setOperationName(new QName("http://webservice_302/", "getValue"));
        call.addParameter(new QName("http://webservice_302/", "name"), org.apache.axis.encoding.XMLType.XSD_STRING,
                javax.xml.rpc.ParameterMode.IN);
        call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
        String result = (String) call.invoke(new String[] { "11" });
        System.out.println(result);

下面是接口的方法点:

 public String getValue(String name){
        return "欢迎你! "+name;
    }

可以成功调用,返回结果是:欢迎你! null

说明参数没有传进去,请问这里我应该怎么写呢?

5个回答

入参类型应该是org.apache.axis.Constants.XSD_STRING,不认为是org.apache.axis.encoding.XMLType.XSD_STRING

zhao5243
深爱甜蜜 额,点采纳点错了。
大约一年之前 回复
zhao5243
深爱甜蜜 换了你的试了下还是不行。
大约一年之前 回复

<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. --><!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice_302/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice_302/" name="HelloService">
<types>
<xsd:schema>
<xsd:import namespace="http://webservice_302/" schemaLocation="http://192.1.1.64:8082/Service/ServiceHello?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="getValue">
<part name="parameters" element="tns:getValue"></part>
</message>
<message name="getValueResponse">
<part name="parameters" element="tns:getValueResponse"></part>
</message>
<portType name="Hello">
<operation name="getValue">
<input wsam:Action="http://webservice_302/Hello/getValueRequest" message="tns:getValue"></input>
<output wsam:Action="http://webservice_302/Hello/getValueResponse" message="tns:getValueResponse"></output>
</operation>
</portType>
<binding name="HelloPortBinding" type="tns:Hello">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<operation name="getValue">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="HelloService">
<port name="HelloPort" binding="tns:HelloPortBinding">
<soap:address location="http://192.1.1.64:8082/Service/ServiceHello"></soap:address>
</port>
</service>
</definitions>

public static String rpcCall(String serverName, Object[] parameters) throws AxisFault {
RPCServiceClient serviceClient = new RPCServiceClient();
EndpointReference targetEPR = new EndpointReference(Constant.WEB_SERVICE_WSDL_URL);
Options options = serviceClient.getOptions();
options.setManageSession(true);
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,true);
options.setTo(targetEPR);
options.setAction("urn:"+serverName);
QName qname = new QName(Constant.NAME_SPACE, serverName);
OMElement element = serviceClient.invokeBlocking(qname, parameters);
String result = element.getFirstElement().getText();
serviceClient.cleanupTransport();
return result;
}

zhao5243
深爱甜蜜 谢谢,不过我希望是在我的代码基础上改。你这个改动太大了,完全不一样啊。
大约一年之前 回复

/**
* 服务调用
* @param serverName 服务名称
* @param parameters 业务参数(接口中规定的方法的参数)
* @return
* @throws AxisFault
*/
public static String rpcCall(String serverName, Object[] parameters) throws AxisFault {
//使用rpc方式调用webService
RPCServiceClient serviceClient = new RPCServiceClient();
//调用指定webService的url
EndpointReference targetEPR = new EndpointReference(Constant.WEB_SERVICE_WSDL_URL);
Options options = serviceClient.getOptions();
//客户端开启session对话管理
options.setManageSession(true);
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,true);
//确定目标服务地址
options.setTo(targetEPR);
//确定调用方法
options.setAction("urn:"+serverName);
//指定接口的命名空间和调用的方法名
QName qname = new QName(Constant.NAME_SPACE, serverName);
//调用方法传递参数 调用服务 获取服务返回的结果集
OMElement element = serviceClient.invokeBlocking(qname, parameters);
//返回结果就是由一段OMElement对象封装的xml字符串
//我们可以对之灵活应用,下面我取第一个元素值,并打印之,因为调用的方法返回一个结果
String result = element.getFirstElement().getText();
serviceClient.cleanupTransport();
return result;
}

qq_35280588
qq_35280588 回复zhao5243: 哦哦,没事,问题解决就行,很高兴能帮到你。
10 个月之前 回复
zhao5243
深爱甜蜜 按照你的方法解决了,谢谢。但是点采纳点错了,不好意思啊。
大约一年之前 回复
qq_35280588
qq_35280588 回复zhao5243: https://bbs.csdn.net/topics/391904524
大约一年之前 回复
zhao5243
深爱甜蜜 回复qq_35280588: 报错,Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
大约一年之前 回复
qq_35280588
qq_35280588 回复zhao5243: import org.apache.axiom.om.OMElement; import org.apache.axis2.AxisFault; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; import org.apache.axis2.rpc.client.RPCServiceClient; import org.apache.axis2.transport.http.HTTPConstants; import javax.xml.namespace.QName;
大约一年之前 回复
qq_35280588
qq_35280588 回复zhao5243: 其实写在配置文件里更好,方便后期维护
大约一年之前 回复
qq_35280588
qq_35280588 回复zhao5243: 自己定义的一个类,我是把wsdl地址,name_space,用户名,密码,都写在了这个类里,
大约一年之前 回复
zhao5243
深爱甜蜜 那个,Constant是哪个包的?
大约一年之前 回复

https://download.csdn.net/download/qq_34346915/10593706 里面有全套的接口生成以及调用

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Xfire webService调用时报错
代码片段rnclient=new Client(new URL(url));rnObject[] obj =client.invoke("getResult", new Object[]userName,pwd,sourcecode,xmlParameter.toString().getBytes());rn代码执行到这个Invoke的时候报错:rnException in thread "main" org.codehaus.xfire.fault.XFireFault: [B cannot be cast to javax.activation.DataHandlerrn at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)rn at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:83)rn at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)rn at org.codehaus.xfire.client.Client.invoke(Client.java:336)rn at org.codehaus.xfire.client.Client.invoke(Client.java:368)rn at com.hirisun.webService.WebServiceUtil.getResult(WebServiceUtil.java:56)rn at com.hirisun.webService.Test2.main(Test2.java:45)rnCaused by: java.lang.ClassCastException: [B cannot be cast to javax.activation.DataHandlerrn at org.codehaus.xfire.aegis.type.mtom.DataHandlerType.createAttachment(DataHandlerType.java:18)rn at org.codehaus.xfire.aegis.type.mtom.AbstractXOPType.writeObject(AbstractXOPType.java:89)rn at org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(AegisBindingProvider.java:229)rn at org.codehaus.xfire.service.binding.AbstractBinding.writeParameter(AbstractBinding.java:273)rn at org.codehaus.xfire.service.binding.WrappedBinding.writeMessage(WrappedBinding.java:90)rn at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:80)rn at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:56)rn at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.getByteArrayRequestEntity(CommonsHttpMessageSender.java:422)rn at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:360)rn at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:123)rn at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)rn at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)rn at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)rn at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)rn求高手帮忙看看是为什么,我传入BYTE数组的时候就会出现这个错误
WebService调用时标准代码
public class WebServiceClient { public static void main(String[] args) throws Exception { String targetEendPoint = &quot;url&quot;;//测试地址 String param = &quot;&amp;lt;...&amp;gt;&amp;lt;/...&amp;gt;&quot;;测试报文 Service service =...
webService客户端调用时错误
Exception in thread "main" AxisFaultrn faultCode: http://schemas.xmlsoap.org/soap/envelope/Server.generalExceptionrn faultSubcode: rn faultString: No operation name specified!rn faultActor: rn faultNode: rn faultDetail: rn http://xml.apache.org/axis/stackTrace:No operation name specified!rn at org.apache.axis.client.Call.invoke(Call.java:1809)rn at org.apache.ws.test.Test.main(Test.java:33)rnrn http://xml.apache.org/axis/hostname:solargiant-PCrnrnNo operation name specified!rn at org.apache.axis.client.Call.invoke(Call.java:1809)rn at org.apache.ws.test.Test.main(Test.java:33)
webservice 客户端调用时慢时快
用xfire写的webservice服务端,客户端在调用的时候每次客户端显示第一调用很慢,后来就快了。但如果客户端隔一段时间再调用第一次又会很慢。用工具抓了一下底层tcp报文,发现服务器和客户端建立连接都很快,主要是在服务端收到客户端请求后触发webservice方法的时候慢,而webservice方法的内部处理逻辑也是很快了。看了网上的一些说明,说webservice在第一次调用的时候才编译虚拟机代码,缓存起来,所以才造成第一次调用很慢,但隔一端时间调用又慢是什么原因呢?难道时缓存失效造成的?如何解决,那位大侠碰到过类似的情况可否讨论一下?rnwebsevice本身就不是一个效率很高的东西,对于实时性要求特别的搞的需求就不应该用它,NND现在什么鸟规范都是webservice。
关于WebService调用时随机出错的问题
服务器及开发环境:Win2008+IIS7+VS2008rnrn近期在做一个Winform+WebService的项目。Winfrom和WebService及数据库访问主要用了实体DataSet,rn从而导致Web服务器内存不停上涨,导致占用大量内存。现在已经想办法将DataSet进行了Dispose,rn似乎比以前要好了点。可是还存在一个很诡异的问题,已经把我块折磨的不行了,跪求各位大虾帮忙。rnrnWeb服务器2G内存,w3wp.exe进程占用到800M内存左右的时候,WebService就工作不正常了,而且是rn说不准是哪一个,随机的会出现错误。导致客户端访问WebService出错。rnWinForm这边会看到如下错误:rn响应消息的内容类型 text/html; charset=utf-8 与绑定(text/xml; charset=utf-8)的内容类型不匹配。如果使用自定义编码器,请确保正确实现 IsContentTypeSupported 方法。rnrn然后到IIS查看失败请求跟踪的日志,里面的错误是(好像是内部500错误):rnUrl http://10.167.18.219:80/asmx/M30/M3010/M301020.asmx rnApp Pool HSIT rnAuthentication anonymous rnUser from token NT AUTHORITY\IUSR rnActivity ID 00000000-0000-0000-0B02-0080010000FA rnSite 2 rnProcess 6096 rnFailure Reason STATUS_CODE rnTrigger Status 500 rnFinal Status 500 rnTime Taken 280 msec rnrn其他错误日志:rn94. r MODULE_SET_RESPONSE_ERROR_STATUSrnWarning ModuleName="ManagedPipelineHandler", Notification="MAP_REQUEST_HANDLER", HttpStatus="500", HttpReason="Internal Server Error", HttpSubStatus="0", ErrorCode="操作成功完成。rn (0x0)", ConfigExceptionInfo="" rnrn还有:rn="rn rn 运行时错误rn rn rnrn rnrn “/”应用程序中的服务器错误。 rnrn 运行时错误 rnrn rnrn 说明: 服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看应用程序错误的详细信息(出于安全原因)。但可以通过在本地服务器计算机上运行的浏览器查看。rn rnrn 详细信息: 若要使他人能够在远程计算机上查看此特定错误消息的详细信息,请在位于当前 Web 应用程序根目录下的“web.config”配置文件中创建一个 标记。然后应将此 标记的“mode”属性设置为“Off”。 rnrn rn rn rn rnrnrnrnrn rn rn rnrnrn rn rn rnrn rnrn 注释: 通过修改应用程序的 配置标记的“defaultRedirect”属性,使之指向自定义错误页的 URL,可以用自定义错误页替换所看到的当前错误页。 rnrn rn rn rn rnrnrnrnrn rn rn rnrnrn rn rn rnrn rnrn rnrnrnrn可WebConfig中将customErrors mode改成OFF,还是remoteonly,错误仍然继续。rnrn比较诡异的是每次内存占用到800M左右,就会有这种问题出现,而且具体是哪一个WebService说不准,都是随机的。rn但是在IIS管理器里面进行手动回收,内存占用量下去以后,就又正常了。各位大虾有没有遇到类似情况,或者给rn小弟指点以下迷津,谢谢拉!!!rnrn注:用另外一台性能超好的服务器16G内存,w3wp.exe进程占用到1.8G都没有这种问题,而且到1.8G以后好像也不太怎么rn往上涨了。rn
WebService调用时一个很棘手的问题
需求:webService中实现会话的管理和状态保存?rnrn具体问题描述:rnrnWebService调用接口及其方法都写好了,但是客户端调用时的对象只是单个的方法,而我这里是一个完整的应用程序。当用户登rnrn陆时首先从客户端调用WebService服务端的方法,然后将登陆状态返回给客户端。登陆操作完毕后,我需要使用该帐号进行其它rnrn的操作,比如查看系统中的数据列表或者修改密码等。这些操作都需要检查用户是否有登陆状态即会话状态。rnrn而现在我却无法保存并获取到会话状态。各位路过时,请帮忙顶顶分析分析,在线等。首先谢谢各位了。
webservice调用时遇到的奇葩问题
严重: Servlet.service() for servlet [springServlet] in context with path [/gateway] threw exception [Request processing failed; nested exception is javax.xml.ws.soap.SOAPFaultException: Server Error] with root causernorg.apache.cxf.binding.soap.SoapFault: Server Errorrn at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:86)rn at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:52)rn at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:41)rn at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)rn at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)rn at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)rn at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)rn at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)rn at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:802)rn at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1642)rn at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1533)rn at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1336)rn at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)rn at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652)rn at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)rn at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)rn at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)rn at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)rn at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)rn at com.sun.proxy.$Proxy88.iiCESDSalesOrderDisplaySYN(Unknown Source)rn at com.bizfocus.cswebsite.integrationCE.controller.DataSourceController.getOrderReport(DataSourceController.java:271)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:497)rn at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:817)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:731)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:870)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)rn at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)rn at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)rn at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)rn at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)rn at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)rn at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)rn at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)rn at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at java.lang.Thread.run(Thread.java:745)
xfire 生成webservice客户端,调用时的问题
在myeclipse中使用xfire生成webservice客户端,传入参数、返回的结果参数都是类对象,可是在执行的时候却报以下错误: rnrnInvoking handler org.codehaus.xfire.client.ClientReceiveHandler in phase service rnException in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Could not unmarshall type : com.xxx.xxx.xxx.xxxResponse is not known to this context rnorg.codehaus.xfire.fault.XFireFault: Could not unmarshall type : com.xxx.xxx.xxx.xxxResponse is not known to this context rn at org.codehaus.xfire.jaxb2.JaxbType.readObject(JaxbType.java:219) rn at org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBindingProvider.java:169) rn at org.codehaus.xfire.service.binding.RPCBinding.readMessage(RPCBinding.java:91) rn at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42) rn at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) rn at org.codehaus.xfire.client.Client.onReceive(Client.java:406) rn at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139) rn at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48) rn at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) rn at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) rn at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79) rn at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114) rn at org.codehaus.xfire.client.Client.invoke(Client.java:336) rn at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77) rn at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) rn at $Proxy12.buyBatchProduct(Unknown Source) rn at com.xxx.xxx.xxx.impl.CBuyClubHandler.buyProduct(CBuyClubHandler.java:220) rn at com.xxx.xxx.xxx.impl.CBuyClubHandler.main(CBuyClubHandler.java:235) rnCaused by: javax.xml.bind.JAXBException: com.cnfol.webservice.product.BuyProductResponse is not known to this context rn at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:510) rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getBeanInfo(UnmarshallerImpl.java:502) rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:316) rn at org.codehaus.xfire.jaxb2.JaxbType.readObject(JaxbType.java:201) rn ... 17 more rnrnrn哪位兄弟知道怎么解决这个问题的?谢谢!
axis2 webservice 客户端调用时报错
代码部分如下:n RPCServiceClient serviceClient = new RPCServiceClient();n EndpointReference targetEPR = new EndpointReference(wsurl); n Options options = serviceClient.getOptions(); n options.setTo(targetEPR); n HttpTransportProperties.Authenticator basicauth = new HttpTransportProperties.Authenticator(); n basicauth.setUsername("ECInsurance"); //服务器访问用户名 n basicauth.setPassword("YGBXECInsurance"); //服务器访问密码n options.setProperty(HTTPConstants.AUTHENTICATE, basicauth);n options.setAction("idNoCheck");n QName qname = new QName("http://slis-uat.sinosig.com/services/IdNoCheck", "idNoCheck"); n // 指定IdNoCheck方法的参数值 n Object[] parameters = new Object[1]; n //PackReg方法是组装xml的,报文经过接口测试没问题n parameters[0]=PackReg(order);n System.out.println(parameters[0]); n // 指定IdNoCheck方法返回值的数据类型的Class对象 n Class[] returnTypes = new Class[] String.class;n System.out.println(serviceClient.invokeBlocking(qname,parameters, returnTypes)[0].toString());n catch (AxisFault e) n e.printStackTrace();n n错误信息如下:norg.apache.axis2.AxisFault: Server Errorn at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)n at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)n at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)n at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)n at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)n at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)n at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)n at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:101)n at com.sinosig.lifewebsite.util.idCheck.idCheckIdNo(idCheck.java:65)n at com.sinosig.lifewebsite.controller.jkseb.JksebController.idCheckNo(JksebController.java:90)n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)n at java.lang.reflect.Method.invoke(Method.java:597)n at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)n at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:439)n at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:427)n at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)n at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)n at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)n at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)n at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)n at com.sinosig.ec.sso.filter.SSOClientFilter.doFilter(SSOClientFilter.java:86)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)n at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)n at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)n at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)n at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)n at java.lang.Thread.run(Thread.java:662)n n n 接口那边说没有问题的
webservice调用时参数变为null
总述:web方法参数中有一个对象,ref类型的,调用前不为null,调用后就为null,哪位有经验的帮我看看为什么。rn类定义:rn[code=C#]UserInfomation对象rn[Serializable]rn public class UserInfomationrn rn private int _UserId;rn private string _UserName;rn private int _CompanyId;rn private string _CompanyType;rn private string _CompanyShortName;rn private string _Password;rn private int _result_code;rn private string _result_remark;rnrn public int UserIdrn rn get return _UserId; rn set _UserId = value; rn rn public string UserNamern rn get return _UserName; rn set _UserName = value; rn rn public string CompanyTypern rn get return _CompanyType; rn set _CompanyType = value; rn rn public int CompanyIdrn rn get return _CompanyId; rn set _CompanyId = value; rn rn public string CompanyShortNamern rn get return _CompanyShortName; rn set _CompanyShortName = value; rn rn public string Passwordrn rn get return _Password; rn set _Password = value; rn rnrnrnrn public int Result_Codern rn get return _result_code; rn set _result_code = value; rn rnrnrnrn public string Result_Remarkrn rn get return _result_remark; rn set _result_remark = value; rn rnrn public UserInfomation()rn rnrn rn[/code]rnrnweb方法定义:rn[WebMethod]rn [XmlInclude(typeof(UserInfomation))]rn public int GetMsgCountByType(string strdate, ref DataTable dt, ref UserInfomation usrinfo)rnrn调用:rnpublic ManageWs.UserInfomation iUserInfo = new ManageWs.UserInfomation();rn在这里之前 iUserInfo还不等于nullrnint result1 = ws.GetMsgCountByType(strDate, ref dt1,ref iUserInfo);rn这句中iUserInfo就为null,请问为什么?rnrn
webservice怎么调存储过程
谢谢小妹在线急等。最好把代码附上
webservice怎么调接口
现在根据wsdl生成了java代码n然后写个main方法 怎么调接口?需要配置什么文件吗?还是怎么用
这个webservice怎么调
电子券校验接口rn调用类型:调用第三方rn接口描述:电子券有效性校验rn接口类型:实时接口rn接口协议:webservice标准协议,json格式rn接口名称:useTicketrn操作编码:useTicketrnWebservice地址:http://130.71.237.109:7021/ticket/services/TicketWebServicernrn请求参数:rn序号 字段名 描述 字段类型 约束 备注rn1 ticketCode 电子券定义编码 String 1 电子券定义编码,必填rn2 operCode 请求参数 String 1 rn3 userid 消费商户 String 1 消費商家rn4 tradeid 消費流水 String 流水rnrn返回报文rn序号 字段名 描述 字段类型 父节点 约束 备注rn1 rspCode 校验结果 String 1 0:成功,-1:失败rn2 rspDesc 失败内容 String 1 提供校验失败原因rn3 value 电子劵金额 String 1 电子券金额rnrn说明:请求参数中增加operCode,电子券平台webservice接口调用操作方法名(唯一标识),用于标识请求方法,在接口定义时确定rn
调用时怎么数值没有变化?
using System;rnnamespace huanrnrn public class getdatarn rn public void getit(ref int a,ref int b)rn int c=0;rn if(a
怎么socket调不到webservice了?
提前介绍:rnrn 我将socket监听打成jar包,放到了测试服务器上(linux+ websphere7.0.0.7),并将jar包加到了linux启动序列里面,重启服务器,监听开始。rn 此socket监听里面可以调用我的工程的webservice。rn rnrn 现在问题来了:rn 当我启动linux 启动数据库 启动websphere 启动apache后 socket成功监听,并能调用到我的webservice,但是当我重新启动websphere后,socket调用不到我的webservice了,还得重新启动linux 启动数据库 启动websphere 启动apache后 socket才能正常调用到我的websevicernrn 这是为什么呢?大侠指点迷津……
怎么调WSDL方式的webservice?
怎么调WSDL方式的webservice?我在网上看了个wsdl2objc库,看着似乎能用,可惜没有文档,不好实现。rnrnAvailable Services:rnSecurityEngineDeal [wsdl]rnrnrnrnrnrn Generated by XFire ( http://xfire.codehaus.org )
webservice客户端接口怎么调?
rn我们的目的是要在一台服务器上远程调用另一台服务器上的方法, rn 其他都做好了,就是不知道怎么调接口,客户端是直接调服务器方法,还是要写代码通过soap来实现呢??rnrn请留下你的联系方式把。。。rnrnrn 但是我们还有一种更简单的方法:SOAP rn SOAP通过XML传送调用方法的名称和参数(以及参数的类型), rn 也通过XML返回结果。 rn 在客户端和服务器端都需要有相应的XML Parser,生成XML数据 rn 客户端生成调用格式,服务器端生成返回结果。 rn SOAP规定了调用格式、数据类型的定义方法。 rn
webservice服务器接口怎么调?
我用的是.net2005,webservice,dll,web引用,客户端,都做了,现在不知道怎样调webreference里面的接口。rnrnmsn:lihualiu81@hotmail.comrnqq:247633433
调webservice
http://www.nnzbzh.cn:6000/ZBXZXService?wsdlrn这是地址,rnrn[code=delphi]// ************************************************************************ //rn// The types declared in this file were generated from data read from thern// WSDL File described below:rn// WSDL : http://www.nnzbzh.cn:6000/ZBXZXService?wsdlrn// Encoding : utf-8rn// Version : 1.0rn// (2013-8-1 10:24:52 - 1.33.2.5)rn// ************************************************************************ //rnrnunit uZBXZXService;rnrninterfacernrnuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;rnrntypernrn // ************************************************************************ //rn // The following types, referred to in the WSDL document are not being representedrn // in this file. They are either aliases[@] of other types represented or were referredrn // to but never[!] declared in the document. The types from the latter categoryrn // typically map to predefined/known XML or Borland types; however, they could also rn // indicate incorrect WSDL documents that failed to declare or import a schema type.rn // ************************************************************************ //rn // !:GetMes - "http://tempuri.org/"rn // !:GetMesResponse - "http://tempuri.org/"rn // !:GetMesLeng - "http://tempuri.org/"rn // !:GetMesLengResponse - "http://tempuri.org/"rn // !:inqTranFlow - "http://tempuri.org/"rn // !:inqTranFlowResponse - "http://tempuri.org/"rn // !:GetHBMD - "http://tempuri.org/"rn // !:GetHBMDResponse - "http://tempuri.org/"rn // !:GetAllMes - "http://tempuri.org/"rn // !:GetAllMesResponse - "http://tempuri.org/"rn // !:GetXZXMES - "http://tempuri.org/"rn // !:GetXZXMESResponse - "http://tempuri.org/"rn // !:GetHBMDSNUM - "http://tempuri.org/"rn // !:GetHBMDSNUMResponse - "http://tempuri.org/"rn//以下是我自己加的+++rn GetHBMD = Class;rn GetHBMDResponse = Class;rn GetHBMDSNUM = Class;rn GetHBMDSNUMResponse = Class;rnrn GetHBMD = class(TSOAPHeader)rn privatern Fid: WideString;rn Fcount: WideString;rn FYZM: WideString;rn publicrn publishedrn property id: WideString read Fid write Fid;rn property count: WideString read Fcount write Fcount;rn property YZM: WideString read FYZM write FYZM;rn end;rnrn GetHBMDResponse = class(TSOAPHeader)rn privatern Freturn: WideString;rn publicrn publishedrn property return: WideString read Freturn write Freturn;rn end;rnrn GetHBMDSNUM = class(TSOAPHeader)rn privatern publicrn publishedrn end;rnrn GetHBMDSNUMResponse = class(TSOAPHeader)rn privatern Freturn: WideString;rn publicrn publishedrn property return: WideString read Freturn write Freturn;rn end;rn//以上是我自己加的———rn // ************************************************************************ //rn // Namespace : http://tempuri.org/rn // soapAction: http://tempuri.org/IService/%operationName%rn // transport : http://schemas.xmlsoap.org/soap/httprn // binding : BasicHttpBinding_IServicern // service : Servicern // port : BasicHttpBinding_IServicern // URL : http://www.nnzbzh.cn:6000/ZBXZXServicern // ************************************************************************ //rn IService = interface(IInvokable)rn ['98ED6C0B-93D7-7F02-40EA-9A0E061E5A66']rn //function GetMes(const parameters: GetMes): GetMesResponse; stdcall;rn //function GetMesLeng(const parameters: GetMesLeng): GetMesLengResponse; stdcall;rn //function inqTranFlow(const parameters: inqTranFlow): inqTranFlowResponse; stdcall;rn function GetHBMD(const parameters: GetHBMD): GetHBMDResponse; stdcall;rn //function GetAllMes(const parameters: GetAllMes): GetAllMesResponse; stdcall;rn //function GetXZXMES(const parameters: GetXZXMES): GetXZXMESResponse; stdcall;rn function GetHBMDSNUM(const parameters: GetHBMDSNUM): GetHBMDSNUMResponse; stdcall;rn end;rnrnfunction GetIService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): IService;rnrnrnimplementationrnrnfunction GetIService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IService;rnconstrn defWSDL = 'http://www.nnzbzh.cn:6000/ZBXZXService?wsdl';rn defURL = 'http://www.nnzbzh.cn:6000/ZBXZXService';rn defSvc = 'Service';rn defPrt = 'BasicHttpBinding_IService';rnvarrn RIO: THTTPRIO;rnbeginrn Result := nil;rn if (Addr = '') thenrn beginrn if UseWSDL thenrn Addr := defWSDLrn elsern Addr := defURL;rn end;rn if HTTPRIO = nil thenrn RIO := THTTPRIO.Create(nil)rn elsern RIO := HTTPRIO;rn tryrn Result := (RIO as IService);rn if UseWSDL thenrn beginrn RIO.WSDLLocation := Addr;rn RIO.Service := defSvc;rn RIO.Port := defPrt;rn end elsern RIO.URL := Addr;rn finallyrn if (Result = nil) and (HTTPRIO = nil) thenrn RIO.Free;rn end;rnend;rnrnrninitializationrn InvRegistry.RegisterInterface(TypeInfo(IService), 'http://tempuri.org/', 'utf-8');rn InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IService), 'http://tempuri.org/IService/%operationName%');rn InvRegistry.RegisterInvokeOptions(TypeInfo(IService), ioLiteral);rnend.rn[/code]rnrn我想调用GetHBMD和GetHBMDSUN函数,并且能在程序里改wsdl的地址,谁帮我写一个调用的代码,谢谢。
JavaBean调用时不执行
//bbsreg.javarnpackage twm;rnimport java.sql.*;rnrnpublic class bbsreg rn String sDBDriver;rn String sConncStr;rn Connection conn;rn ResultSet rs;rnpublic bbsreg()rn String url="jdbc:mysql://localhost:3306/bbs";rn sDBDriver="com.mysql.jdbc.Driver";rn conn=null;rn rs=null;rn String user="root"; rn String password="6949453";rn tryrn Class.forName(sDBDriver);//加载数据库rn conn=DriverManager.getConnection(url,user,password);//连接数据库rn [color=#0000FF]System.out.println("数据库连接成功!");[/color]可以打印输出 catch(ClassNotFoundException e)rn System.out.println(e.getMessage());rn catch(SQLException e) rn System.out.println("cannot connect the sql"); rnrnpublic ResultSet executeQuery(String sql) //创建查询结果集rn rs=null;rn tryrn Statement statement=conn.createStatement();rn rs=statement.executeQuery(sql);rn [color=#0000FF]System.out.println("正在查询!");[/color]不执行!! catch(SQLException e)rn System.out.println(e.getMessage()); rn rn return rs;rn rnpublic void executeUpdate(String sql)rn tryrn Statement statement=conn.createStatement();rn statement.executeUpdate(sql);rn catch(SQLException e)rn System.out.println(e.getMessage()); rn rnrnrn--------------------------------------------------------------------------------------------------------rn注册页面跳转到此页面。rn<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>rn<%@ page import="java.sql.*" %>rnrn<% %>rn<%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rnrnrnrn rn rn rn My JSP 'chklogin.jsp' starting pagern rn rn rn rn rn rn rnrn rn rn rn <%request.setCharacterEncoding("gb2312");rn String sql="";rn ResultSet rs;rn String username=request.getParameter("username");rn String password=request.getParameter("password");rn //out.println(username+password);rn if(username!=null&&username.equals(" ")) rn tryrn rn sql="select * from user where username='"+username+"'and userpassword='"+password+"'";rn rs=conn.executeQuery(sql);rn [color=#0000FF] System.out.println("调用JavaBean!");调用JavaBean!打印不出来[/[/color]rn if(rs.next())rn // session.setAttribute("login","ok");rn //session.setAttribute("username",username);rn %>rn rn 若无法跳转,请点击这里rn <%elsern out.println("错误的用户名或密码!");rn out.println("返回"); rn catch(Exception e)rn e.printStackTrace(); %>rn rnrn
EJB调用时的问题
EJB发布到服务器后我用简单的java测试通过,就是Jbuuilder自动生成的那个,填上相关的数据测试的。 对方用jsp测试,数据发送过来也可以正确的写入到这边的数据库里面。rn可是问题是当对方用他的系统真的发送数据的时候出现如下错误:rnjava.sql.SQLException: java.sql.SQLException: javax.naming.NameNotFoundException: Unable to resolve 'NFJF_TEST' Resolved [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'NFJF_TEST' Resolved ]; remaining name 'NFJF_TEST'rnat weblogic.jdbc.jts.Driver.createRemoteConnection(Driver.java:403)rnat weblogic.jdbc.jts.Driver.connect(Driver.java:161)rnat weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:344)rnat com.dreamtel.db.conn.dbConnect.getConnection_ex(dbConnect.java:65)rnat com.dreamtel.db.conn.dbConnect.transBegin_ex(dbConnect.java:110)rnat com.dreamtel.interfaces.InterfacesBean.insert(InterfacesBean.java:78)rnat com.dreamtel.interfaces.Interfaces_kuhd1g_EOImpl.insert(Interfaces_kuhd1g_EOImpl.java:149)rnat com.dreamtel.interfaces.Interfaces_kuhd1g_EOImpl_WLSkel.invoke(Unknown Source)rnat weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:491)rnat weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:120)rnat weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)rnat weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)rnat weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)rnat weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)rnat weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)rnat weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)rnNFJF_TEST数据源在服务器是存在而且可用的阿rn还望大家多多帮忙rn谢谢rnat weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)rn
XFire+hibernate+Spring 调用时报错!!
这是错误信息:rnJava code[DEBUG] [org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:115)] erPipeline - Invoking phase servicern[DEBUG] [org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:129)] erPipeline - Invoking handler org.codehaus.xfire.client.ClientReceiveHandler in phase servicernException in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Faultrnorg.codehaus.xfire.fault.XFireFault: Faultrn at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)rn at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)rn at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111)rn at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)rn at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)rn at org.codehaus.xfire.client.Client.onReceive(Client.java:406)rn at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)rn at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)rn at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)rn at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)rn at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)rn at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)rn at org.codehaus.xfire.client.Client.invoke(Client.java:336)rn at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)rn at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)rn at $Proxy0.GetJLSet(Unknown Source)rn at jia.tf.Test.testSHXFire(Test.java:67)rn at jia.tf.Test.main(Test.java:51)rnrnrn调用:rnJava codeService service = new ObjectServiceFactory().create(ICheckLogin.class);rn XFireProxyFactory proxyFactory = new XFireProxyFactory(XFireFactory.newInstance().getXFire());rn String url = "http://localhost:8080/computation/services.ws";rn ICheckLogin login = (ICheckLogin) proxyFactory.create(service, url);rn// System.out.println(login.test("123"));rn List listf = login.GetJLSet();rn for(FlSysSet fss : listf)rn rn System.out.println(fss.getCmemo());rn rnrnrn配置文件:rnXML codern rn rn rn rnrn
水晶报表调用时出错???
指定的参数已超出有效值的范围。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.ArgumentOutOfRangeException: 指定的参数已超出有效值的范围。rnrn源错误: rnrnrn行 55: rn行 56: ParameterFields paramFields = CrystalReportViewer1.ParameterFieldInfo;rn行 57: ParameterField paramField0 = paramFields["test"];rnrn 为什么??rn
在用调用时的问题..
我在用外部swf调用名为pop.swf时.不知怎的.调用后就不正常了.而单独放pop.swf又很正常.,,唉.我为这事头都大了.好像以前有人说过是_root路径的问题.还有_level之类的问题.我试了.可不知怎.还是没解决,,请高手给我治治. 明天就要放假了.急救.rnrnwww.flash8.net/bbs/viewFile....id=10&ID=133370
参数调用时的问题
在方法调用时,如果用的是传值调用的话,方法只是将定义在方法外的变量作复制,然后进行运算,变量本身不发生改变。可以下代码的BufferReplace()方法执行后,变量textBufferString的值发生了改变,请问为什么?rnpublic class T6 rn public static void StringReplace(String text)rn text=text.replace('j', 'i');rn System.out.println(text);rn rn public static void BufferReplace(StringBuffer text)rn text=text.append("C");rn rn rn public static void main(String[] args)rn String textString=new String("java");rn StringBuffer textBufferString=new StringBuffer("java");rn rn StringReplace(textString);rn BufferReplace(textBufferString);rn rn System.out.println(textString+textBufferString);rn rn
CFilediglog 调用时错误
CFileDialog    dlgFile(TRUE, NULL, NULL, OFN_HIDEREADONLY, _T("Describe Files (*.cfg)|*.cfg|All Files (*.*)|*.*||"), NULL);(这源自网络,我是按VS2010定义写的)rn我最近改用VS2010,单步到这里就错误,走进去貌似走到getcurrentinstance吧(我手机写的),然再进去到了个API然后就挂了。可是忽略了又可以正常工作。rn出问题的位置是在一个连接Ado数据库的全局类的私有函数,附近有try catchrn我用高一一年业余写了这软件,现在暑假得赶快把它做好,高二没时间了rn求大神救济!做我的指导老师也好,现在没时间自学咯
response.sendRedirect调用时出错
/*rn * Created on 2005-7-11rn */rnpackage com.tatchun.util;rnimport javax.servlet.http.HttpSession;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnimport java.io.IOException;rnimport org.apache.log4j.Logger;rnrn/**rn * @author johnsonrn */rnpublic class SessionUtil rn Logger logger = Logger.getLogger(SessionUtil.class.getName());rn HttpSession session = null;rn HttpServletResponse response = null;rn HttpServletRequest request = null;rn rn public SessionUtil(HttpSession session, HttpServletRequest request, HttpServletResponse response)rn this.session = session;rn this.request = request;rn this.response = response;rn rn rn public boolean validSession()rn if(session == null)rn dispErrorPage();rn return false;rn rn return true; rn rn public void dispErrorPage()rn tryrn response.sendRedirect("/tatchun/index.jsp");rn catch(IOException e)rn logger.debug("Exception in SessionUtil.disErrorPage()"+e.getMessage());rn e.printStackTrace();rn rn rn rn public Object getAttribute(String str)rn if(session.getAttribute(str) == null)rn session.invalidate();rn dispErrorPage();rn return null;rn elsern return session.getAttribute(str);rn rn rn rn public void setAttribute(String str, Object obj)rn session.setAttribute(str, obj);rn rnrn当运行到我调用SessionUtil程序判断是否有效session,如果无效就运行dispErrorPage(),但是调用dispErrorPage()的时候抛出以下错误,请问是怎么一回事?rntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperExceptionrn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:207)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)rn at java.lang.Thread.run(Thread.java:534)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn at org.apache.jsp.kqrbIndex_jsp._jspService(kqrbIndex_jsp.java:70)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)rn at java.lang.Thread.run(Thread.java:534)rn
调用时编译器的优化问题
构造拷贝构造的N种调用情况的编译器优化1、传参合传返回值时构造的优化处理include<iostream> using namespace std;class Date { public: Date()//构造 { cout << "Date()" << endl; } Date(const Date& d)//拷贝 { cou
存储过程调用时出错
我要在存储过程中返回一个结果集rn分别统计六张表中的记录数rn我用了一个临时表,统计出结果然后放进去,最后rnSELECT * FROM #TEPTABLErn在查询分析器中执行这个存储过程,得到正确结果rn在外面调用时,说在对象关闭时,不能执行操作.rn
curses.wrapper调用时报错
新手玩家上路,在碰到一个curses.wrapper调用时报错,请大家帮忙,谢谢!rnrn环境:rnrnPython3.6rnrn在使用函数时,好像可以使用rnrndef creats(stdscr):rn print('输入q退出')rn stdscr = curses.initscr()rn while True:rn c = stdscr.getch()rn if c == ord('p'):rn PrintDocument()rn elif c == ord('q'):rn break # Exit the while()rn elif c == curses.KEY_HOME:rn x = y = 0rnrnrncurses.wrapper(creats)rnrn但是,当我想转成类的时候,会报错rnrnclass tests():rn rn def __main__(self): rn rn passrn rn rnstdscr = curses.initscr()rncurses.wrapper(tests)rnrnTraceback (most recent call last):rn File "标准.py", line 29, in rn curses.wrapper(tests)rn File "E:\python36\lib\curses\__init__.py", line 94, in wrapperrn return func(stdscr, *args, **kwds)rnTypeError: object() takes no parametersrnrn请大神们指导下,谢谢
在animateWithDuration调用时旋转
用下面的代码动画UIView,运行正常,就是不能实现在调用时实现旋转和缩放,我想同时实现这些,需要缩放至0,并且旋转。rnrn [UIView animateWithDuration:0.4 delay:0.0 options:UIViewAnimationOptionCurveEaseInOutrn animations:^(void) rn recognizer.view.transform = CGAffineTransformMakeRotation(DegreesToRadians(540));rn recognizer.view.backgroundColor = [[UIColor alloc] initWithRed:220.0/255.0 green:220.0/255.0 blue:220.0/255.0 alpha:1.0]; rn ];
header()调用时出错。
header()调用时出错。rndo_register.php页面执行到 header("Location:msg.php?m=register_success");rn时出错。rnWarning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\accountSys\register.php:9) in C:\wamp\www\accountSys\do_register.php on line 29rnrnrnregister.php代码:rn[code=PHP]rnrnrn rn rn rn 用户名:rn * rn rn 你的全名或你更喜欢的名字。允许中英文,空格和数字。rn rn rn 密码:*rn rn 请输入您的密码。rn rn 请再次输入您的密码。rn rn rn rn rnrnrn rn rn[/code]rnrnrndo_register.php代码:[code=PHP][/code]
函数指针在调用时的问题
void Function1(void (*pFunc)())rnrn pFunc();rnrnrnvoid Func2() ;rnrnint main()rnrn Function1(Func2);rn//和rn Function1(&Func2);rn//有什么不同? 结果好像都一样rn
webservice传参数的问题
调用方法:rnpublic Test[] putTest(TestBean[] testbean)rnrn类型定义:rnclass TestBean rn int ID;rn String str;rn TagBean[] tags;rnrnClass TagBeanrnint uid;rnint vID;rnInt flag;rn rnrn为什么我得到TagBean的size为1,可我明明放了2组数阿?
不确定参数调用时是怎么传递的
const char* Format(const char* fmt, ...)rnrn假设传2个以上参数,那是怎么传递?rnrn虽然都在栈里。。。但如何去找到。。。。。
自定义类,调用时中文说明怎么加?
请高人指教:自定义类,调用时中文说明怎么加?
求助111C# webservice 部署到IIS上 调用时问题
这个是webservce 代码, 一个是默认的 一个是我写的rn [WebMethod]rn public string HelloWorld()rn rn return "Hello World";rn rn rn [WebMethod]rn public DataSet reader()rn rn string ConStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=H:\\MyPro\\data.accdb";rn String SqlStr = "select * from login";rn tryrn rn OleDbConnection con = new OleDbConnection(ConStr);rnrn DataSet ds = new DataSet();rnrn OleDbDataAdapter da = new OleDbDataAdapter(SqlStr, con);rnrn da.Fill(ds);rnrn return ds;rnrn rn catch (Exception ex)rn rn return null;rn rn在VS上按F5测试时,没有问题 ,将浏览器地址复制,在WF中添加引用服务,也还是可以的,能够读取数据库的信息。。rnrn但是 !!!将WebService部署到IIS上,用地址访问时,出现了“/无法引用服务XXX”的错误,网上查了下,在web.config里添加了如下代码:rnrnrn然后,吾此噢,默认的WebService里的HelleWorld()可以调用,但是我自己写的没法子调用了,rnrn出现的是:rnrnrnrn就这些代码,看不懂啊。rnrn之前成功的是数据库的内容。。rnrn怎么回事啊?请教大神。。。已经卡了一周了,完全不知道怎么回事。。。rnrn
webservice 被winForm应用程序调用时 的 安全处理问题
如题:rn本人做了一个 webservice 但是 在 winForm 中 调用时 不知道 怎么控制他们的访问!rn在 webConfig 中怎么配置? 请高手指点! 谢谢!
webservice 在PHP客户端调用时如何加上用户名和密码?
webservice 在PHP客户端调用时如何加上用户名和密码?在服务器端要验证的rnrn
求助:AXIS生成完WebService调用时的错误
AXIS errorrnSorry, something seems to have gone wrong... here are the details:rnrnFault - Failed to determine deployed service names.; nested exception is: rn org.apache.axis.ConfigurationException: Could not find class for the service named: com.founder.webservice.transsender.TransSenderrnHint: you may need to copy your class files/tree into the right location (which depends on the servlet system you are using).; nested exception is: rn java.lang.ClassNotFoundException: com.founder.webservice.transsender.TransSenderrnAxisFaultrn faultCode: http://schemas.xmlsoap.org/soap/envelope/Server.generalExceptionrn faultSubcode: rn faultString: Could not find class for the service named: com.founder.webservice.transsender.TransSenderrnHint: you may need to copy your class files/tree into the right location (which depends on the servlet system you are using).; nested exception is: rn java.lang.ClassNotFoundException: com.founder.webservice.transsender.TransSenderrn faultActor: rn faultNode: rn faultDetail: rn http://xml.apache.org/axis/hostname:bugtemprnrnrn在地址栏敲这个出现错误,请各位帮帮忙
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池