<?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 Silverlight and Web Reference in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/silverlight-and-web-reference/m-p/6625847#M1441194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually in my Office projects I use Web Reference in Visual Studio to connect to SAP. &lt;/P&gt;&lt;P&gt;Problem with Silverlight is that the option is not available in VS, and I can only use Service Reference, which just don't work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I do is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In SOAMANAGER create binding with user/pass login. &lt;/P&gt;&lt;P&gt;- Open WSDL for binding&lt;/P&gt;&lt;P&gt;- Paste WSDL in Add Service Reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Visual Studio can read the service, but then throws a lot of generation errors...and the reference doesn't work. &lt;/P&gt;&lt;P&gt;Can anybody use these type of Service Reference in VS with SAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: One error is "The endpoint X is not compatible with Silverlight 3"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Feb 2010 19:34:48 GMT</pubDate>
    <dc:creator>joao_sousa2</dc:creator>
    <dc:date>2010-02-21T19:34:48Z</dc:date>
    <item>
      <title>Silverlight and Web Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/silverlight-and-web-reference/m-p/6625847#M1441194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually in my Office projects I use Web Reference in Visual Studio to connect to SAP. &lt;/P&gt;&lt;P&gt;Problem with Silverlight is that the option is not available in VS, and I can only use Service Reference, which just don't work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I do is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- In SOAMANAGER create binding with user/pass login. &lt;/P&gt;&lt;P&gt;- Open WSDL for binding&lt;/P&gt;&lt;P&gt;- Paste WSDL in Add Service Reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Visual Studio can read the service, but then throws a lot of generation errors...and the reference doesn't work. &lt;/P&gt;&lt;P&gt;Can anybody use these type of Service Reference in VS with SAP?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: One error is "The endpoint X is not compatible with Silverlight 3"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Feb 2010 19:34:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/silverlight-and-web-reference/m-p/6625847#M1441194</guid>
      <dc:creator>joao_sousa2</dc:creator>
      <dc:date>2010-02-21T19:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight and Web Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/silverlight-and-web-reference/m-p/6625848#M1441195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I removed ws-policy and now Visual Studio accepts the WSDL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Feb 2010 21:26:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/silverlight-and-web-reference/m-p/6625848#M1441195</guid>
      <dc:creator>joao_sousa2</dc:creator>
      <dc:date>2010-02-21T21:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight and Web Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/silverlight-and-web-reference/m-p/6625849#M1441196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sousa, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to access a webservice created in SAP system via silverlight 3 application. I do not get any errors but i am unable to see any output of the servicall cal. here are the steps i followed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Created a class zcl_** and created a service in sicf under sap/bc and added the class as the handler.&lt;/P&gt;&lt;P&gt;2. i have written a short text message say "hello world" in the handle_request method of the handler class.&lt;/P&gt;&lt;P&gt;3. Now i create a simple silverlight 3 application in VS8 and add the following code under MainPage.xaml.cs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using System;&lt;/P&gt;&lt;P&gt;using System.Collections.Generic;&lt;/P&gt;&lt;P&gt;using System.Linq;&lt;/P&gt;&lt;P&gt;using System.Windows;&lt;/P&gt;&lt;P&gt;using System.Windows.Controls;&lt;/P&gt;&lt;P&gt;using System.Windows.Documents;&lt;/P&gt;&lt;P&gt;using System.Windows.Input;&lt;/P&gt;&lt;P&gt;using System.Windows.Media;&lt;/P&gt;&lt;P&gt;using System.Windows.Media.Animation;&lt;/P&gt;&lt;P&gt;using System.Windows.Shapes;&lt;/P&gt;&lt;P&gt;using System.IO;&lt;/P&gt;&lt;P&gt;using System.Net;&lt;/P&gt;&lt;P&gt;using System.Threading;&lt;/P&gt;&lt;P&gt;using System.Text;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;namespace MySample1&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    public partial class MainPage : UserControl&lt;/P&gt;&lt;P&gt;    {&lt;/P&gt;&lt;P&gt;        public static ManualResetEvent allDone = new ManualResetEvent(false);&lt;/P&gt;&lt;P&gt;        const int BUFFER_SIZE = 1024;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        public MainPage()&lt;/P&gt;&lt;P&gt;        {&lt;/P&gt;&lt;P&gt;            InitializeComponent();&lt;/P&gt;&lt;P&gt;            &lt;/P&gt;&lt;P&gt;        }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        // The RequestState class passes data across async calls.&lt;/P&gt;&lt;P&gt;    public class RequestState&lt;/P&gt;&lt;P&gt;        {&lt;/P&gt;&lt;P&gt;            const int BufferSize = 1024;&lt;/P&gt;&lt;P&gt;            public StringBuilder RequestData;&lt;/P&gt;&lt;P&gt;            public byte[] BufferRead;&lt;/P&gt;&lt;P&gt;            public WebRequest Request;&lt;/P&gt;&lt;P&gt;            public Stream ResponseStream;&lt;/P&gt;&lt;P&gt;            // Create Decoder for appropriate enconding type.&lt;/P&gt;&lt;P&gt;            public Decoder StreamDecode = Encoding.UTF8.GetDecoder();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            public RequestState()&lt;/P&gt;&lt;P&gt;            {&lt;/P&gt;&lt;P&gt;                BufferRead = new byte[BufferSize];&lt;/P&gt;&lt;P&gt;                RequestData = new StringBuilder(String.Empty);&lt;/P&gt;&lt;P&gt;                Request = null;&lt;/P&gt;&lt;P&gt;                ResponseStream = null;&lt;/P&gt;&lt;P&gt;            }&lt;/P&gt;&lt;P&gt;        }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        private void getDataModel(object sender, RoutedEventArgs e)&lt;/P&gt;&lt;P&gt;        {&lt;/P&gt;&lt;P&gt;            &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            System.Uri uri = new Uri("http://xxxx.xxx/sap/ztest_jvr?sap-client=000");&lt;/P&gt;&lt;P&gt;            &lt;/P&gt;&lt;P&gt;            // Create the request object.&lt;/P&gt;&lt;P&gt;            WebRequest wreq = WebRequest.Create(uri);&lt;/P&gt;&lt;P&gt;            // Create the state object.&lt;/P&gt;&lt;P&gt;            RequestState rs = new RequestState();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            // Put the request into the state object so it can be passed around.&lt;/P&gt;&lt;P&gt;            rs.Request = wreq;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            // Issue the async request.&lt;/P&gt;&lt;P&gt;            IAsyncResult r = (IAsyncResult)wreq.BeginGetResponse(&lt;/P&gt;&lt;P&gt;               new AsyncCallback(RespCallback), rs);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            // Wait until the ManualResetEvent is set so that the application &lt;/P&gt;&lt;P&gt;            // does not exit until after the callback is called.&lt;/P&gt;&lt;P&gt;            allDone.WaitOne();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            DataModeltxt.Text = rs.RequestData.ToString();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        private static void RespCallback(IAsyncResult ar)&lt;/P&gt;&lt;P&gt;        {&lt;/P&gt;&lt;P&gt;            // Get the RequestState object from the async result.&lt;/P&gt;&lt;P&gt;            RequestState rs = (RequestState)ar.AsyncState;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            // Get the WebRequest from RequestState.&lt;/P&gt;&lt;P&gt;            WebRequest req = rs.Request;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            // Call EndGetResponse, which produces the WebResponse object&lt;/P&gt;&lt;P&gt;            //  that came from the request issued above.&lt;/P&gt;&lt;P&gt;            WebResponse resp = req.EndGetResponse(ar);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            //  Start reading data from the response stream.&lt;/P&gt;&lt;P&gt;            Stream ResponseStream = resp.GetResponseStream();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            // Store the response stream in RequestState to read &lt;/P&gt;&lt;P&gt;            // the stream asynchronously.&lt;/P&gt;&lt;P&gt;            rs.ResponseStream = ResponseStream;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            //  Pass rs.BufferRead to BeginRead. Read data into rs.BufferRead&lt;/P&gt;&lt;P&gt;            IAsyncResult iarRead = ResponseStream.BeginRead(rs.BufferRead, 0,&lt;/P&gt;&lt;P&gt;               BUFFER_SIZE, new AsyncCallback(ReadCallBack), rs);&lt;/P&gt;&lt;P&gt;        }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        private static void ReadCallBack(IAsyncResult asyncResult)&lt;/P&gt;&lt;P&gt;        {&lt;/P&gt;&lt;P&gt;            // Get the RequestState object from AsyncResult.&lt;/P&gt;&lt;P&gt;            RequestState rs = (RequestState)asyncResult.AsyncState;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            // Retrieve the ResponseStream that was set in RespCallback. &lt;/P&gt;&lt;P&gt;            Stream responseStream = rs.ResponseStream;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            // Read rs.BufferRead to verify that it contains data. &lt;/P&gt;&lt;P&gt;            int read = responseStream.EndRead(asyncResult);&lt;/P&gt;&lt;P&gt;            if (read &amp;gt; 0)&lt;/P&gt;&lt;P&gt;            {&lt;/P&gt;&lt;P&gt;                // Prepare a Char array buffer for converting to Unicode.&lt;/P&gt;&lt;P&gt;                Char[] charBuffer = new Char[BUFFER_SIZE];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                // Convert byte stream to Char array and then to String.&lt;/P&gt;&lt;P&gt;                // len contains the number of characters converted to Unicode.&lt;/P&gt;&lt;P&gt;                int len =&lt;/P&gt;&lt;P&gt;                   rs.StreamDecode.GetChars(rs.BufferRead, 0, read, charBuffer, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                String str = new String(charBuffer, 0, len);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                // Append the recently read data to the RequestData stringbuilder&lt;/P&gt;&lt;P&gt;                // object contained in RequestState.&lt;/P&gt;&lt;P&gt;                //rs.RequestData.Append(&lt;/P&gt;&lt;P&gt;                  // Encoding.ASCII.GetString(rs.BufferRead, 0, read));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                // Continue reading data until &lt;/P&gt;&lt;P&gt;                // responseStream.EndRead returns u20131.&lt;/P&gt;&lt;P&gt;                IAsyncResult ar = responseStream.BeginRead(&lt;/P&gt;&lt;P&gt;                   rs.BufferRead, 0, BUFFER_SIZE,&lt;/P&gt;&lt;P&gt;                   new AsyncCallback(ReadCallBack), rs);&lt;/P&gt;&lt;P&gt;            }&lt;/P&gt;&lt;P&gt;            else&lt;/P&gt;&lt;P&gt;            {&lt;/P&gt;&lt;P&gt;                if (rs.RequestData.Length &amp;gt; 0)&lt;/P&gt;&lt;P&gt;                {&lt;/P&gt;&lt;P&gt;                    //  Display data to the console.&lt;/P&gt;&lt;P&gt;                    string strContent;&lt;/P&gt;&lt;P&gt;                    strContent = rs.RequestData.ToString();&lt;/P&gt;&lt;P&gt;                }&lt;/P&gt;&lt;P&gt;                // Close down the response stream.&lt;/P&gt;&lt;P&gt;                responseStream.Close();&lt;/P&gt;&lt;P&gt;                // Set the ManualResetEvent so the main thread can exit.&lt;/P&gt;&lt;P&gt;                allDone.Set();&lt;/P&gt;&lt;P&gt;            }&lt;/P&gt;&lt;P&gt;            return;&lt;/P&gt;&lt;P&gt;        } &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;               &lt;/P&gt;&lt;P&gt;    }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under MainPage.xaml i have a simple code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;UserControl x:Class="MySample1.MainPage"&lt;/P&gt;&lt;P&gt;    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" &lt;/P&gt;&lt;P&gt;    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/P&gt;&lt;P&gt;    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" &lt;/P&gt;&lt;P&gt;    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;Grid x:Name="LayoutRoot"&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;TextBlock x:Name="DataModelLbl" HorizontalAlignment="Center" Text="Data Model" Margin="5" Width="120" Height="30"/&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;TextBox x:Name="DataModeltxt" HorizontalAlignment="Right" Width="120" Height="30" /&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;Button  x:Name="myButton" HorizontalAlignment="Left" Content="Get Data Model" Click="getDataModel" Width="120" Height="30"/&amp;gt;      &lt;/P&gt;&lt;P&gt;    &amp;lt;/Grid&amp;gt;    &lt;/P&gt;&lt;P&gt;&amp;lt;/UserControl&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i build the applicaion and run it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system hangs. or it doesnt get me any output/error.&lt;/P&gt;&lt;P&gt;Do you have any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any steps i am missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards, JVR&lt;/P&gt;&lt;P&gt;I build the application and run it.&lt;/P&gt;&lt;P&gt;I get&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 06:12:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/silverlight-and-web-reference/m-p/6625849#M1441196</guid>
      <dc:creator>former_member331416</dc:creator>
      <dc:date>2010-04-22T06:12:38Z</dc:date>
    </item>
  </channel>
</rss>

