Link to home
Start Free TrialLog in
Avatar of sandydv85
sandydv85

asked on

calling web service methods by proxy

Hai experts .Am facing a problem here..

Am having websevice with proxy class..My client doesnt give me the webservice WSDL...

I need to call the webservice methods in my Biztalk orchestration...


So my requirement here is to call the methods inside the proxy class without having 'WSDL URL".

How can I?Please explain me in detail..am  newbie..Needed urgently..Please provide me c# code also...


Avatar of Vel Eous
Vel Eous

Assuming you're using Visual Studio 2008/2010, you can use the svcutil.exe program to automatically generate your proxy class.  To do so requires that you have your service running with an exposed endpoint.

To build your proxy class open the Visual Studio command prompt (Start > All Programs > Microsoft Visual Studio 2008/2010 > Visual Studio Tools > Visual Studio Command Prompt) and navigate to your client application solution directory (i.e. C:\visual studio\my projects\my service client).  From the client directoy run the svcutil.exe file (assuring that your service is running), using the following as an example:

scvutil /language:cs /out:generatedProxy.cs /config:app.config http://service/adderss

Assuming the service was running and the svcutil.exe progam could locate it, two files will be automatically generated 1) proxy class named generatedProxy.cs 2) an application configuration file named app.config.  Both of these files need to be added to your solution (Right click soultion name > Add > Existing Item > add both files).

To connect to your service you would use the following example:

MyServiceClient client = new MyServiceClient(); // You should really pass the binding contract here as a parameter although it is not essential

You should then be able to connect to your exposed methods by using the client property:

client.getCurrentDay(); // Or what ever method you might have exposed.


I hope that is what you're looking for, wasn't to sure from your question.  Any issues just get back to us.  <:
Avatar of sandydv85

ASKER

hai Tchuki.I need to send the request as the web service,not like calling the instance of the class.
Using proxy how can i generate request to the service methods?
ASKER CERTIFIED SOLUTION
Avatar of Vel Eous
Vel Eous

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok