Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Service reference for GP web service

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've searched through as many forum posts here as I could find and none of them quite match the issue I am having

My company has an ERP application that we have integrated with GP in order to send invoices from our application over to GP and post them there.

We are using the web service to accomplish this and our application is a windows forms app. So the problem I am having is that we want to change the company in GP we are sending the invoices to, and so I was told by the previous developer that the service reference to the web service would need to be deleted and recreated to reflect the company Id change.

So I changed the company Id in the app.config file for our project, and then removed and recreated the service reference to the GP web service.

I am now receiving the following error when trying to call any of the getByKey methods (like GetCustomerByKey):

Microsoft.Dynamics.Security.NonExistentSecurityObjectException : The security object does not exist. Key = 0

And here is the xml from the call to the web service:

<?xml version="1.0"?> <RequestObjects> <CustomerKey xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-instance"> <Id>12000</Id> </CustomerKey> <Context xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../01"> <OrganizationKey xsi:type="CompanyKey"> <Id>0</Id> </OrganizationKey> <CultureName>en-US</CultureName> <CurrencyType>Transactional</CurrencyType> <TenantName /> </Context> <string>Microsoft.Dynamics.GP.Customer</string> </RequestObjects>

....

It appears as though a 0 is being sent as the company key ID, which is obviously wrong. Does anyone have any insight on some step I might be missing? Or maybe some better instructions on adding the service reference for the GP web service within Visual Studio?

EDIT: I also wanted to point out that I can see the correct company Id being passed into the web service call via the context when calling something like this: this.WSDynamicsGP.GetCustomerByKey(gpCustomerKey, this.Context);

*This post is locked for comments

  • elmo Profile Picture
    elmo 447 on at
    RE: Service reference for GP web service

    @OriginalDoug: How and where I can set this property true?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service reference for GP web service

    192.168.0.31:48620/DynamicsGPWebServices

    here put your server ip address intiall

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service reference for GP web service

    I want to point out that I changed the IdSpecified property to true and the error went away, however now when calling the CreateSalesInvoice method i get a 'value cannot be null' error that tells me just about nothing.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,399 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans