eBay / trading-api-dotnet-sdk

Apache License 2.0
4 stars 3 forks source link

RegulatoryType #5

Closed ayotade closed 6 days ago

ayotade commented 4 months ago

Hi,

Kindly update the regulatoryType with these new properties; Manufacturer, Documents, ProductSafety and .ResponsiblePersons.

Thank you very much.

hanba commented 2 months ago

Have you solved this problem? How did you do it? Can you help me answer it?

ayotade commented 2 months ago

No I have not. I am still waiting for responses. I hope I will get response before 13th December so that I have enough time to implement it in my application.

hanba commented 2 months ago

I learned from other sources that eBay's SDK project team is no longer maintaining the project. I don't know if this news is accurate. I hope an official person can reply. There is a knowledge base that says update SDK, I followed the operation failed, hope this link to help you. https://developer.ebay.com/support/kb-article?KBid=1034

If you want to leave your email, we can communicate.

ayotade commented 2 months ago

Thank you very much for your response. It has helped me to resolve it

https://stackoverflow.com/questions/1302525/how-to-use-a-wsdl

The link above shows how to reference wsdl in a .net project

http://developer.ebay.com/webservices/1371/eBaySvc.wsdl

use the above uri and you will be able to access all the types

Then follow steps in this link : https://stackoverflow.com/questions/48023631/querying-ebay-api-with-wcf

Done! you can use the class below and add more calls as needed. Note that the version in the class depends on the Ebay WSDL version that you installed

using EbayTradingWSDLReference; using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel; using System.Text; using System.Threading.Tasks;

namespace EbayApp { public class EbayClient: IEbayTradingServices { // Don't do this, use a proper method of storing app secrets. // I have it this way for simplicity in this example. const string AppId = ""; const string DevId = ""; const string CertId = ""; const string AuthToken = "";

    // This is the version of the API that your WSDL file is from. As of this answer
    // the latest version is 1039. All calls need this passed as a parameter.
    //const string Version = "1039";
    const string Version = "1375";

    // This is the base URL for the API.
    // Sandbox: https://api.sandbox.ebay.com/wsapi
    // Production: https://api.ebay.com/wsapi
    const string BaseApiUrl = "https://api.ebay.com/wsapi";

    // This is the actual client from the service we just imported. It's being injected
    // here via the built-in DI in ASP.NET Core.
    readonly eBayAPIInterfaceClient _ebay;

    // All of the functions in this class need these credentials passed, so declare it in
    // the constructor to make things easier.
    readonly CustomSecurityHeaderType _creds;

    public EbayClient(eBayAPIInterfaceClient ebay)
    {
        _ebay = ebay;

        _creds = new CustomSecurityHeaderType
        {
            Credentials = new UserIdPasswordType
            {
                AppId = AppId,
                DevId = DevId,
                AuthCert = CertId
            },
            eBayAuthToken = AuthToken
        };
    }

    public async Task<AddFixedPriceItemResponse> AddFixedPriceItem(AddFixedPriceItemRequest addItemRequest)
    {
        addItemRequest.RequesterCredentials = _creds;   
        addItemRequest.AddFixedPriceItemRequest1.Version = Version;
        var addr =  new EndpointAddress($"{BaseApiUrl}?callname=AddFixedPriceItem");
        var ch = _ebay.ChannelFactory.CreateChannel(addr);
        var itemResp = await ch.AddFixedPriceItemAsync(addItemRequest);

        return itemResp;

    }

    public async Task<AddItemsResponse> AddItem(AddItemsRequest addItemRequest)
    {
        //AddItemsResponse response = await EbayClient.AddItemsAsync(CustomSecurityHeaderType, addItemRequest);

        //return response;
        addItemRequest.AddItemsRequest1.Version = Version;
        addItemRequest.RequesterCredentials = _creds;
        var addr = new EndpointAddress($"{BaseApiUrl}?callname=AddItems");
        var ch = _ebay.ChannelFactory.CreateChannel(addr);
        var itemResp = await ch.AddItemsAsync(addItemRequest);

        return itemResp;
    }

    public async Task<ReviseFixedPriceItemResponse> ReviseFixedPriceItem(ReviseFixedPriceItemRequest revisedFixedPriceRequestType)
    {

        if (revisedFixedPriceRequestType.ReviseFixedPriceItemRequest1.Item.ShippingDetails == null)
        {
            GetItemResponse itemResponse = await GetItem(revisedFixedPriceRequestType.ReviseFixedPriceItemRequest1.Item.ItemID);
            revisedFixedPriceRequestType.ReviseFixedPriceItemRequest1.Item.ShippingDetails = itemResponse.GetItemResponse1.Item.ShippingDetails;
        }
        revisedFixedPriceRequestType.ReviseFixedPriceItemRequest1.Version = Version;
        revisedFixedPriceRequestType.RequesterCredentials = _creds;
        var addr = new EndpointAddress($"{BaseApiUrl}?callname=ReviseFixedPriceItem");
        var ch = _ebay.ChannelFactory.CreateChannel(addr);
        var itemResp = await ch.ReviseFixedPriceItemAsync(revisedFixedPriceRequestType);

        return itemResp;

    }

    public async Task<GetItemResponse> GetItem(string itemid)
    {

        var addr = new EndpointAddress($"{BaseApiUrl}?callname=GetItem");
        var ch = _ebay.ChannelFactory.CreateChannel(addr);
        GetItemResponse itemResp = new GetItemResponse();
        try
        {
            var item = new GetItemRequest
            {
                GetItemRequest1 = new GetItemRequestType
                {
                    ItemID = itemid,
                    Version = Version,

                },
                RequesterCredentials = _creds
            };
             itemResp = await ch.GetItemAsync(item);

            if (itemResp.GetItemResponse1.Ack == AckCodeType.Success)
            {
                return itemResp;
            }

                //return itemResp;
        }
        catch (Exception e)
        {

           Console.WriteLine(e);
            Console.Read();
        }
        return itemResp;
    }

    public async Task<List<ReviseFixedPriceItemResponse>> ReviseFixedPriceItems(List<ReviseFixedPriceItemRequest> request)
    {
        List<ReviseFixedPriceItemResponse> responselist = new List<ReviseFixedPriceItemResponse>();

        foreach (var item in request)
        {
            //string itemid = item.ReviseFixedPriceItemRequest1.Item.ItemID;

            item.ReviseFixedPriceItemRequest1.Version = Version;
            item.RequesterCredentials = _creds;

            var addr = new EndpointAddress($"{BaseApiUrl}?callname=ReviseFixedPriceItem");
            var ch = _ebay.ChannelFactory.CreateChannel(addr);
            var itemResp = await ch.ReviseFixedPriceItemAsync(item);

            responselist.Add( itemResp);

        }
        return responselist;
    }

    public async Task<CompleteSaleResponse> CompleteSale(CompleteSaleRequest completeSalesRequest)
    {
       completeSalesRequest.RequesterCredentials = _creds;
        completeSalesRequest.CompleteSaleRequest1.Version = Version;
        var addr = new EndpointAddress($"{BaseApiUrl}?callname=CompleteSale");
        var ch = _ebay.ChannelFactory.CreateChannel(addr);
        var itemResp = await ch.CompleteSaleAsync(completeSalesRequest);

        return itemResp;
        //return await EbayClient.CompleteSaleAsync(CustomSecurityHeaderType, completeSalesRequest);
    }

    public async Task<GetOrdersResponse> GetOrders(GetOrdersRequest getOrdersRequest)
    {
        GetOrdersResponse? itemResp = null;
        try
        {   getOrdersRequest.RequesterCredentials = _creds;
            getOrdersRequest.GetOrdersRequest1.Version = Version;
            var addr = new EndpointAddress($"{BaseApiUrl}?callname=GetOrders");
            var ch = _ebay.ChannelFactory.CreateChannel(addr);
            itemResp = await ch.GetOrdersAsync(getOrdersRequest);
            return itemResp;
        }
        catch (Exception e)
        {

            Console.WriteLine(e.Message);
            Console.WriteLine(e.StackTrace);
            Console.ReadLine();
        }

        return itemResp;
    }

}

}

Neshik commented 2 months ago

Hello together, was someone able to successfully update to the current latest wsdl (1375)?

If someone did, I would like to donate the one who he will provide me the latest ebay.Service.dll.

Thank you in advance

ayotade commented 1 month ago

Hi,

It is almost the end of October. If they don't respond, consider refactoring your code and applying the steps in the link below. I am working on this as a backup

https://stackoverflow.com/questions/48023631/querying-ebay-api-with-wcf

Kind regards

Olayinka

On Mon, 30 Sept 2024 at 11:38, Nesh @.***> wrote:

Hello together, was someone able to successfully update to the current latest wsdl (1375)?

— Reply to this email directly, view it on GitHub https://github.com/eBay/trading-api-dotnet-sdk/issues/5#issuecomment-2382766066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKAQMD5H3QJ72CN5X4POTD3ZZES3RAVCNFSM6AAAAABLMYPGFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBSG43DMMBWGY . You are receiving this because you authored the thread.Message ID: @.***>

ayotade commented 1 month ago

have a look at the second answer: Step 1 to Step 4

On Tue, 22 Oct 2024 at 16:29, Olayinka Popoola @.***> wrote:

Hi,

It is almost the end of October. If they don't respond, consider refactoring your code and applying the steps in the link below. I am working on this as a backup

https://stackoverflow.com/questions/48023631/querying-ebay-api-with-wcf

Kind regards

Olayinka

On Mon, 30 Sept 2024 at 11:38, Nesh @.***> wrote:

Hello together, was someone able to successfully update to the current latest wsdl (1375)?

— Reply to this email directly, view it on GitHub https://github.com/eBay/trading-api-dotnet-sdk/issues/5#issuecomment-2382766066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKAQMD5H3QJ72CN5X4POTD3ZZES3RAVCNFSM6AAAAABLMYPGFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBSG43DMMBWGY . You are receiving this because you authored the thread.Message ID: @.***>

hanba commented 1 month ago

I updated WebService.cs according to the method of the document, some warnings occurred after overwriting, most of them are because the interface properties are outdated, so I deleted some properties and methods until the warning is eliminated, finally generated a dll, I tested AddFixedPriceItem this method, can work properly, there are Regulatory properties, other functional interfaces have not been tested, do not know whether it can be used normally, if there is a need for this dll, you can leave the mailbox, I will send it over

Neshik commented 1 month ago

@hanba Hello, i really would like to have your DLL. You asked to leave you a mail, but I didn't manage to find how I can leave you a private message here on GitHub.

Hope this post will help.

marconline commented 1 month ago

I'm working on this. Keeping you posted.

marconline commented 1 month ago

I created a PR https://github.com/eBay/trading-api-dotnet-sdk/pull/8 after I updated the library to v1379 of the API. The source branch is this https://github.com/marconline/trading-api-dotnet-sdk/tree/v4.7.2

marconline commented 1 month ago

If you want to do by yourself, follow these steps:

  1. fork their repo
  2. clone your repo locally
  3. open solution CodeGen.sln inside Tools\CodeGen and compile them
  4. after compilation, open a cmd with admin privileges
  5. enter inside Tools\CodeGen\bin folder
  6. run CodeGen.exe. Don't mind about command line parmeters, since they are ignored due to a bug in the code (opened a PR #9 )
  7. a WebService.cs file will be generated inside the folder Users\lrishi\Documents\TradingAPISDK-.NET\Source\eBay.Service.SDK\Core\Soap
  8. copy that WebService.cs file and overwrite the same one inside Source\eBay.Service.SDK\Core\Soap
  9. after that, removed files related to deprecated calls and remove references to deprecated fields
Neshik commented 3 weeks ago

Hi, It is almost the end of October. If they don't respond, consider refactoring your code and applying the steps in the link below. I am working on this as a backup https://stackoverflow.com/questions/48023631/querying-ebay-api-with-wcf Kind regards Olayinka On Mon, 30 Sept 2024 at 11:38, Nesh @.> wrote: Hello together, was someone able to successfully update to the current latest wsdl (1375)? — Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKAQMD5H3QJ72CN5X4POTD3ZZES3RAVCNFSM6AAAAABLMYPGFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBSG43DMMBWGY . You are receiving this because you authored the thread.Message ID: @.>

Thank you for this link, and to the author for this tip.

For years, I’ve been dealing with the stress of waiting for the SDK to be updated. It gets particularly stressful when there are changes in the eBay API that need to be quickly implemented in my software.

The same applies to the December 13th deadline for the introduction of GPSR.

I followed the steps and now have my own 'SDK' – it’s not that complicated if you only need it for your own purposes. I use only 11 methods and was able to integrate it into my production software in less than 10 hours.

During my implementation, there was even another eBay API update, which I was able to apply within seconds.

Of course, I am grateful to the developers of the SDK, which I have been using for over 10 years.

Thanks to the tip here, I am no longer dependent on it and would recommend everyone to do the same.

marconline commented 3 weeks ago

Hello @Neshik . Did you follow my steps? If yes, I'm happy that I've been useful and that you were able to do that!

If you like, join my WhatsApp group for e-commerce developers: https://chat.whatsapp.com/Gb9Yy7VxVugAUwj4MLptoa

LokeshRishi commented 3 weeks ago

eBay Service SDK v1.0.1 is now available.

ayotade commented 2 weeks ago

Thanks, I'll check it out.

On Wed, 13 Nov 2024, 17:01 Lokesh Rishi, @.***> wrote:

eBay Service SDK v1.0.1 https://www.nuget.org/packages/eBay.Service.SDK/1.0.1 is now available.

— Reply to this email directly, view it on GitHub https://github.com/eBay/trading-api-dotnet-sdk/issues/5#issuecomment-2474215560, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKAQMD6MCA555UDXYXHHBWT2AOAVPAVCNFSM6AAAAABLMYPGFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZUGIYTKNJWGA . You are receiving this because you authored the thread.Message ID: @.***>