Jump to content

torreslucas

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

0 Comum

About torreslucas

  1. Bom dia!! Estou tentando via PHP, fazer uma requisição a um WebService SOAP, porém estou tendo os seguintes erros(todos no mesmo retorno, apenas separei para facilitar a leitura) SoapFault Object ( [message:protected] => The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'CancelaSMP'. End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. Found element 'param1' from namespace ''. Line 2, position 151. [string:Exception:private] => [code:protected] => 0 [file:protected] => C:\wamp\www\ws\webservice\teste.php [line:protected] => 59 [trace:Exception:private] => Array [previous:Exception:private] => [faultstring] => The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'CancelaSMP'. End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. Found element 'param1' from namespace ''. Line 2, position 151. [faultcode] => a:DeserializationFailed [detail] => stdClass Object ( [ExceptionDetail] => stdClass Object ( [HelpLink] => [InnerException] => stdClass Object ( [HelpLink] => [InnerException] => [Message] => End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. Found element 'param1' from namespace ''. Line 2, position 151. [StackTrace] => at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3) at System.Xml.XmlBaseReader.ReadEndElement() at System.ServiceModel.Channels.Message.ReadFromBodyContentsToEnd(XmlDictionaryReader reader, EnvelopeVersion envelopeVersion) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters) [Type] => System.Xml.XmlException ) [Message] => The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'CancelaSMP'. End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. Found element 'param1' from namespace ''. Line 2, position 151. [StackTrace] => at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) [Type] => System.ServiceModel.Dispatcher.NetDispatcherFaultException ) ) Segue o meu codigo PHP: <?php $wsdl = "http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?wsdl"; $trace = true; $exceptions = false; $token = 999999999; $xml_array['token'] = $token; $xml_array['AnoSMP'] = 2016; $xml_array['NumeroSMP'] = 0; $xml = ' <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:apis="http://schemas.datacontract.org/2004/07/ApisulLog.Integracao.Modelo.Chamada"> <soapenv:Body> <tem:CancelaSMP> <!--Optional:--> <tem:token>386228449</tem:token> <!--Optional:--> <tem:cancelaSMPModeloIntegracao> <!--Optional:--> <apis:AnoSMP>2016</apis:AnoSMP> <!--Optional:--> <apis:NumeroSMP>0</apis:NumeroSMP> </tem:cancelaSMPModeloIntegracao> </tem:CancelaSMP> </soapenv:Body> </soapenv:Envelope> '; print_r($xml_array); try { $client = new SoapClient($wsdl, array('trace' => $trace, 'exceptions' => $exceptions)); $response = $client->CancelaSMP($token, $xml); } catch (Exception $e) { echo "Error!"; echo $e -> getMessage (); echo 'Last response: '. $client->__getLastResponse(); } echo "<pre>"; print_r($response); echo "</pre>"; Lembrando que o conteudo de $xml foi pego diretamente do SoapUI, onde esta requisição foi feita com sucesso.
  2. torreslucas

    COUNT e LEFT()

    Motta, quando eu usei o left, eu dei um alias para a consulta (LEFT(registro, 1) as nregistro), Tentei usar o count nele(COUNT(nregistro), mas infelizmente retornou erro.
  3. torreslucas

    COUNT e LEFT()

    Boa Tarde, Atualmente, tenho alguns registro em uma coluna, algo como: id registro 1 A5263 2 B9863 3 A9855 4 A2325 5 C2563 6 B2232 7 B4578 8 A8963 9 C3322 O dado que me interessa no momento, é o primeiro caracter da coluna registro(A, B, C). Eu consigo capturá-los usando LEFT(), porém, além de retornar eles, eu gostaria da incidencia dos mesmo. Deveria retornar algo como: A 4 B 3 C 2 Poderiam me ajudar?
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.