<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sending Map instance to WCF service in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/sending-map-instance-to-wcf-service/m-p/587753#M15050</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This problem has been resolved. Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please share the solution here or with me at gantibabu at gmail dot com.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2013 13:09:28 GMT</pubDate>
    <dc:creator>G__Venkata_VijayaKumar</dc:creator>
    <dc:date>2013-06-13T13:09:28Z</dc:date>
    <item>
      <title>Sending Map instance to WCF service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/sending-map-instance-to-wcf-service/m-p/587751#M15048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a pdf printing project that is not built for silverlight assemblies. I decided to wrap the project functionality in a WCF service so that i can use is in my silverlight application. The only thing is that i need the map instance to be sent through WCF to the backend project so that i can print the map to PDF. Is there is a way i can send the MapApplication.Current.Map instance through WCF to the backend service. I have tried and i get serialization errors. I know the map instance will be different from normal serialization some how but i don't know how to go about serializing it for the WCF service. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the error i get from the service when i call it asynchronously from the silverlight map application:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error: Cannot obtain Metadata from &lt;/SPAN&gt;&lt;A href="http://localhost:63761/PrintMapService.svc" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt;&lt;SPAN&gt; If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at &lt;/SPAN&gt;&lt;A href="http://go.microsoft.com/fwlink/?Link...55.WS-Metadata" rel="nofollow noopener noreferrer" target="_blank"&gt;http://go.microsoft.com/fwlink/?Link...55.WS-Metadata&lt;/A&gt;&lt;SPAN&gt; Exchange Error URI: &lt;/SPAN&gt;&lt;A href="http://localhost:63761/PrintMapService.svc" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt;&lt;SPAN&gt;&lt;SPAN&gt; Metadata contains a reference that cannot be resolved: '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://localhost:63761/PrintMapService.svc" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt;&lt;SPAN&gt;'. The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.HTTP GET Error URI: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://localhost:63761/PrintMapService.svc" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt;&lt;SPAN&gt;&lt;SPAN&gt; There was an error downloading '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://localhost:63761/PrintMapService.svc" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt;&lt;SPAN&gt;'. The request failed with the error message:--&amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;Type 'System.Windows.UIElement' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. ÿIf the type is a collection, consider marking it with the CollectionDataContractAttribute. ÿSee the Microsoft .NET Framework documentation for other supported types.&amp;lt;/title&amp;gt; &amp;lt;style&amp;gt; body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } &amp;lt;/style&amp;gt; &amp;lt;/head&amp;gt; &amp;lt;body bgcolor="white"&amp;gt; &amp;lt;span&amp;gt;&amp;lt;H1&amp;gt;Server Error in '/' Application.&amp;lt;hr width=100% size=1 color=silver&amp;gt;&amp;lt;/H1&amp;gt; &amp;lt;h2&amp;gt; &amp;lt;i&amp;gt;Type 'System.Windows.UIElement' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. ÿIf the type is a collection, consider marking it with the CollectionDataContractAttribute. ÿSee the Microsoft .NET Framework documentation for other supported types.&amp;lt;/i&amp;gt; &amp;lt;/h2&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&amp;gt; &amp;lt;b&amp;gt; Description: &amp;lt;/b&amp;gt;An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; &amp;lt;b&amp;gt; Exception Details: &amp;lt;/b&amp;gt;.........&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the WCF service interface&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using ESRI.ArcGIS.Client;

namespace PrintMapWcfService
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ServiceContract]
&amp;nbsp;&amp;nbsp;&amp;nbsp; public interface PrintService
&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void CreatePDF(Map _map);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any useful suggestion will be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/sending-map-instance-to-wcf-service/m-p/587751#M15048</guid>
      <dc:creator>MosesAsuquo</dc:creator>
      <dc:date>2021-12-12T01:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sending Map instance to WCF service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/sending-map-instance-to-wcf-service/m-p/587752#M15049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have a pdf printing project that is not built for silverlight assemblies. I decided to wrap the project functionality in a WCF service so that i can use is in my silverlight application. The only thing is that i need the map instance to be sent through WCF to the backend project so that i can print the map to PDF. Is there is a way i can send the MapApplication.Current.Map instance through WCF to the backend service. I have tried and i get serialization errors. I know the map instance will be different from normal serialization some how but i don't know how to go about serializing it for the WCF service. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is the error i get from the service when i call it asynchronously from the silverlight map application:&lt;BR /&gt;&lt;BR /&gt;Error: Cannot obtain Metadata from &lt;A href="http://localhost:63761/PrintMapService.svc" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt; If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at &lt;A href="http://go.microsoft.com/fwlink/?Link...55.WS-Metadata" rel="nofollow noopener noreferrer" target="_blank"&gt;http://go.microsoft.com/fwlink/?Link...55.WS-Metadata&lt;/A&gt; Exchange Error URI: &lt;A href="http://localhost:63761/PrintMapService.svc" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt; Metadata contains a reference that cannot be resolved: '&lt;A href="http://localhost:63761/PrintMapService.svc" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt;'. The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.HTTP GET Error URI: &lt;A href="http://localhost:63761/PrintMapService.svc" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt; There was an error downloading '&lt;A href="http://localhost:63761/PrintMapService.svc" target="_blank"&gt;http://localhost:63761/PrintMapService.svc&lt;/A&gt;'. The request failed with the error message:--&amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;Type 'System.Windows.UIElement' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. ÿIf the type is a collection, consider marking it with the CollectionDataContractAttribute. ÿSee the Microsoft .NET Framework documentation for other supported types.&amp;lt;/title&amp;gt; &amp;lt;style&amp;gt; body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } &amp;lt;/style&amp;gt; &amp;lt;/head&amp;gt; &amp;lt;body bgcolor="white"&amp;gt; &amp;lt;span&amp;gt;&amp;lt;H1&amp;gt;Server Error in '/' Application.&amp;lt;hr width=100% size=1 color=silver&amp;gt;&amp;lt;/H1&amp;gt; &amp;lt;h2&amp;gt; &amp;lt;i&amp;gt;Type 'System.Windows.UIElement' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. ÿIf the type is a collection, consider marking it with the CollectionDataContractAttribute. ÿSee the Microsoft .NET Framework documentation for other supported types.&amp;lt;/i&amp;gt; &amp;lt;/h2&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&amp;gt; &amp;lt;b&amp;gt; Description: &amp;lt;/b&amp;gt;An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; &amp;lt;b&amp;gt; Exception Details: &amp;lt;/b&amp;gt;.........&lt;BR /&gt;&lt;BR /&gt;Here is the WCF service interface&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using ESRI.ArcGIS.Client;

namespace PrintMapWcfService
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; [ServiceContract]
&amp;nbsp;&amp;nbsp;&amp;nbsp; public interface PrintService
&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void CreatePDF(Map _map);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any useful suggestion will be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;thanks in advance.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This problem has been resolved. Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:15:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/sending-map-instance-to-wcf-service/m-p/587752#M15049</guid>
      <dc:creator>MosesAsuquo</dc:creator>
      <dc:date>2021-12-12T01:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sending Map instance to WCF service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/sending-map-instance-to-wcf-service/m-p/587753#M15050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This problem has been resolved. Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please share the solution here or with me at gantibabu at gmail dot com.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 13:09:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/sending-map-instance-to-wcf-service/m-p/587753#M15050</guid>
      <dc:creator>G__Venkata_VijayaKumar</dc:creator>
      <dc:date>2013-06-13T13:09:28Z</dc:date>
    </item>
  </channel>
</rss>

