Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

494
Visualizações
Why are there extra parameters in Webservice when called from Powershell?

I have been passed-on a very simple C# asp.net web service with it's supposed source-code, that has just one public method called Sync(). Also, I am provided a Powershell script that calls this method of Web Service as shown in following code:

$ws = New-WebServiceProxy -uri <http://webservice.svc?wsdl>
$arg1 = $true
$arg2 = $true
$ws.Sync([ref] $arg1, [ref] $arg2)

When I look at the provided source-code, the Sync() method doesn't have any parameters. However, as you can notice that the Powershell is calling the Sync method with two arguments.

And the powershell runs fine with these two arguments being passed. When I remove the arguments from the call, it fails saying Cannot find an overload for "Sync" and the argument count: "0"

When I reverse-engineer the deployed DLL using dotPeek, it also shows the Sync method without any parameters.

This is quite confusing to me as I expected that the Webservice call from PowerShell to have no parameters so not sure why these additional parameters are passed and service call doesn't run without them.

Is this peculiar to Webservice being called from Powershell (that we need to pass additional params) or I am missing something obvious? Any pointers highly appreciated.

EDIT: Adding the wsdl section

<wsdl:operation name="Sync">
  <soap:operation soapAction="http://tempuri.org/ISyncService/Sync" style="document"/>
  <wsdl:input>
    <soap:body use="literal"/>
  </wsdl:input>
  <wsdl:output>
    <soap:body use="literal"/>
  </wsdl:output>
</wsdl:operation>
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda