Solved

Posting to a WCF Service via HTTP

Posted on 2011-03-25
2
472 Views
Last Modified: 2012-05-11
Hi Everyone,

I'm having trouble posting data to a WCF Service via HTTP Post and send a redirect response back to the user.

I only get a blank page back from the post. Are there restrictions on HTTP posting from another domain in WCF?

If somebody could point me in the right direction, I'd really appreciate it.

Thanks

Nick
[ServiceContract]
public interface IXXLeadServiceWCF
{
 [WebInvoke(UriTemplate = "invoke")]
 [OperationContract]
 void CreateCallBack(Stream input);
}

[OperationBehavior]
public void CreateCallBack(Stream input)
{
 StreamReader sr = new StreamReader(input); 
 string s = sr.ReadToEnd(); 
 sr.Dispose(); 
 NameValueCollection qs = HttpUtility.ParseQueryString(s); 
 string firstName = qs["firstName"];

WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Redirect;
WebOperationContext.Current.OutgoingResponse.Location = "http://www.test.com";
}

<form method="post" action="http://wcf.xxx.com/LeadService/LeadService.svc"> <input name="firstName" id="firstName" class="txt_input" type="text" value="" /></form>

Open in new window

0
Comment
Question by:nkewney
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 35224553
Can you post the code of the page consuming the web service?
In a wcf web service, you define the host configuration parameters to define your communication, but you do not need to define line 22.
Your page should consume and display your service response, Check:
http://msdn.microsoft.com/en-us/library/bb332338.aspx

Note: If more help required please post host config file/relevant wcf setup code.
0
 
LVL 1

Author Closing Comment

by:nkewney
ID: 35367322
Great - thank you.
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question