Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8957671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:02:50+00:00 2026-06-15T15:02:50+00:00

I have a .NET WCF web service running on a server that I access

  • 0

I have a .NET WCF web service running on a server that I access from several different computers. To test my connectivity, I have a PowerShell script that builds a proxy, connects to the web service, sends a message, and disconnects. The code to build the proxy comes from here: http://www.ilovesharepoint.com/2008/12/call-wcf-services-with-powershell.html

I have a batch file that runs multiple iterations of the script (500 times), and I’m seeing different behavior depending on which client computer I run the test script on:

  • COMPUTER A: Successfully runs the script without any failures. It takes about 15 minutes to do all 500 iterations.
  • COMPUTER B: Iterations fail about 3% – 4% of the time. It takes over 1 hour to do all 500 iterations. Failures occur every 3-5 minutes.

When the script fails, the message I’m getting back is:

Exception calling “GetMetadata” with “0” argument(s): “Metadata
contains a reference that cannot be resolved: ‘https://
SERVER:8733/WSEngineService/?WSDL’.” At D:\CLIENT\proxyTest.ps1:32
char:41
+ $metadataSet = $mexClient.GetMetadata <<<< ()
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : DotNetMethodException

The stack trace for the exception is:

at
System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object
target, Object[] arguments, MethodInforma tion methodInformation,
Object[] originalArguments) at
System.Management.Automation.DotNetAdapter.MethodInvokeDotNet(String
methodName, Object target, MethodInformation [] methodInformation,
Object[] arguments) at
System.Management.Automation.Adapter.BaseMethodInvoke(PSMethod method,
Object[] arguments) at
System.Management.Automation.ParserOps.CallMethod(Token token, Object
target, String methodName, Object[] paramAr ray, Boolean callStatic,
Object valueToSet) at
System.Management.Automation.MethodCallNode.InvokeMethod(Object
target, Object[] arguments, Object value) at
System.Management.Automation.MethodCallNode.Execute(Array input, Pipe
outputPipe, ExecutionContext context) at
System.Management.Automation.AssignmentStatementNode.Execute(Array
input, Pipe outputPipe, ExecutionContext conte xt) at
System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode
statement, Array input, Pipe output Pipe, ArrayList& resultList,
ExecutionContext context)

The MEX Client properties are:

PS D:\CLIENT>>> $mexClient

SoapCredentials           : System.ServiceModel.Description.ClientCredentials
HttpCredentials           :
OperationTimeout          : 00:01:00
MaximumResolvedReferences : 2147483647
ResolveMetadataReferences : True

This is the code where the exception is occurring:

# get metadata of a service
function global:Get-WsdlImporter($wsdlUrl=$(throw "parameter -wsdlUrl is missing"), $httpGet)
{
        if($httpGet -eq $true)
        {
                $local:mode = [System.ServiceModel.Description.MetadataExchangeClientMode]::HttpGet
        }
        else
        {
                $local:mode = [System.ServiceModel.Description.MetadataExchangeClientMode]::MetadataExchange
        }

        $mexClient = New-Object System.ServiceModel.Description.MetadataExchangeClient((New-Object System.Uri($wsdlUrl)),$mode)
        $mexClient.MaximumResolvedReferences = [System.Int32]::MaxValue
        $metadataSet = $mexClient.GetMetadata()   # <-- Fails sometimes on COMPUTER B but never on COMPUTER A.
        $wsdlImporter = New-Object System.ServiceModel.Description.WsdlImporter($metadataSet)

        return $wsdlImporter   
}

My web service is configured like this:

    <behavior name="WsTuBehaviorConfig">
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" httpsGetBinding="" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceThrottling maxConcurrentCalls="40" maxConcurrentSessions="40" maxConcurrentInstances="40" />
      <serviceCredentials>
        <clientCertificate>
          <authentication certificateValidationMode="PeerTrust" />
        </clientCertificate>
        <userNameAuthentication userNamePasswordValidationMode="Custom" membershipProviderName="Ldap" customUserNamePasswordValidatorType="MyProduct.Framework.Security.AuthenticationProvider.UserNamePasswordLdapUserId,MyProduct.Framework.Security.AuthenticationProvider" />
      </serviceCredentials>
      <serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="LdapOperationProvider" />
      <useRequestHeadersForMetadataAddress />
    </behavior>

  <ws2007HttpBinding>
    <binding name="ws2007HttpTuBindingConfig" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="3200" maxStringContentLength="8192" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="Transport">
        <transport clientCredentialType="Basic" proxyCredentialType="None" />
        <message clientCredentialType="None" negotiateServiceCredential="false" establishSecurityContext="false" />
      </security>
    </binding>
  </ws2007HttpBinding>

  <service behaviorConfiguration="WsTuBehaviorConfig" name="MyProduct.BusinessLibrary.Services.WSEngineService">
    <endpoint name="WsEngineWs2007HttpEp" address="ws2007HttpEP" binding="ws2007HttpBinding" bindingConfiguration="ws2007HttpTuBindingConfig" behaviorConfiguration="accessDeniedFaultBehaviorConfig" contract="MyProduct.BusinessLibrary.Services.IWSEngineService" />
    <endpoint name="mexWSEngineEP" address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="https://SERVER:8733/WSEngineService/" />
      </baseAddresses>
    </host>
  </service>

I’m telling the proxy test script to ignore any SSL warnings:

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

I’m at a loss as to why the script is occasionally failing on COMPUTER B, but never fails on COMPUTER A. Unfortunately, COMPUTER B is a load driver for running performance tests against the web service, and the failures are impeding my ability to conduct a test. I can’t use COMPUTER A for the test, for reasons I don’t want to get into here. The only difference I can see between the two computers is COMPUTER A is a Windows 7 Professional workstation and COMPUTER B is a Windows 2008 R2 server. Both have the same versions of .NET framework and PowerShell installed.

Does anyone have any ideas on why COMPUTER B fails trying to get the metadata for my web service?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:02:50+00:00Added an answer on June 15, 2026 at 3:02 pm

    I think I found the cause and a cure.

    COMPUTER B has 6 network adapters, one connected to our corporate network, one disabled, and the other 4 enabled, each with its own IP address, and connected to an “Unknown Network”. I disabled all but the 1 adapter connected to our network, and COMPUTER B is now behaving like COMPUTER A.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET web service (using asmx...have not upgraded to WCF yet) that
I have a WCF service that I need to call in a ASP.NET web
We have a .NET 3.5 Web Service ( not WCF) running under IIS. It
Background: I have a .NET 4.0 web service running on Windows Server 2008 written
I have a asp.net 2.0 web site with WCF service hosted inside it running
I have an asp.net web application that makes calls to several WCF services. The
I have developed the WCF web service in vb.net in visual studio 2010 express
We have a WCF (.NET 3.5 SP1) service running in IIS7, which is marked
In some of the solutions we have ASP.NET/WCF web project and a test project.
I have a WCF Web Service up and running in a production environment, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.