Home Page › Forums › BizTalk 2004 – BizTalk 2010 › BizTalk transformation problem
- This topic has 1 reply, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
September 8, 2006 at 11:22 AM #15624
Hello,
Sorry to send it again, bur I just registered because I got an error.
I have to replicate some data from a Sybase database to a SQL Server database using BizTalk. To access the Sybase database I'm using an external componentto connect to the database, making the query and returning the data. Because of this I have created the schema file of the table (in Sybase) by another program I wrote (which connects to the database and filla a dataset and then I return the schema of the dataset). Then in BizTalk I call the component to query the table and create a mesage from that query (the component returns a message that is the xml of the dataset filled after the execution of the query). The message is created without problems. Later I apply a transformation to that message (which can contain a list of companies) to obtain the first company and record the data in the SQL Server. In this transformation I apply a map to the message containing the list to obtain only one company. Basically I have a message based on the schema created and I use the same schema to create the other message but only with one company, this message will contain only one of the companies in the list at a given moment. When I set a breakpoint to evaluate the messages I see that the first message is created and contains data, but for the other message (the one that is created in the transformation) there is no data I can only see the elements that should contain the message, but they havo no values. I don't know where the problem lies, since I have done the same and it works fine.
This is the schema I'm trying to use:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema id="ResponseEmpresa" targetNamespace="SIARP:Empresa" xmlns:mstns="SIARP:Empresa" xmlns="SIARP:Empresa" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="ResponseEmpresa" msdata:IsDataSet="true" msdata:Prefix="ns0">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="GRAL_MA_EMPRESA" form="unqualified">
<xs:complexType>
<xs:sequence>
<xs:element name="ID_TIPO_DOC" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="ID_EMPRESA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="ID_TIPO_DOC_CORREDOR" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="ID_CORREDOR" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="ID_TIPO_DOC_TRAB_ARP" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="ID_TRABAJADOR" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="ID_DEPARTAMENTO" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="ID_MUNICIPIO" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="ID_ARP" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="ID_SECCIONAL" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="ID_ACT_ECONOMICA" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="ID_TIPO_DOC_REP_LEGAL" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="DV_EMPRESA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="RAZON_SOCIAL" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="DIRECCION_EMPRESA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="TELEFONO_EMPRESA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="FAX_EMPRESA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="EMAIL_EMPRESA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="IND_ZONA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="IND_TIPO_EMPLEADOR" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="NUMERO_TRABAJADORES" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="FECHA_INGRESO" form="unqualified" type="xs:dateTime" minOccurs="0" />
<xs:element name="MECANIZADA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="TRANSPORTE_PRODUCTOS" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="TRANSPORTE_TRABAJADORES" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="NUMERO_FORM_AFILIACION" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="FECHA_RADICACION" form="unqualified" type="xs:dateTime" minOccurs="0" />
<xs:element name="VINCULACION_PRIMERA_VEZ" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="PRESENTA_INCONSISTENCIA" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="TIPO_AGENTE" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="IND_AMBITO_EMPRESA" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="USUARIO" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="CLAVE" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="CAMBIO_ARP_ANTERIOR" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="TARIFA" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="ESTADO" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="ID_REPRESENTANTE_LEGAL" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="REPRESENTANTE_LEGAL" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="CARGO_REPRESENTANTE_LEGAL" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="PERSONA_CONTACTO" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="PAGINA_WEB" form="unqualified" type="xs:string" minOccurs="0" />
<xs:element name="VALOR_MENSUAL" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="IND_CONCORDATO" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="FECHA_AFILIACION_EFECTIVA" form="unqualified" type="xs:dateTime" minOccurs="0" />
<xs:element name="BTS_REPLICA" form="unqualified" type="xs:decimal" minOccurs="0" />
<xs:element name="BTS_REPLICA_S" form="unqualified" type="xs:decimal" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>This is the first message that is queried from Sybase:
<ns0:ResponseEmpresa xmlns:ns0="SIARP:Empresas">
<GRAL_MA_EMPRESA>
<ID_TIPO_DOC>NI</ID_TIPO_DOC>
<ID_EMPRESA>809999999</ID_EMPRESA>
<ID_TIPO_DOC_CORREDOR>CC</ID_TIPO_DOC_CORREDOR>
<ID_CORREDOR>1</ID_CORREDOR>
<ID_TIPO_DOC_TRAB_ARP>NU</ID_TIPO_DOC_TRAB_ARP>
<ID_TRABAJADOR>0</ID_TRABAJADOR>
<ID_DEPARTAMENTO>5</ID_DEPARTAMENTO>
<ID_MUNICIPIO>1</ID_MUNICIPIO>
<ID_ARP>10</ID_ARP>
<ID_SECCIONAL>2</ID_SECCIONAL>
<ID_ACT_ECONOMICA>1521101</ID_ACT_ECONOMICA>
<ID_TIPO_DOC_REP_LEGAL>CC</ID_TIPO_DOC_REP_LEGAL>
<DV_EMPRESA>H</DV_EMPRESA>
<RAZON_SOCIAL>COMERCIALIZADORA</RAZON_SOCIAL>
<DIRECCION_EMPRESA> CALLE 36</DIRECCION_EMPRESA>
<TELEFONO_EMPRESA>0</TELEFONO_EMPRESA>
<FAX_EMPRESA>123456</FAX_EMPRESA>
<EMAIL_EMPRESA>[email protected]</EMAIL_EMPRESA>
<IND_ZONA>U</IND_ZONA>
<IND_TIPO_EMPLEADOR>0</IND_TIPO_EMPLEADOR>
<NUMERO_TRABAJADORES>1</NUMERO_TRABAJADORES>
<FECHA_INGRESO>2005-06-28T00:00:00.0000000-05:00</FECHA_INGRESO>
<MECANIZADA>N</MECANIZADA>
<TRANSPORTE_PRODUCTOS>N</TRANSPORTE_PRODUCTOS>
<TRANSPORTE_TRABAJADORES>N</TRANSPORTE_TRABAJADORES>
<NUMERO_FORM_AFILIACION>Sin # For</NUMERO_FORM_AFILIACION>
<FECHA_RADICACION>2006-07-31T00:00:00.0000000-05:00</FECHA_RADICACION>
<VINCULACION_PRIMERA_VEZ>1</VINCULACION_PRIMERA_VEZ>
<PRESENTA_INCONSISTENCIA>N</PRESENTA_INCONSISTENCIA>
<TIPO_AGENTE>3</TIPO_AGENTE>
<IND_AMBITO_EMPRESA>3</IND_AMBITO_EMPRESA>
<USUARIO>qwer</USUARIO>
<CLAVE>qwer</CLAVE>
<CAMBIO_ARP_ANTERIOR>1</CAMBIO_ARP_ANTERIOR>
<TARIFA>0.522</TARIFA>
<ESTADO>1</ESTADO>
<ID_REPRESENTANTE_LEGAL>1</ID_REPRESENTANTE_LEGAL>
<REPRESENTANTE_LEGAL>.</REPRESENTANTE_LEGAL>
<CARGO_REPRESENTANTE_LEGAL>.</CARGO_REPRESENTANTE_LEGAL>
<PERSONA_CONTACTO>fdsa</PERSONA_CONTACTO>
<PAGINA_WEB>fdsa.com</PAGINA_WEB>
<VALOR_MENSUAL>12345</VALOR_MENSUAL>
<IND_CONCORDATO>0</IND_CONCORDATO>
<FECHA_AFILIACION_EFECTIVA>2006-07-31T00:00:00.0000000-05:00</FECHA_AFILIACION_EFECTIVA>
<BTS_REPLICA>1</BTS_REPLICA>
<BTS_REPLICA_S>0</BTS_REPLICA_S>
</GRAL_MA_EMPRESA>
<GRAL_MA_EMPRESA>
<ID_TIPO_DOC>NI</ID_TIPO_DOC>
<ID_EMPRESA>855555555</ID_EMPRESA>
<ID_TIPO_DOC_TRAB_ARP>NU</ID_TIPO_DOC_TRAB_ARP>
<ID_TRABAJADOR>0</ID_TRABAJADOR>
<ID_DEPARTAMENTO>11</ID_DEPARTAMENTO>
<ID_MUNICIPIO>1</ID_MUNICIPIO>
<ID_ARP>10</ID_ARP>
<ID_SECCIONAL>0</ID_SECCIONAL>
<ID_ACT_ECONOMICA>1702001</ID_ACT_ECONOMICA>
<ID_TIPO_DOC_REP_LEGAL>CC</ID_TIPO_DOC_REP_LEGAL>
<RAZON_SOCIAL>URBANIZACION</RAZON_SOCIAL>
<DIRECCION_EMPRESA>CRA 91</DIRECCION_EMPRESA>
<TELEFONO_EMPRESA>6855505</TELEFONO_EMPRESA>
<FAX_EMPRESA>0</FAX_EMPRESA>
<IND_ZONA>U</IND_ZONA>
<IND_TIPO_EMPLEADOR>0</IND_TIPO_EMPLEADOR>
<NUMERO_TRABAJADORES>1</NUMERO_TRABAJADORES>
<FECHA_INGRESO>2004-09-08T00:00:00.0000000-05:00</FECHA_INGRESO>
<MECANIZADA>N</MECANIZADA>
<TRANSPORTE_PRODUCTOS>N</TRANSPORTE_PRODUCTOS>
<TRANSPORTE_TRABAJADORES>N</TRANSPORTE_TRABAJADORES>
<NUMERO_FORM_AFILIACION>0</NUMERO_FORM_AFILIACION>
<FECHA_RADICACION>2006-07-31T00:00:00.0000000-05:00</FECHA_RADICACION>
<VINCULACION_PRIMERA_VEZ>1</VINCULACION_PRIMERA_VEZ>
<PRESENTA_INCONSISTENCIA>N</PRESENTA_INCONSISTENCIA>
<TIPO_AGENTE>3</TIPO_AGENTE>
<IND_AMBITO_EMPRESA>3</IND_AMBITO_EMPRESA>
<CAMBIO_ARP_ANTERIOR>0</CAMBIO_ARP_ANTERIOR>
<TARIFA>0.522</TARIFA>
<ESTADO>1</ESTADO>
<ID_REPRESENTANTE_LEGAL>16777888</ID_REPRESENTANTE_LEGAL>
<REPRESENTANTE_LEGAL>Umberto Reyes</REPRESENTANTE_LEGAL>
<CARGO_REPRESENTANTE_LEGAL>Manager</CARGO_REPRESENTANTE_LEGAL>
<FECHA_AFILIACION_EFECTIVA>2006-07-31T00:00:00.0000000-05:00</FECHA_AFILIACION_EFECTIVA>
<BTS_REPLICA>1</BTS_REPLICA>
<BTS_REPLICA_S>1</BTS_REPLICA_S>
</GRAL_MA_EMPRESA>
</ns0:ResponseEmpresa>This is the message obtained after applying the transformation:
<ns0:ResponseEmpresa xmlns:ns0="SIARP:Empresa">
<GRAL_MA_EMPRESA>
<ID_TIPO_DOC />
<ID_EMPRESA />
<ID_TIPO_DOC_CORREDOR />
<ID_CORREDOR />
<ID_TIPO_DOC_TRAB_ARP />
<ID_TRABAJADOR />
<ID_DEPARTAMENTO />
<ID_MUNICIPIO />
<ID_ARP />
<ID_SECCIONAL />
<ID_ACT_ECONOMICA />
<ID_TIPO_DOC_REP_LEGAL />
<DV_EMPRESA />
<RAZON_SOCIAL />
<DIRECCION_EMPRESA />
<TELEFONO_EMPRESA />
<FAX_EMPRESA />
<EMAIL_EMPRESA />
<IND_ZONA />
<IND_TIPO_EMPLEADOR />
<NUMERO_TRABAJADORES />
<FECHA_INGRESO />
<MECANIZADA />
<TRANSPORTE_PRODUCTOS />
<TRANSPORTE_TRABAJADORES />
<NUMERO_FORM_AFILIACION />
<FECHA_RADICACION />
<VINCULACION_PRIMERA_VEZ />
<PRESENTA_INCONSISTENCIA />
<TIPO_AGENTE />
<IND_AMBITO_EMPRESA />
<USUARIO />
<CLAVE />
<CAMBIO_ARP_ANTERIOR />
<TARIFA />
<ESTADO />
<ID_REPRESENTANTE_LEGAL />
<REPRESENTANTE_LEGAL />
<CARGO_REPRESENTANTE_LEGAL />
<PERSONA_CONTACTO />
<PAGINA_WEB />
<VALOR_MENSUAL />
<IND_CONCORDATO />
<FECHA_AFILIACION_EFECTIVA />
<BTS_REPLICA>0</BTS_REPLICA>
<BTS_REPLICA_S>0</BTS_REPLICA_S>
</GRAL_MA_EMPRESA>
</ns0:ResponseEmpresa>I should also mention that in the map I'm using an index functoid to extract one of the companies indexed by another value.
I hope this information is enough. Please let me know if you need anything else.
Thanks a lot for your collaboration.
-
September 10, 2006 at 11:53 AM #15637
The problem is that the schema you're using has the elementFormDefault option set to "qualified", which means child elements must also be inside the target namespace of the schema. The instances you're using don't conform to this. For example, you have this:
<ns0:ResponseEmpresa xmlns:ns0="SIARP:Empresa">
<GRAL_MA_EMPRESA>
<ID_TIPO_DOC />
<ID_EMPRESA />
…
When you should have this:
<ns0:ResponseEmpresa xmlns:ns0="SIARP:Empresa">
<ns0:GRAL_MA_EMPRESA>
<ns0:ID_TIPO_DOC />
<ns0:ID_EMPRESA />
…Or this (which is equivalent)
<ResponseEmpresa xmlns="SIARP:Empresa">
<GRAL_MA_EMPRESA>
<ID_TIPO_DOC />
<ID_EMPRESA />
…Either fix your messages, or fix your schema.
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.