0

I've created a web service which receives a xml file like this:

- <ns0:Root xmlns:ns0="http://SimpleBizTalkOrchestration.ReceiveSchema"> <FirstName>Ron</FirstName> <LastName>Swan</LastName> </ns0:Root> 

and passes it to an BizTalk Orchestration.

This is the webservice i need to call.

 http://localhost/BizTalkWcfService/SimpleService.svc 

My question is how do you call a WCF web service and pass data to it?

I've seen many tutorials which request data from the web service but cant find any that pass information to the service.

Thanks in advance for any advice.

3 Answers 3

2

I've seen many tutorials which request data from the web service but cant find any that pass information to the service.

That is because, regardless of whether you're requesting data or posting data, when consuming a service in WCF you write the exact same code.

The only thing which influences the outcome when you call the service is the service endpoint definition. For example, a service defined as

[ServiceContract] SomeData GetData(); 

will return data when you call it. A service defined as

[ServiceContract] void PushData(SomeData data); 

will accept the data you send when you call it. Regardless of which, the method of consuming the service is the same. You create a client, either via a proxy constructed from service metadata, or using WCF channels, create a request, and call the service.

Sign up to request clarification or add additional context in comments.

Comments

1

WCF SOAP is used to communicate with other services or programs. So actually you need to write a dummy program or web site. By developing of this test application (I'll call it "testApp") you can "consume a wcf service". After that every call to this service would be as easy as a call to a function in external library. I assume you should better create a new windowsForms or WebForms or whatever project in the same solution, after that consume the service and so you will be able to send and get information to/from this WCF service in your windowsForms or WebForms app (the testApp). An example: http://www.csharptutorial.in/34/csharp-net-how-to-consume-a-wcf-web-service-in-visual-studio-2010

Comments

0

Check out SoupUI for testing your web service.

Connect using the following address: http://localhost/BizTalkWcfService/SimpleService.svc?wsdl

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.