Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

New-WebServiceProxy class and Namespace

$
0
0

I have an issue that might well be id10t error.  I am trying to call a wcf soap webservice using powershell. Using soapui or other tools I can see all function and methods, but with powershell only the first set of functions appears.

Here is a subset of the wsdl

<wsdl:message name="IApplicationService_ApplicationDetailsbyAppID_InputMessage"><wsdl:part name="parameters" element="tns:ApplicationDetailsbyAppID"/></wsdl:message>
....<wsdl:message name="IServerService_ServerDetailsbyServerID_OutputMessage"><wsdl:part name="parameters" element="tns:ServerDetailsbyServerIDResponse"/></wsdl:message>
....<wsdl:portType name="IApplicationService"><wsdl:operation name="ApplicationDetailsbyAppID"><wsdl:input wsaw:Action="http://tempuri.org/IApplicationService/ApplicationDetailsbyAppID" message="tns:IApplicationService_ApplicationDetailsbyAppID_InputMessage"/><wsdl:output wsaw:Action="http://tempuri.org/IApplicationService/ApplicationDetailsbyAppIDResponse" message="tns:IApplicationService_ApplicationDetailsbyAppID_OutputMessage"/></wsdl:operation>
...</wsdl:portType><wsdl:portType name="IServerService"><wsdl:operation name="ServerDetailsbyServerID"><wsdl:input wsaw:Action="http://tempuri.org/IServerService/ServerDetailsbyServerID" message="tns:IServerService_ServerDetailsbyServerID_InputMessage"/><wsdl:output wsaw:Action="http://tempuri.org/IServerService/ServerDetailsbyServerIDResponse" message="tns:IServerService_ServerDetailsbyServerID_OutputMessage"/></wsdl:operation>
...</wsdl:portType><wsdl:binding name="BasicHttpBinding_IApplicationService" type="tns:IApplicationService">
-soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="ApplicationDetailsbyAppID">
-soap:operation soapAction="http://tempuri.org/IApplicationService/ApplicationDetailsbyAppID" style="document"/><wsdl:input>
-soap:body use="literal"/></wsdl:input><wsdl:output>
-soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:binding name="BasicHttpBinding_IServerService" type="tns:IServerService">
-soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="ServerDetailsbyServerID">
-soap:operation soapAction="http://tempuri.org/IServerService/ServerDetailsbyServerID" style="document"/><wsdl:input>
-soap:body use="literal"/></wsdl:input><wsdl:output>
-soap:body use="literal"/></wsdl:output></wsdl:operation>

I use this to access the wsdl in powershell

$url="http://[address]/Service1.svc?wsdl"
$y=New<webServiceProxy -Uri $url

$y.ServerDetailsbyServerID(10,1)


And I get this error.  

Method invocation failed because [Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy11caqa_corpadqa_net_Service1_svc.BasicHttpBinding_IApplicationService]
does not contain a method named 'ServerDetailsbyServerID'.
At line:5 char:1
+ $y.ServerDetailsbyServerID(10,1)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound

But if I try $y.applicationservicebyappid I can get the service to return a value.

I am thinking I need to be able to crawl the wsdl and that powershell is not doing so.  Any ideas would be appreciated. I will suggest that I tried both -namespace and -class but putting iserverservice in either did not let me access those functions. Thank you again.  


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>