FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#11
|
|||
|
|||
Hola
Bien, vamos avanzando... He conseguido añadir una cabecera a la petición, y gracias al evento BeforeExecute, puedo ver que efectivamente ahora el XML sí tiene sección cabecera: Código:
<SOAP-ENV:Header SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS1="urn:Soap.InvokeRegistry"> <NS1:TSOAPHeader xsi:type="NS1:TSOAPHeader"/> Bien. Yo lo he hecho de otra forma, no sé si ves algún problema:
Tu código es diferente, creo que utilizas un XMLDocument que contendría las cabeceras ya rellenadas? Ahora lo complicado es cómo meter el mensaje FIRMADO en la cabecera... ¿A mano? Por ejemplo, en la petición SOAP que uso para pruebas, el body es este: Código:
<SOAP-ENV:Body xmlns:NS2="https://webservice.face.gob.es" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <NS2:enviarFactura> <facturaWS href="#2"/> </NS2:enviarFactura> <NS2:SSPPFactura id="2" xsi:type="NS2:SSPPFactura"> <correo xsi:type="xsd:string">prueba@miemail.com</correo> <fichero_factura href="#3"/> <ficheros_anexos xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="NS2:SSPPFicheroAnexo[0]"/> </NS2:SSPPFactura> <NS2:fichero_factura id="3" xsi:type="NS2:SSPPFicheroFactura"> <factura xsi:type="xsd:string">72345</factura> <nombre xsi:type="xsd:string">Factura 177.xml</nombre> <mime xsi:type="xsd:string">application/xml</mime> </NS2:fichero_factura> Aquí tengo una muestra de petición "REAL" sacada de la documentación, que debería servirnos como ejemplo, aunque a estas alturas ya dudo de lo que puede servir y lo que no. Le he quitado la parte de los ficheros anexos (por ahora) para simplificarlo un poco. Código:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="https://webservice.face.gob.es"> <soapenv:Header> <!-- // Security Content --> </soapenv:Header> <soapenv:Body> <web:enviarFactura soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <facturaWS xsi:type="sspp:SSPPFactura"> <!--You may enter the following 3 items in any order--> <correo xsi:type="xsd:string">XXXX correo electronicoXXXX</correo> <fichero_factura xsi:type="sspp:SSPPFicheroFactura"> <!--You may enter the following 3 items in any order--> <factura xsi:type="xsd:string"> _contenido enbase_64 del fichero factura_ </factura> <nombre xsi:type="xsd:string"> _nombre del ficherofactura_ </nombre> <mime xsi:type="xsd:string"> _mimeType del ficherofactura_ </mime> </fichero_factura> </facturaWS> </web:enviarFactura> </soapenv:Body> </soapenv:Envelope> Código:
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="CertId-5A5C126069B253F2B0135998798458616" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> MIIEpDCCBA2gAwIBAgIEPLPTKTANBgkqhkiG9w0BAQUFADA2MQswCQYDVQQGEwJFUzENMAsGA1UEChMERk5NVDEYMBYGA1UECxMPRk5NVCBDbGFzZSAyIENBMB4XDTALS6PmAJWFoOUT3Xvp8UxYptb9/YK93ykPj5NYLcsXeh8L9SRWbFSnozoiATZoECDnrcMd054DdPrNVYLTZNhZ9Y2U9JqJpnIWR+a64Mo3iiMk/KBkI2jo3QIuaCjvPK+k6LQCwTIaRvnHGRxwIDAQABo4IB1DCCAdAwgdgGA1UdEQSB0DCBzaSByjCBxzEYMBYGCSsGAQQBrGYBDxMJUzI4MjYwMTVGMUMwQQYJKwYBBAGsZgEOEzRJTlRFUlZFVc9fS1I6qgUkmwCZKHiwgJ4tS1Mv3gKMZ+8ulc8JErYo661ql3GVmLsfdH5g3eWyC5rBEcCjkHSKO0qDhzg== </wsse:BinarySecurityToken> <ds:Signature Id="Signature-11" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethodAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#id-12"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms> <ds:DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>vfoQe7yobzrB5LzQZ/HD4B2F1BY=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> HOZFzxAsMAH8BDbuXOHekl+yyLXfodmPka5727t3LDFSkbxICkL92wy6dSbWyU07zK/dhfLl2a4c 33FcvOxAtYAEvQVRLcQM3VU9+L2SX9NReQaGTPPmtBb8UAWeH5m56nM9uxT7yIwfO424+lNEYEeo 1pYC+0DBI6WcN4LRgV4= </ds:SignatureValue> <ds:KeyInfo Id="KeyId-5A5C126069B253F2B0135998798458717"> <wsse:SecurityTokenReference wsu:Id="STRId-5A5C126069B253F2B0135998798458718" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:ReferenceURI="#CertId-5A5C126069B253F2B0135998798458616" ValueType="http://docs.oasis-open.org/wss/2004/01/ oasis-200401-wss-x509-token-profile-1.0#X509v3"/> </wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature> <wsu:Timestamp wsu:Id="Timestamp-10" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsu:Created>2013-02-04T14:26:24.586Z</wsu:Created> <wsu:Expires>2013-02-04T14:31:24.586Z</wsu:Expires> </wsu:Timestamp> </wsse:Security> |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Facturas Electronicas Argentina | Chaja | Varios | 3 | 10-07-2015 19:15:05 |
Agregar Adendas a Facturas electronicas mexico | reypcs | Varios | 0 | 20-01-2011 16:26:10 |
Tabla de Facturas vs Detalles de Facturas | magnu9 | Conexión con bases de datos | 9 | 27-07-2007 17:27:37 |
Comunicaciones electronicas EDI | Toni | Conexión con bases de datos | 0 | 18-04-2006 13:06:34 |
Campos calculados, facturas y detalles de facturas. | Letty | Conexión con bases de datos | 7 | 07-11-2003 11:19:44 |
|