Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3801102
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:59:47+00:00 2026-05-19T13:59:47+00:00

I have a complicated solution I am attempting to solve. I have a wcf

  • 0

I have a complicated solution I am attempting to solve.

I have a wcf service (.net 4.0) hosted on Server 1. Server 1 is PCI compliant.

Server 2 is a client web site. This website has a credit card form hosted. It also has a jquery plugin which hijacks the form post. Server 2 is not PCI compliant.

The data in the credit card form cannot be posted to Server 2.

So, I am trying to call my wcf service (json in, json out) from my jquery plugin. I can’t use a proxy on Server 2 because that would mean my post data goes to that server.

So, the form data must go from the client machine directly to server 1 while bypassing server2 completely.

I saw several posts about using a crossdomain.xml file on Server 1, however I still get an error:

XMLHttpRequest cannot load
http://server1/MySite.Services/PaymentService.svc/SubmitCreditCardPayment.
Origin http://server2 is not
allowed by
Access-Control-Allow-Origin.

Is there any way to do a cross-domain ajax call to a WFC service with json in and json out?

I am not bound to using jquery ajax to do this. If you have another solution that uses jquery to send the data cross domain, I would love to hear it.

EDIT:

To clarify, here’s what my service looks like.

PaymentResponse SubmitCreditCardPayment(CreditCardRequest request);

The request and response objects are just classes with properties (DataContract/DataMember).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:59:47+00:00Added an answer on May 19, 2026 at 1:59 pm

    Have you tried JSONP?

    This is a simple way to call a service on server1 from the client, by using a script tag which has no limitation on source target. To get that json response interpreted in your js env you need a callback (say foo(data)) and you need to set this callback name on the ajax query as a GET parameter. And the targeted ajax service will enclose his json response by a call to foo; foo({json: things}).

    Edit:
    Responding to your remark;: you’ve tested JSON-P but it is not secured (and use GET):

    You’re right JSON-P is not very good for security. But CORS would reduce the number of browser allowed for your application (only very recent browsers). The error message you have is a CORS error message. If you made your request in js then you just have a problem in your implementation of CORS, older browser would need a JSON-P fallback.

    So even using by jQuery magic ajax functions you will have the problem of either using bad securized json-p or bad supported CORS.

    One other solution is having server2 as a subdomain of server1, but for credit card payments I assume it’s not your case.

    The crossdomain.xml file exists only for Flash application, not js, but you could use it to make the whole ajax process in flash (gasp), reducing the number of people allowed to use your application again, but based on (recent) flash support. OMG I’m talkning about flash as a real solution…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a fairly complicated GUI in windows forms using C# and .Net 2.0.
For a RESTful web service we say that that the server shouldn't store any
I have a pretty complicated Linq query that I can't seem to get into
I have some really complicated legacy code I've been working on that crashes when
I have a somewhat complicated branching structure at work (at least for me). It
I have inherited two complicated COM objects. One was derived from the other and
OK, I have a somewhat complicated system in C++. In a nutshell, I need
I have a stored procedure currently executing a complicated fetch that is frequently timing
We have various spreadsheets that employ deliciously complicated macros and third party extensions to
I have a set of core, complicated JavaScript data structures/classes that I'd like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.