Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Unchase OData V1-V4 Connected Service (Unauthorized) #3

Closed
gem81 opened this issue Apr 11, 2019 · 5 comments
Closed

Creating Unchase OData V1-V4 Connected Service (Unauthorized) #3

gem81 opened this issue Apr 11, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@gem81
Copy link

gem81 commented Apr 11, 2019

somewhere between
[11.04.2019 17:43:49.073] Generating Client Proxy extensions class for OData V3...
[11.04.2019 17:43:50.147] Error: Remote host ...... : (401) Unauthorized..
[11.04.2019 17:43:51.786] Client Proxy extensions class for OData V3 was generated.

This happens only with checked
Generate OData methods from FunctionImports.

@gem81
Copy link
Author

gem81 commented Apr 11, 2019

as a result, functions are not created.

@unchase
Copy link
Owner

unchase commented Apr 11, 2019

Before code generation, did you check options "Use network credentials for connecting to the endpoint :" and/or "Use web-proxy for connecting to the endpoint :" along with "Use web-proxy credentials for connecting to the endpoint :"?
What generation method did you use: "Inner" or "SimpleOData"?

What endpoint did you use?

@gem81
Copy link
Author

gem81 commented Apr 11, 2019

Before code generation, did you check options "Use network credentials for connecting to the endpoint :" and/or "Use web-proxy for connecting to the endpoint :" along with "Use web-proxy credentials for connecting to the endpoint :"?

Use network credentials for connecting to the endpoint: checked
Proxy not checked

What generation method did you use: "Inner" or "SimpleOData"?
Both

What endpoint did you use?

"http://192.168.1.110/ut_kaskad/odata/standard.odata/"

If i try to import whith functions, its generate the same proxy class, but i see error exception
/Unchase.OData.ConnectedService/CodeGeneration/V3CodeGenDescriptor.cs
if (this.ServiceConfiguration.IncludeExtensionsT4File && this.ServiceConfiguration.GenerateFunctionImports)
{
try
{
if (EdmxReader.TryParse(XmlReader.Create(ServiceConfiguration.Endpoint), out var model, out var parseErrors))
functionMethods = FunctionImportsHelper.GetFunctionImportsCode(model, proxyClassName, ServiceConfiguration.Endpoint.Replace("$metadata", string.Empty), this.ServiceConfiguration.FunctionImportsGenerator);
else
{
foreach (var error in parseErrors)
await this.Context.Logger.WriteMessageAsync(LoggerMessageCategory.Warning, error.ErrorMessage);
}
}
catch (Exception ex)
{
await this.Context.Logger.WriteMessageAsync(LoggerMessageCategory.Error, $"Error: {ex.Message}.");
}
}

@gem81
Copy link
Author

gem81 commented Apr 11, 2019

It seems that at the time of generating functions, the context loses authorization, trying to make an additional request to the server.

unchase added a commit that referenced this issue Apr 11, 2019
@unchase unchase added the bug Something isn't working label Apr 11, 2019
@unchase unchase self-assigned this Apr 11, 2019
@unchase
Copy link
Owner

unchase commented Apr 11, 2019

Fixed in last commit (v 0.3.14). Please, check the issue.

@gem81 gem81 closed this as completed Apr 12, 2019
unchase added a commit that referenced this issue Apr 12, 2019
@unchase unchase changed the title Creating Unchase OData V1-V4 Connected Service Creating Unchase OData V1-V4 Connected Service (Unauthorized) Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants