BizTalk Server - Problem in Map - Avoid the Empty Element

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server > June 2006 > Problem in Map - Avoid the Empty Element





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problem in Map - Avoid the Empty Element
Murugan

2006-06-28, 1:21 pm

Hi all,

I have a problem to generate the destination schema without empty element. I
explained my problem with source and destination data.

inbound schema :

<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://emptySample.Schema1"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://emptySample.Schema1"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Emp">
<xs:complexType>
<xs:attribute name="FirstName" type="xs:string" />
<xs:attribute name="LastName" type="xs:string" />
<xs:attribute name="MiddleName" type="xs:string" />
<xs:attribute name="Address1" type="xs:string" />
<xs:attribute name="Address2" type="xs:string" />
<xs:attribute name="City" type="xs:string" />
<xs:attribute name="State" type="xs:string" />
<xs:attribute name="Zip" type="xs:string" />
<xs:attribute name="DOB" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:schema>

Outbound schema:

<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://emptySample.Schema2"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://emptySample.Schema2"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Employee">
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:complexType>
<xs:attribute name="First" type="xs:string" />
<xs:attribute name="Last" type="xs:string" />
<xs:attribute name="Middle" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Address">
<xs:complexType>
<xs:attribute name="Line1" type="xs:string" />
<xs:attribute name="Line2" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Geography">
<xs:complexType>
<xs:attribute name="City" type="xs:string" />
<xs:attribute name="State" type="xs:string" />
<xs:attribute name="Zip" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Personal">
<xs:complexType>
<xs:attribute name="DOB" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>



Inbound Data:

<ns0:Emp
FirstName="FirstName_0"
LastName="LastName_1"
MiddleName="MiddleName_2"
Address1="Address1_3"
Address2="Address2_4"
City="City_5"
State="State_6"
Zip="Zip_7"
xmlns:ns0="http://emptySample.Schema1" />


After Mapping using logical existance and value map functionoids

Outbound data:

<?xml version="1.0" encoding="utf-8"?>
<ns0:Employee xmlns:ns0="http://emptySample.Schema2">
<Name First="FirstName_0" Last="LastName_1" Middle="MiddleName_2"></Name>
<Address Line1="Address1_3" Line2="Address2_4"></Address>
<Geography City="City_5" State="State_6" Zip="Zip_7"></Geography>
<Personal></Personal>
</ns0:Employee>


In outbound data i have empty element. how to avoid this empty element
("<Personal></Personal> ") .


If anybody know the solution please share with me,

Thanks in advance

Murugan A

Peter Kelcey [msft]

2006-06-28, 9:14 pm

Murugan

One option is to link the incoming DOB attribute to the logical existence
functoid and then link the functoid to the Personal node in the outgoing
schema. Then, link the incoming DOB attribute to the outgoing DOB attribute.
Using this, I got the following output

<ns0:Employee xmlns:ns0="http://emptySample.Schema2">
<Name First="FirstName_0" Last="LastName_1" Middle="MiddleName_2" />
<Address Line1="Address1_3" Line2="Address2_4" />
<Geography City="City_5" State="State_6" Zip="Zip_7" />
</ns0:Employee>

Hope that helps

Peter

"Murugan" wrote:

> Hi all,
>
> I have a problem to generate the destination schema without empty element. I
> explained my problem with source and destination data.
>
> inbound schema :
>
> <?xml version="1.0" encoding="utf-16" ?>
> <xs:schema xmlns="http://emptySample.Schema1"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://emptySample.Schema1"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Emp">
> <xs:complexType>
> <xs:attribute name="FirstName" type="xs:string" />
> <xs:attribute name="LastName" type="xs:string" />
> <xs:attribute name="MiddleName" type="xs:string" />
> <xs:attribute name="Address1" type="xs:string" />
> <xs:attribute name="Address2" type="xs:string" />
> <xs:attribute name="City" type="xs:string" />
> <xs:attribute name="State" type="xs:string" />
> <xs:attribute name="Zip" type="xs:string" />
> <xs:attribute name="DOB" type="xs:string" />
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> Outbound schema:
>
> <?xml version="1.0" encoding="utf-16" ?>
> <xs:schema xmlns="http://emptySample.Schema2"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://emptySample.Schema2"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Employee">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Name">
> <xs:complexType>
> <xs:attribute name="First" type="xs:string" />
> <xs:attribute name="Last" type="xs:string" />
> <xs:attribute name="Middle" type="xs:string" />
> </xs:complexType>
> </xs:element>
> <xs:element name="Address">
> <xs:complexType>
> <xs:attribute name="Line1" type="xs:string" />
> <xs:attribute name="Line2" type="xs:string" />
> </xs:complexType>
> </xs:element>
> <xs:element name="Geography">
> <xs:complexType>
> <xs:attribute name="City" type="xs:string" />
> <xs:attribute name="State" type="xs:string" />
> <xs:attribute name="Zip" type="xs:string" />
> </xs:complexType>
> </xs:element>
> <xs:element name="Personal">
> <xs:complexType>
> <xs:attribute name="DOB" type="xs:string" />
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
>
>
> Inbound Data:
>
> <ns0:Emp
> FirstName="FirstName_0"
> LastName="LastName_1"
> MiddleName="MiddleName_2"
> Address1="Address1_3"
> Address2="Address2_4"
> City="City_5"
> State="State_6"
> Zip="Zip_7"
> xmlns:ns0="http://emptySample.Schema1" />
>
>
> After Mapping using logical existance and value map functionoids
>
> Outbound data:
>
> <?xml version="1.0" encoding="utf-8"?>
> <ns0:Employee xmlns:ns0="http://emptySample.Schema2">
> <Name First="FirstName_0" Last="LastName_1" Middle="MiddleName_2"></Name>
> <Address Line1="Address1_3" Line2="Address2_4"></Address>
> <Geography City="City_5" State="State_6" Zip="Zip_7"></Geography>
> <Personal></Personal>
> </ns0:Employee>
>
>
> In outbound data i have empty element. how to avoid this empty element
> ("<Personal></Personal> ") .
>
>
> If anybody know the solution please share with me,
>
> Thanks in advance
>
> Murugan A
>

Peter Kelcey [msft]

2006-06-29, 1:18 am

Murugan

One option is to link the incoming DOB attribute to the logical existence
functoid and then link the functoid to the Personal node in the outgoing
schema. Then, link the incoming DOB attribute to the outgoing DOB attribute.
Using this, I got the following output

<ns0:Employee xmlns:ns0="http://emptySample.Schema2">
<Name First="FirstName_0" Last="LastName_1" Middle="MiddleName_2" />
<Address Line1="Address1_3" Line2="Address2_4" />
<Geography City="City_5" State="State_6" Zip="Zip_7" />
</ns0:Employee>

Hope that helps

Peter

"Murugan" wrote:

> Hi all,
>
> I have a problem to generate the destination schema without empty element. I
> explained my problem with source and destination data.
>
> inbound schema :
>
> <?xml version="1.0" encoding="utf-16" ?>
> <xs:schema xmlns="http://emptySample.Schema1"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://emptySample.Schema1"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Emp">
> <xs:complexType>
> <xs:attribute name="FirstName" type="xs:string" />
> <xs:attribute name="LastName" type="xs:string" />
> <xs:attribute name="MiddleName" type="xs:string" />
> <xs:attribute name="Address1" type="xs:string" />
> <xs:attribute name="Address2" type="xs:string" />
> <xs:attribute name="City" type="xs:string" />
> <xs:attribute name="State" type="xs:string" />
> <xs:attribute name="Zip" type="xs:string" />
> <xs:attribute name="DOB" type="xs:string" />
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> Outbound schema:
>
> <?xml version="1.0" encoding="utf-16" ?>
> <xs:schema xmlns="http://emptySample.Schema2"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://emptySample.Schema2"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Employee">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Name">
> <xs:complexType>
> <xs:attribute name="First" type="xs:string" />
> <xs:attribute name="Last" type="xs:string" />
> <xs:attribute name="Middle" type="xs:string" />
> </xs:complexType>
> </xs:element>
> <xs:element name="Address">
> <xs:complexType>
> <xs:attribute name="Line1" type="xs:string" />
> <xs:attribute name="Line2" type="xs:string" />
> </xs:complexType>
> </xs:element>
> <xs:element name="Geography">
> <xs:complexType>
> <xs:attribute name="City" type="xs:string" />
> <xs:attribute name="State" type="xs:string" />
> <xs:attribute name="Zip" type="xs:string" />
> </xs:complexType>
> </xs:element>
> <xs:element name="Personal">
> <xs:complexType>
> <xs:attribute name="DOB" type="xs:string" />
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
>
>
> Inbound Data:
>
> <ns0:Emp
> FirstName="FirstName_0"
> LastName="LastName_1"
> MiddleName="MiddleName_2"
> Address1="Address1_3"
> Address2="Address2_4"
> City="City_5"
> State="State_6"
> Zip="Zip_7"
> xmlns:ns0="http://emptySample.Schema1" />
>
>
> After Mapping using logical existance and value map functionoids
>
> Outbound data:
>
> <?xml version="1.0" encoding="utf-8"?>
> <ns0:Employee xmlns:ns0="http://emptySample.Schema2">
> <Name First="FirstName_0" Last="LastName_1" Middle="MiddleName_2"></Name>
> <Address Line1="Address1_3" Line2="Address2_4"></Address>
> <Geography City="City_5" State="State_6" Zip="Zip_7"></Geography>
> <Personal></Personal>
> </ns0:Employee>
>
>
> In outbound data i have empty element. how to avoid this empty element
> ("<Personal></Personal> ") .
>
>
> If anybody know the solution please share with me,
>
> Thanks in advance
>
> Murugan A
>

Murugan

2006-06-29, 8:03 am

Hi Peter Kelcey,

Thanks for immediate reply,

Already i have an idea about the logical exitance functoids , but its give
the output for older mapper (its not applied) , After restarting my server
its give the correct data for my need.

how rectify this problem.

Thanks

Murugan A

"Peter Kelcey [msft]" wrote:
[vbcol=seagreen]
> Murugan
>
> One option is to link the incoming DOB attribute to the logical existence
> functoid and then link the functoid to the Personal node in the outgoing
> schema. Then, link the incoming DOB attribute to the outgoing DOB attribute.
> Using this, I got the following output
>
> <ns0:Employee xmlns:ns0="http://emptySample.Schema2">
> <Name First="FirstName_0" Last="LastName_1" Middle="MiddleName_2" />
> <Address Line1="Address1_3" Line2="Address2_4" />
> <Geography City="City_5" State="State_6" Zip="Zip_7" />
> </ns0:Employee>
>
> Hope that helps
>
> Peter
>
> "Murugan" wrote:
>
Murugan

2006-06-29, 1:17 pm

Hi Peter Kelcey,

Thanks for immediate reply,

Already i have an idea about the logical exitance functoids , but its give
the output for older mapper (its not applied) , After restarting my server
its give the correct data for my need.

how rectify this problem.

Thanks

Murugan A

"Peter Kelcey [msft]" wrote:
[vbcol=seagreen]
> Murugan
>
> One option is to link the incoming DOB attribute to the logical existence
> functoid and then link the functoid to the Personal node in the outgoing
> schema. Then, link the incoming DOB attribute to the outgoing DOB attribute.
> Using this, I got the following output
>
> <ns0:Employee xmlns:ns0="http://emptySample.Schema2">
> <Name First="FirstName_0" Last="LastName_1" Middle="MiddleName_2" />
> <Address Line1="Address1_3" Line2="Address2_4" />
> <Geography City="City_5" State="State_6" Zip="Zip_7" />
> </ns0:Employee>
>
> Hope that helps
>
> Peter
>
> "Murugan" wrote:
>
Peter Kelcey [msft]

2006-06-29, 1:50 pm

Okay, so from what I understand, you're saying that you deployed a new
version of your map but when you ran a test the old version of your map was
used. Once you restarted your server, the new map was used and it worked fine.

If that's the problem, then you just need to restart you host instance after
you deploy your changes. You can do this manually by using the BizTalk
administration console (find your instance under Platform Settings->Host
Instances, right click it and choose restart. Alternatively you can set the
"restart host instances" property of your Visual Studio project to true. You
can find this property by right clicking on your BizTalk project in visual
studio and selecting the properties option. Then, select the deployment
option under the configuration properties. You'll see the restart host
instance option there. This will restart the instance automatically for you
on a deployment.

If that's not the problem you're having, let me know.

Peter

"Murugan" wrote:
[vbcol=seagreen]
> Hi Peter Kelcey,
>
> Thanks for immediate reply,
>
> Already i have an idea about the logical exitance functoids , but its give
> the output for older mapper (its not applied) , After restarting my server
> its give the correct data for my need.
>
> how rectify this problem.
>
> Thanks
>
> Murugan A
>
> "Peter Kelcey [msft]" wrote:
>
Peter Kelcey [msft]

2006-06-29, 7:17 pm

Okay, so from what I understand, you're saying that you deployed a new
version of your map but when you ran a test the old version of your map was
used. Once you restarted your server, the new map was used and it worked fine.

If that's the problem, then you just need to restart you host instance after
you deploy your changes. You can do this manually by using the BizTalk
administration console (find your instance under Platform Settings->Host
Instances, right click it and choose restart. Alternatively you can set the
"restart host instances" property of your Visual Studio project to true. You
can find this property by right clicking on your BizTalk project in visual
studio and selecting the properties option. Then, select the deployment
option under the configuration properties. You'll see the restart host
instance option there. This will restart the instance automatically for you
on a deployment.

If that's not the problem you're having, let me know.

Peter

"Murugan" wrote:
[vbcol=seagreen]
> Hi Peter Kelcey,
>
> Thanks for immediate reply,
>
> Already i have an idea about the logical exitance functoids , but its give
> the output for older mapper (its not applied) , After restarting my server
> its give the correct data for my need.
>
> how rectify this problem.
>
> Thanks
>
> Murugan A
>
> "Peter Kelcey [msft]" wrote:
>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com