web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Create vendor problem - simple question

(0) ShareShare
ReportReport
Posted on by 390

Hello, i am totally new this might be a really simple question. What i need is to send to Dynamic GP a list of object (a complex order), no idea how but i want to start with something simple. I want to create a Vendor. For this i got this code (from MSDN - so should be fine):

 

 

           CompanyKey companyKey;
            Context context;
            Vendor vendor;
            VendorKey vendorKey;
            Policy vendorPolicy; 
            DynamicsGP wsDynamicsGP = new DynamicsGP();
            Console.WriteLine("DynamicsGP created"); 
            wsDynamicsGP.UseDefaultCredentials = true;
            NetworkCredential credentials = new NetworkCredential("asd", "asd", "asd");
            wsDynamicsGP.Credentials = credentials;
            context = new Context(); 
            companyKey = new CompanyKey();
            companyKey.Id = (-1); 
            context.OrganizationKey = companyKey; 
            vendorKey = new VendorKey();
            vendorKey.Id = "TstVndr0001"; 
            vendor = new Vendor();
            vendor.Key = vendorKey;
            vendor.Name = "TestVendor0001";
            vendorPolicy = wsDynamicsGP.GetPolicyByOperation("CreateVendor", context); 
            wsDynamicsGP.CreateVendor(vendor, context, vendorPolicy);
   
           
And my config file looks like:
          
                  
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel> 
    <bindings>
      <wsHttpBinding>
        <binding name="GPWebService" closeTimeout="00:10:00" openTimeout="00:10:00"
            receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false"
            transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://SQL01:48620/Dynamics/GPService/GPService"
          binding="wsHttpBinding" bindingConfiguration="GPWebService"
          contract="DynamicsGP" name="GPWebService">
        <identity>
          <userPrincipalName value="GPwebservices@comp.local" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel> 
</configuration>
           
But every time an exception is raised:
         
"System.Net.WebException: The operation has timed out at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)"
               
when GetPolicyByOperation is called. I used windows service instead of the class generated by the service. This might be a problem?
            
Also when wsDynamicsGP is created is taking long time but al least is pass.
I am calling the service stored on another computer so the domain for sure is different, is this relevant somehow?
               
Can somebody help me?
Thanks!

 

*This post is locked for comments

I have the same question (0)
  • sandipdjadhav Profile Picture
    18,319 on at

    Seiko,

    Can you try something like

     wsDynamicsGP .Timeout =100000

    Check in WebService Exception if it shows any error.

    Thanks

    Sandip

  • seiko88 Profile Picture
    390 on at

    The same thing happen. Timeout...

  • mark enegel Profile Picture
    30 on at

    Seiko, your code is fine. Check the ws settings, something might be wrong there...

  • Priya Swain Profile Picture
    600 on at

    Hello Seiko,

    Did you find any solution for your problem.

    Even I am also facing the same problem.

    Please let me know if you have solution.

    Regards,

    Priya.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans