Visual Studio 2008 & Web Services

Oops - corrections.....

It was helpful guidence :o)
and .Net 1.1 must be on the WebServer that serves the webservices to VS2005 (in my case it was same machine)

--- In vantage@yahoogroups.com, "bw2868bond" <bwalker@...> wrote:
>
> I spent untold hours trying to make VS2008 and WSE 3.0 play well together. I tried a couple of workarounds found by google searches but was never able to get it to work.
>
> As an aside, I wiped out the hdd on the machine I tried that on, and reinstalled server 2003 and then VS2005. WSE 3.0 was integrated with VS2005 and still the WSE Proxy classes were not being created properly. After much head banging, and some helful guidance from Stephen Edginton in the UK, I discovered that .Net 1.1 must be installed on the machine that runs VS2005 because the Proxy Generator used by WebServices makes calls to .dll files that are not included with any other version of .Net
>
> Good Luck and if you manage to sort it out and get it to work, let us all know :o)
>
> --- In vantage@yahoogroups.com, "Steve" <sljones@> wrote:
> >
> > Has anyone used VS2008 to create interface with web services? The web services developer guide says to use VS2005 and MS Web Service Enhancements 3.0.
> >
> > We use VS2008 and apparently WS3.0 and VS2008 do not play together friendly. I seem to be missing something in the config - not sure what. Can anyone point me in the right direction? My code so far returns an Internal Server Error (500) when I try to read the response.
> >
> > Steve
> >
> > HttpWebRequest vRequest = (HttpWebRequest)WebRequest.Create("http://10.1.1.32/VantageServices/PartService.asmx");
> > vRequest.Proxy = new WebProxy();
> > vRequest.Headers.Add("SOAPAction", "http://epicor.com/webservices/GetByID");
> > vRequest.Method = "POST";
> > vRequest.ContentType = "text/xml; charset=utf-8";
> > vRequest.KeepAlive = false;
> > //vRequest.AuthenticationLevel = new System.Net.Security.AuthenticationLevel();
> > //vRequest.Credentials = ICredentials
> >
> > string vRequestData = "";
> > vRequestData = "<?xml version='1.0' encoding='utf-8'?>" +
> > "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
> > " <soap:Body>" +
> > " <GetList xmlns='http://epicor.com/webservices/'>" +
> > " <CompanyID>ABCCompany</CompanyID>" +
> > " <whereClause>TypeCode = 'M'</whereClause>" +
> > " <pageSize>10</pageSize>" +
> > " <absolutePage>10</absolutePage>" +
> > " </GetList>" +
> > " </soap:Body>" +
> > "</soap:Envelope>";
> > System.Text.ASCIIEncoding vEncoding = new System.Text.ASCIIEncoding();
> > byte[] vBytes = vEncoding.GetBytes(vRequestData);
> >
> > vRequest.ContentLength = vRequestData.Length;
> > Stream vStream = vRequest.GetRequestStream();
> > vStream.Write(vBytes, 0, vBytes.Length);
> > vStream.Close();
> > try
> > {
> > WebResponse vResponse = vRequest.GetResponse();
> > string vResponseData = vResponse.ToString();
> > }
> > catch (Exception ex)
> > {
> > MessageBox.Show(ex.Message + " and " + ex.Source);
> > }
> >
>
Has anyone used VS2008 to create interface with web services? The web services developer guide says to use VS2005 and MS Web Service Enhancements 3.0.

We use VS2008 and apparently WS3.0 and VS2008 do not play together friendly. I seem to be missing something in the config - not sure what. Can anyone point me in the right direction? My code so far returns an Internal Server Error (500) when I try to read the response.

Steve

HttpWebRequest vRequest = (HttpWebRequest)WebRequest.Create("http://10.1.1.32/VantageServices/PartService.asmx");
vRequest.Proxy = new WebProxy();
vRequest.Headers.Add("SOAPAction", "http://epicor.com/webservices/GetByID");
vRequest.Method = "POST";
vRequest.ContentType = "text/xml; charset=utf-8";
vRequest.KeepAlive = false;
//vRequest.AuthenticationLevel = new System.Net.Security.AuthenticationLevel();
//vRequest.Credentials = ICredentials

string vRequestData = "";
vRequestData = "<?xml version='1.0' encoding='utf-8'?>" +
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
" <soap:Body>" +
" <GetList xmlns='http://epicor.com/webservices/'>" +
" <CompanyID>ABCCompany</CompanyID>" +
" <whereClause>TypeCode = 'M'</whereClause>" +
" <pageSize>10</pageSize>" +
" <absolutePage>10</absolutePage>" +
" </GetList>" +
" </soap:Body>" +
"</soap:Envelope>";
System.Text.ASCIIEncoding vEncoding = new System.Text.ASCIIEncoding();
byte[] vBytes = vEncoding.GetBytes(vRequestData);

vRequest.ContentLength = vRequestData.Length;
Stream vStream = vRequest.GetRequestStream();
vStream.Write(vBytes, 0, vBytes.Length);
vStream.Close();
try
{
WebResponse vResponse = vRequest.GetResponse();
string vResponseData = vResponse.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + " and " + ex.Source);
}
I spent untold hours trying to make VS2008 and WSE 3.0 play well together. I tried a couple of workarounds found by google searches but was never able to get it to work.

As an aside, I wiped out the hdd on the machine I tried that on, and reinstalled server 2003 and then VS2005. WSE 3.0 was integrated with VS2005 and still the WSE Proxy classes were not being created properly. After much head banging, and some helful guidance from Stephen Edginton in the UK, I discovered that .Net 1.1 must be installed on the machine that runs VS2005 because the Proxy Generator used by WebServices makes calls to .dll files that are not included with any other version of .Net

Good Luck and if you manage to sort it out and get it to work, let us all know :o)

--- In vantage@yahoogroups.com, "Steve" <sljones@...> wrote:
>
> Has anyone used VS2008 to create interface with web services? The web services developer guide says to use VS2005 and MS Web Service Enhancements 3.0.
>
> We use VS2008 and apparently WS3.0 and VS2008 do not play together friendly. I seem to be missing something in the config - not sure what. Can anyone point me in the right direction? My code so far returns an Internal Server Error (500) when I try to read the response.
>
> Steve
>
> HttpWebRequest vRequest = (HttpWebRequest)WebRequest.Create("http://10.1.1.32/VantageServices/PartService.asmx");
> vRequest.Proxy = new WebProxy();
> vRequest.Headers.Add("SOAPAction", "http://epicor.com/webservices/GetByID");
> vRequest.Method = "POST";
> vRequest.ContentType = "text/xml; charset=utf-8";
> vRequest.KeepAlive = false;
> //vRequest.AuthenticationLevel = new System.Net.Security.AuthenticationLevel();
> //vRequest.Credentials = ICredentials
>
> string vRequestData = "";
> vRequestData = "<?xml version='1.0' encoding='utf-8'?>" +
> "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
> " <soap:Body>" +
> " <GetList xmlns='http://epicor.com/webservices/'>" +
> " <CompanyID>ABCCompany</CompanyID>" +
> " <whereClause>TypeCode = 'M'</whereClause>" +
> " <pageSize>10</pageSize>" +
> " <absolutePage>10</absolutePage>" +
> " </GetList>" +
> " </soap:Body>" +
> "</soap:Envelope>";
> System.Text.ASCIIEncoding vEncoding = new System.Text.ASCIIEncoding();
> byte[] vBytes = vEncoding.GetBytes(vRequestData);
>
> vRequest.ContentLength = vRequestData.Length;
> Stream vStream = vRequest.GetRequestStream();
> vStream.Write(vBytes, 0, vBytes.Length);
> vStream.Close();
> try
> {
> WebResponse vResponse = vRequest.GetResponse();
> string vResponseData = vResponse.ToString();
> }
> catch (Exception ex)
> {
> MessageBox.Show(ex.Message + " and " + ex.Source);
> }
>