lab icon indicating copy to clipboard operation
lab copied to clipboard

Unable to Connect

Open nla-brandonjames opened this issue 7 years ago • 50 comments

After I get the extension installed and expose the metadata to the public, the extension returns this when I try to add the connection. A detail about my connection is that we aren't currently using a valid SSL certificate. I can, however, pull the XML data up in a web browser.

Imgur

nla-brandonjames avatar Jul 31 '17 18:07 nla-brandonjames

any news on this? I'm stuck with the same issue...

lalaqc avatar Aug 03 '17 13:08 lalaqc

I actually got in contact with the feedback contact for this extension, but he's telling me to get a valid SSL certificate for the endpoint. However, I don't see the validity in that because we're developers and not having a certificate for a server is part of the development process.

nla-brandonjames avatar Aug 07 '17 14:08 nla-brandonjames

try this: run Fiddler4 and allow https decryption. Then update your odata-services.

robsiera avatar Aug 11 '17 06:08 robsiera

This works for me:

Use the OData v4 Client Code Generator extension instead. It says it only support to 2015 version but it work on 2017. The extension need a pre-release version of the OData.Client you can get at: https://www.myget.org/feed/odlnightly/package/nuget/Microsoft.OData.Client

To get through credentials, get the metadata from a browser from https://[your url]/odata/$metadata, save it in a local file with the edmx extension and set it as a source of the Code Generator.

Hope this help

lalaqc avatar Aug 11 '17 12:08 lalaqc

@lalaqc Saving it as as edmx file let it get to code generation, but I didn't download the solution in #51 yet. However, the web service I'm connected to is on OData v3. I get this error when performing those steps:

Severity	Code	Description	Project	File	Line	Suppression State
Warning		Running transformation: The element 'edmx:Edmx' was unexpected for the root element. The root element should be Edmx.

nla-brandonjames avatar Aug 11 '17 13:08 nla-brandonjames

After updating to version 0.3 (#63), I still get this error message.

nla-brandonjames avatar Sep 01 '17 17:09 nla-brandonjames

Any update on this? I'm trying to access a public service (Cezanne, one of the biggest hr platforms). Worked smoothly in VS 2015 using WCF Connected Service but after upgrading to VS 2017 and installing OData Connected Service, I get an error "can not access https://serviceurl/$metadata".

siberianguy avatar Sep 07 '17 19:09 siberianguy

I had not come across this issue on my environment. Can you try these steps as a smoke test first?

If the above passes, then we can proceed to try to debug the issues on your particular environments. You will need to sync the source code. Then follow the information to debug here and here.

For starters, I would try putting a breakpoint at line 111 here.

Hope that helps!

edit: sorry accidentally clicked the close issue button.

AlanWong-MS avatar Sep 11 '17 19:09 AlanWong-MS

@AlanWong-MS To be sure it has something to do with my environment, could you please try the service url that doesn't work for me: https://w3.cezanneondemand.com/CezanneOnDemand/v3/Dataservice.svc/

siberianguy avatar Sep 11 '17 20:09 siberianguy

@siberianguy the endpoint requires authentication and at the moment the project doesn't support it. We have this issue flagged as priority 1 and will be discussing it later this week.

AlanWong-MS avatar Sep 11 '17 21:09 AlanWong-MS

@AlanWong-MS Yeah, I expected it to be related to authentication. Thank you for the update. Is it possible to give any estimation? It's blocking us from moving to .net core at the moment.

siberianguy avatar Sep 11 '17 22:09 siberianguy

@siberianguy at the moment, the discussion is scheduled for Friday. I'll keep this thread posted on updates. @nla-brandonjames does your endpoint also require authentication?

AlanWong-MS avatar Sep 11 '17 22:09 AlanWong-MS

@AlanWong-MS, it does (cookie authentication). However, SAP was able to include a configuration option where the endpoint is exposed. I performed this step.

nla-brandonjames avatar Sep 11 '17 22:09 nla-brandonjames

Hi. I was having the same problem trying to connect to SAP Service Layer, so I just forked the project and made a fix for it..

here you can get the modified source code

To use it, you can open the solution at this folder and run(debug) it (Uninstall any vesion you already have installed first).

Gabee01 avatar Sep 14 '17 16:09 Gabee01

@Gabee01 When I install this, the Connected Services dialog doesn't list OData Connected Service any more for some reason. edit: Scratch that, I can't even build the extension from master and it show up. Do you mind posting the vsix file you installed in this thread?

nla-brandonjames avatar Sep 14 '17 18:09 nla-brandonjames

I was able to run the project and get it to list in the Connected Services dialog in the Debug instance of VS by cloning @robsiera 's repo and pasting the changes @Gabee01 made in PR #67. However, when I get to code generation, I get the same error as posted in #64. If Gabe was able to generate a vsix that generates the code for him, then maybe he has some different setup than I do. I included my SAP metadata if you want to test code generation with it. sap-metadata.zip

nla-brandonjames avatar Sep 14 '17 19:09 nla-brandonjames

@nla-brandonjames I used the debug instance of VS to create the class. After you do it, I don't think you need the extension anymore, you just use the generated connected service. Note that, even with the metadata exposed, you still have to login (I used postman for that) before trying to connect, otherwise you'll get an error. I didn't generate a .vsix file because I couldn't get the .vsix creator tool (don't remember the name) working.. that's why I used the debug instance. #Edit And I did use VS2017 to debug the plugin and create the connected service class

Gabee01 avatar Sep 15 '17 02:09 Gabee01

@Gabee01 You can still find the vsix file from the project's /bin/Debug folder. If it's not there do you mind testing the metadata I uploaded in the last post? Ha I'm in hot anticipation for this code generation to work. It means a lot to me to get connected to SAP WS.

nla-brandonjames avatar Sep 15 '17 02:09 nla-brandonjames

@nla-brandonjames I don't have access to change our SAP metadata.. and there's nothing on my /bin/Debug folder.. You said you got the debug running, so you should be able to debug the plugin while it's trying to create your class and see where/why it crashes.

Gabee01 avatar Sep 15 '17 12:09 Gabee01

@Gabee01 You won't have to change the SAP metadata. I can't do that, either. All you'd need to do is target the edmx file by inputting its location on your hard drive when it asks for the address.

nla-brandonjames avatar Sep 15 '17 12:09 nla-brandonjames

@nla-brandonjames your metadata file is good. It generates the class as well

Gabee01 avatar Sep 15 '17 13:09 Gabee01

@Gabee01 I appreciate you performing that test! Now I'm doing some debug snooping to find where the null issue is. Check my newest contribution to #64. I think I found the reported null value. Do you have a different version of VS than I do? I'm running the Community version.

nla-brandonjames avatar Sep 15 '17 13:09 nla-brandonjames

I'm using VS CE 2017 v15.3.2

Gabee01 avatar Sep 15 '17 13:09 Gabee01

I'm on v15.3.4 that came out like 3 days ago but that shouldn't contribute to the issue should it?

nla-brandonjames avatar Sep 15 '17 13:09 nla-brandonjames

@Gabee01 Do you happen to have WCF Data Services installed on your computer?

nla-brandonjames avatar Sep 15 '17 14:09 nla-brandonjames

All,

We discussed this particular topic regarding setting up authentication in the extension during the meeting I mentioned earlier. As of this moment, we don't have resources to allocate to this item but we do have several parties asking for the feature. The discussion on how we want to approach this is spilling over into next week and I'll continue to provide updates wherever I can.

In the meantime, I encourage everyone to continue to support each other in the spirit of open source development. Thank you @Gabee01 for opening PR #67; much appreciated for your help in unblocking others. Having taken a look at the current iteration of the PR, I would recommend that it be used for test purposes only as it accepts all certificates for authentication. I'll provide feedback in the PR for alternative approaches.

AlanWong-MS avatar Sep 15 '17 22:09 AlanWong-MS

@AlanWong-MS is there an update on this and related issues?

siberianguy avatar Oct 04 '17 13:10 siberianguy

@siberianguy, PR #67 is pending changes. We don't have resources allocated for support on this at this time, but it's in our backlog.

My statement regarding using the current proposed changes in #67 only in the test environment still stands. If you choose to pull the changes in the PR, please proceed with caution.

AlanWong-MS avatar Oct 04 '17 16:10 AlanWong-MS

I tried working on this today, but couldn't test what I've done. My guess is that @nla-brandonjames was right. I updated my VS several weeks ago, and it looks like oData Connected Service does not work on VS2017 v15.3.5 (or we're missing something). The connected service plugin is installed, but all I've got on the connected services screen is that no connected service is supported for the current project type (which is the same I was using before). Trying to debug the code, it did not show any errors or complaints, it's just not working. I made the changes specified on #67, but I can't test it, and I have no experience with .xaml, so I have no idea if the code is going to work. Can anyone with the same version (VS2017 v15.3.5) try to install and use the oData Connected Services plugin, just to be sure it isn't a local issue? If possible, try to debug the project as well.

Gabee01 avatar Oct 06 '17 18:10 Gabee01

@Gabee01, I was able to connection to http://services.odata.org/AdventureWorksV3/AdventureWorks.svc/ as an example with VS2017 v15.3.5 but we have secure point that requires us to pass header information. How can I do that?

kdcllc avatar Oct 17 '17 15:10 kdcllc