1
I am developing a Java program in Eclipse, to send Nfse to Camaquã. XML is signed and sent, but returns this error in java:
"Exception: Character string reference was not defined as a character string instance. Parameter name: s"
I have no idea what causes this error and would like to know if anyone could help me. Entire log of the bug as Debugger:
Axisfault faultCode: {http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher}Internalservicefault faultSubcode: faultString: Character string reference was not defined as a character string instance. Name of parameter: s faultActor: faultNode: faultDetail: {http://schemas.datacontract.org/2004/07/System.ServiceModel}Exceptiondetail:String reference has not been defined as a character string instance. Parameter name: s in System.Text.Encoding.Getbytes(String s) in CTIC.NFSE.Model.Implementadas.XML.WCFWebServices.Validatormanager.Validatebyxsd(String xmlContent, List`1 listMensagemRelaton) in CTIC.NFSE.Model.Implementadas.XML.WCFWebServices.Validatormanager.Validatelotsimplifyform(String cpfCnpjTransmitter, String xmlDoLote) in CTIC.Framework.Model.Business.Bowebservice.Recepcionarloterps(String xmlEnvio) in CTIC.NFSE.Webservices.NFSEServices.Recepcionarloterps(String xmlEnvio) in Syncinvokerecepcionarloterps(Object , Object[] , Object[] ) in System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in System.ServiceModel.Dispatcher.DispatchOperationRuntime.Invokebegin(Messagerpc& rpc) in System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Processmessage5(Messagerpc& rpc) in System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Processmessage41(Messagerpc& rpc) in System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Processmessage4(Messagerpc& rpc) in System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Processmessage31(Messagerpc& rpc) in System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Processmessage3(Messagerpc& rpc) in System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Processmessage2(Messagerpc& rpc) in System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Processmessage11(Messagerpc& rpc) in System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Processmessage1(Messagerpc& rpc) in System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)System.Argumentnullexception Character string reference was not defined as a character string instance. Name of parameter: s at org.apache.Axis.message.Soapfaultbuilder.createFault(Soapfaultbuilder.java:222) at org.apache.Axis.message.Soapfaultbuilder.endElement(Soapfaultbuilder.java:129) at org.apache.Axis.encoding.Deserializationcontext.endElement(Deserializationcontext.java:1087) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.Xmldocumentfragmentscannerimpl$Fragmentcontentdriver.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 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.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) at util.WsClient.enviar XML(Wsclient.java:645) at util.GeracaoXML.generateXMLFilePRONIM(Geracaoxml.java:458) at util.GeracaoXML.generateXMLFile(Geracaoxml.java:100) (Telasimples.java:408)
This error definitely seems to be coming from the webservice of Camaquã. How is it that you are invoking it?
– Victor Stafusa
Camaquã’s webservice seems to be done on . net and he fired an exception
System.ArgumentNullException
because the strings
was null, which is analogous to ajava.lang.NullPointerException
in Java. What you put as this parameters
?– Victor Stafusa
@VictorStafusa, Os parâmetros passados são:

>call.setSOAPActionURI("http://tempuri.org/INFSEGeracao/RecepcionarLoteRps");

>call.setTargetEndpointAddress("http://nfseteste.camaqua.rs.gov.br/NFSEWSTESTE/Services.svc?wsdl");

>call.setSOAPActionURI("http://tempuri.org/INFSEGeracao/RecepcionarLoteRps"); >call.setOperationName(new Qname("http://tempuri.org/", "Recepcionarloterps"));
– Mateus Folletto
I don’t know what would be causing this problem, since other cities make the shipment the same way and work normally. (Porto Alegre, Esteio, Novo Hamburgo, among others).
– Mateus Folletto
It may be a problem in their webservice. Having a
System.ArgumentNullException
no. net is the same as having ajava.lang.NullPointerException
in Java - or it’s laziness to treat the parametersnull
s properly or is programming error.– Victor Stafusa