You need a valid Access Token before accessing the 2BA web services.
private void GetProductSoap()
{
ProductDetailsResult result = null;
// ProductClient is the generated SOAP Service Client
var productService = new ProductClient();
using (var scope = new OperationContextScope(productService.InnerChannel))
{
var httpRequestProperty = new HttpRequestMessageProperty();
httpRequestProperty.Headers.Add("Authorization", "Bearer" + " " + _accessToken);
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
result = productService.GetDetails(txtGTIN.Text, "EN");
}
if (result != null)
{
txtId.Text = result.ID;
txtManufacturerGLN.Text = result.ManufacturerGLN;
txtManufacturerName.Text = result.ManufacturerName;
}
else
{
MessageBox.Show(@"Not found!");
}
}