axis,axis2 调用c# Object reference not set to an instance of an object.

问题描述

axis,axis2调用c#Serverwasunabletoprocessrequest.--->Objectreferencenotsettoaninstanceofanobject.axis,axis2调用java开发的接口都可以通过。调用C#(RecvRemoteData.asmx?wsdl)的则都报这个问题wdl片段:-<s:elementname="GetYWXDInfo">-<s:complexType>-<s:sequence><s:elementminOccurs="0"maxOccurs="1"name="Info"type="s:string"/></s:sequence></s:complexType></s:element>传入的message:<?xmlversion="1.0"encoding="UTF-8"?><Request><paramname="SERIAL_NUMBER">1412001203</param><paramname="outCaseID">0254</param><paramname="S_SHOULIDW">40</param><paramname="D_CHULISJ">2014-12-1211:20:25</param><paramname="S_CHULIR">王五</param><paramname="S_CHULILB">处理类别</param><paramname="S_CHULINR">处理内容</param><paramname="S_CHULIJG">处理结果</param><paramname="S_CHULIBZ">处理备注</param><paramname="S_CHULIDLY">r012</param><paramname="I_FileCount">0</param><paramname="S_FileName"></param><paramname="S_JIAOYANM">校验码</param></Request>axis:publicStringyewuxd(Stringmethod,Stringmessage){Stringurl="http://10.101.77.203:9000/12319RecvRemoteData.asmx";Stringnamespace="http://tempuri.org/";Stringsoapurl=namespace+method;Stringresult=“”;try{Serviceservice=newService();Callcall=(Call)service.createCall();call.setTargetEndpointAddress(url);call.setOperationName(newQName(namespace,method));call.addParameter("Info",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);​call.setSOAPActionURI(soapurl);Objectob=call.invoke(newObject[]{message});result=(String)ob;System.out.println("return"+result);}catch(RemoteExceptione){e.printStackTrace();}catch(ServiceExceptione){e.printStackTrace();}returnresult;}axis异常:AxisFaultfaultCode:{http://schemas.xmlsoap.org/soap/envelope/}ServerfaultSubcode:faultString:Serverwasunabletoprocessrequest.--->Objectreferencenotsettoaninstanceofanobject.faultActor:faultNode:faultDetail:{http://xml.apache.org/axis/}stackTrace:Serverwasunabletoprocessrequest.---&gt;Objectreferencenotsettoaninstanceofanobject.atorg.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)atorg.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)atorg.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)atcom.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)atcom.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)atcom.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)atcom.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)atcom.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)atcom.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)atcom.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)atjavax.xml.parsers.SAXParser.parse(SAXParser.java:395)atorg.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)atorg.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)atorg.apache.axis.Message.getSOAPEnvelope(Message.java:435)atorg.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)atorg.apache.axis.client.AxisClient.invoke(AxisClient.java:206)atorg.apache.axis.client.Call.invokeEngine(Call.java:2784)atorg.apache.axis.client.Call.invoke(Call.java:2767)atorg.apache.axis.client.Call.invoke(Call.java:2443)atorg.apache.axis.client.Call.invoke(Call.java:2366)atorg.apache.axis.client.Call.invoke(Call.java:1812)atcom.gwideal.services.Webservice.yewuxd(Webservice.java:56)atcom.gwideal.services.WebserviceImpl.ywxd(WebserviceImpl.java:8)atcom.gwideal.services.Webservice.main(Webservice.java:25){http://xml.apache.org/axis/}hostname:lzjoaServerwasunabletoprocessrequest.--->Objectreferencenotsettoaninstanceofanobject.atorg.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)atorg.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)atorg.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)atcom.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)atcom.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)atcom.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)atcom.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)atcom.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)atcom.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)atcom.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)atcom.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)atjavax.xml.parsers.SAXParser.parse(SAXParser.java:395)atorg.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)atorg.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)atorg.apache.axis.Message.getSOAPEnvelope(Message.java:435)atorg.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)atorg.apache.axis.client.AxisClient.invoke(AxisClient.java:206)atorg.apache.axis.client.Call.invokeEngine(Call.java:2784)atorg.apache.axis.client.Call.invoke(Call.java:2767)atorg.apache.axis.client.Call.invoke(Call.java:2443)atorg.apache.axis.client.Call.invoke(Call.java:2366)atorg.apache.axis.client.Call.invoke(Call.java:1812)atcom.gwideal.services.Webservice.yewuxd(Webservice.java:56)atcom.gwideal.services.WebserviceImpl.ywxd(WebserviceImpl.java:8)atcom.gwideal.services.Webservice.main(Webservice.java:25)Exceptioninthread"main"java.lang.NullPointerExceptionatcom.gwideal.services.ReturnResult.writeXML(ReturnResult.java:96)atcom.gwideal.services.ReturnResult.getResult(ReturnResult.java:27)atcom.gwideal.services.Webservice.main(Webservice.java:25)axis2:publicStringyewuxd(Stringmethod,Stringmessage){Stringurl="http://10.101.77.203:9000/12319RecvRemoteData.asmx";Stringnamespace="http://tempuri.org/";Stringsoapurl=namespace+method;Stringreturnmessage="";try{RPCServiceClientserviceClient=newRPCServiceClient();Optionsoptions=newOptions();options=serviceClient.getOptions();options.setProperty(HTTPConstants.CHUNKED,false);EndpointReferencetargetEPR=newEndpointReference(url);options.setTo(targetEPR);options.setAction(soapurl);Object[]opAddEntryArgs=newObject[]{message};Class[]classes=newClass[]{String.class};QNameopAddEntry=newQName(namespace,method);returnmessage=(String)serviceClient.invokeBlocking(opAddEntry,opAddEntryArgs,classes)[0];}catch(AxisFaulte){//TODOAuto-generatedcatchblocke.printStackTrace();}returnreturnmessage;}axis2异常:org.apache.axis2.AxisFault:Serverwasunabletoprocessrequest.--->Objectreferencenotsettoaninstanceofanobject.atorg.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)atorg.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)atorg.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)atorg.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)atorg.apache.axis2.client.OperationClient.execute(OperationClient.java:165)atorg.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555)atorg.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:531)atorg.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102)atcom.gwideal.services.Webservice.yewuxd(Webservice.java:55)atcom.gwideal.services.WebserviceImpl.ywxd(WebserviceImpl.java:8)atcom.gwideal.services.Webservice.main(Webservice.java:20)[FatalError]20141217160312562.xml:1:1:Prematureendoffile.org.xml.sax.SAXParseException:Prematureendoffile.atcom.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)atcom.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)atjavax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)atcom.gwideal.services.ReturnResult.jx_ResponseXML(ReturnResult.java:45)atcom.gwideal.services.ReturnResult.getResult(ReturnResult.java:27)atcom.gwideal.services.Webservice.main(Webservice.java:20)

解决方案

解决方案二:
我都写这么详细了,有人知道么??

时间: 2024-10-31 18:16:49

axis,axis2 调用c# Object reference not set to an instance of an object.的相关文章

Object reference not set to an instance of an object.

        今天从A界面跳转到B界面,并调用B界面中函数的时候,会报错"Object reference not set to an instance of an object."这个错误,是什么原因呢? 代码中声明了这么一个变量(在从A界面跳转到B界面的过程中都没给KSRQ这个变量赋值) public string KSRQ ; 当用到 this.KSRQ.Trim() != "" 的时候,会报出"Object reference not set t

网站页面经常出现:Object reference not set to an instance of an object.

问题描述 自己用C#写了个系统,但访问网站动态页面(除首页静态生成外),经常会出现:Objectreferencenotsettoaninstanceofanobject.这样的错误,但重新刷新一下又能正常访问,查了代码也能正常运行,请大虾帮忙看下,谢谢,以下是一次出现的全部提示:ServerErrorin'/'Application.Objectreferencenotsettoaninstanceofanobject.Description:Anunhandledexceptionoccur

.Net MVC Object reference not set to an instance of an object.

问题描述 采用的事.NETMVC4.0,发布的B/S系统在本地都正常,并且在其它服务器上也正常.但有客户采购了新服务器,部署后提示:Objectreferencenotsettoaninstanceofanobject..net是否有其他设置没注意到???在线等... 解决方案 解决方案二:Objectreferencenotsettoaninstanceofanobject.从错误提示来看是某个对象引用为null.解决方案三:引用楼主blue_weipengtao的回复: Objectrefe

phpcurl-php用curl模拟登陆问题,出现 Object reference ..

问题描述 php用curl模拟登陆问题,出现 Object reference .. 我用cur模拟登陆网站是,出现错误Object reference not set to an instance of an object.. 我用浏览器登陆时的post参数和我curl中参数时一样的,没问题. 我在代码中添加了 $D为cookies信息. curl_setopt($curl, CURLOPT_COOKIE, $D); 因为需要验证码登陆. 但是模拟登陆中头信息中缺少了 cookies. 我想是

关于AXIS2 调用WCF的问题

问题描述 大家好,我使用AXIS2调用WCF的时候遇到了如下的错误:Exceptioninthread"main"org.apache.axis2.AxisFault:MustUnderstandcheckfailedforheaderhttp://www.w3.org/2005/08/addressing:Action我通过两种方法调用都是一样的错误,axis2的工具生成的方法以及手写的方法,手写的方法如下:packagews;importjavax.xml.namespace.QN

[Java] 利用Axis库调用C#的Web Service

[Java] 利用Axis库调用C#的Web Service 编写者 日期 关键词 郑昀@ultrapower 2005-8-2 Java Web Service Axis C#   概述 试图从Java调用C#编写的Web Service,借用了王咏刚的wsCaller源代码中DynamicInvoker类. 开始不清楚DynamicInvoker类的portName的含义,望文生义,以为是8080之类的端口号,实际上是下面wsdl中的wsdl:port 节点的"name"属性值&q

java 通过axis2 调用.net webservice 时传2维byte数组的问题

问题描述 求大侠解答下java通过axis2调用.netwebservice时.netwebservice入参为一个byte类型的2维数组axis2是支持byte数组的但是2维的byte数组怎么设置入参类型呢下面是传一维byte数组的java客服端代码packagecn.rx.oamp.util;importjava.net.MalformedURLException;importjava.rmi.RemoteException;importjava.util.Date;importjavax.

关于Axis2调用WCF WSHttpbinding的问题

问题描述 我现在在写一个Axis2调用WCFWSHttpbinding的Demo.BasicHttpbinding没有问题.关键在于我的WCFWSHttpbinding的header里面居然有RequestSecurityTokenResponse和Policy尝试用axis2/Rampart来调用,也不正确,先用STSClient(SecurityTokenService)来得到Token,然后再去提交WS访问想问几个问题1)是否WCF下WSHttpbinding默认是把RequestSecu

axis 为什么调用两次header

问题描述 axis 为什么调用两次header wsdd文件中这样子配置的: <service name = "AmwayMsgService" provider = "java:RPC" > <namespace>http://amway.com/amway/ebiz/webService/msgService/</namespace> <parameter name="className" value