Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Posting to a WCF Service via HTTP

Posted on 2011-03-25
2
Medium Priority
?
480 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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.…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

715 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