cancel
Showing results for 
Search instead for 
Did you mean: 

Call Netweaver Web Service from .NET application

Former Member
0 Kudos

Hi

I have downloaded the WSDL file from SAP Netweaveer and added it as a reference to my .NET project.

I am getting the following error when calling the web service: The request failed with HTTP status 407: Proxy Authentication Required.

Could anyone please help?

My code looks as follows:

protected void Button1_Click(object sender, EventArgs e)

{

WebReference.CurrencyConversionRateQuery q = new WebApplication1.WebReference.CurrencyConversionRateQuery();

q.ExchangeRateType = "W";

q.FromCountry = "ZA";

q.ToCountry = "US";

q.Date = "2010-02-02";

WebReference.DCS_CurrencyConversionRateQuery_Out o = new WebApplication1.WebReference.DCS_CurrencyConversionRateQuery_Out();

o.Credentials = new NetworkCredential("SAPUser", "SAP_Pass");

Label1.Text = o.CurrencyConversionRateRead_Sync(q).ExchangeRate.ToString();

}

Accepted Solutions (0)

Answers (1)

Answers (1)

ravi_raman2
Active Contributor
0 Kudos

NetSpike,

You need to pass authentication credentials...DO you have them setup in netweaver ?

o.Credentials = new NetworkCredential("SAPUser", "SAP_Pass");

Where are you passing these values.

Are these setup in the SAP System.

Regards

Ravi Raman

Former Member
0 Kudos

Hi

I have changed my code to the following, which seems to connect I think, however I now receiving the following error:

The request failed with HTTP status 503: Service Unavailable.

The code now looks like this:

protected void Button1_Click(object sender, EventArgs e)

{

WebProxy myProxy = new WebProxy("http://proxy.company.co.za:8080", true);

myProxy.Credentials = new NetworkCredential("windows_user", "win_pass", "DOMAIN");

WebReference.CurrencyConversionRateQuery q = new WebApplication1.WebReference.CurrencyConversionRateQuery();

q.ExchangeRateType = "W";

q.FromCountry = "ZA";

q.ToCountry = "US";

q.Date = "2010-02-02";

WebReference.DCS_CurrencyConversionRateQuery_Out o = new WebApplication1.WebReference.DCS_CurrencyConversionRateQuery_Out();

o.Credentials = new NetworkCredential("SAP_USER", "SAP_PASS");

o.Proxy = myProxy;

Label1.Text = o.CurrencyConversionRateRead_Sync(q).ExchangeRate.ToString();

}

When I import the WSDL into soapUI with the SAP_USER and SAP_PASS credentials, then it works fine.

Edited by: NetSpike on Jul 1, 2010 11:10 AM