Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET
when i call method verify() on client server return "The request failed with an empty response."
but i dont know resolve this problem
web service url:
also any 9080 port set in project replace with 9086
C#: ms = new; vr = new { merchantId = "F110", referenceNumber = "1" };
long result = ms.verify(vr);
please help me!
Posted 1-Feb-13 4:44am
Edited 1-Feb-13 5:38am
ryanb31 at 1-Feb-13 10:55am
Did you ask whoever created the service?
naa3er at 1-Feb-13 15:05pm
yes, from bank for settle epayment
ryanb31 at 1-Feb-13 15:26pm
And, what did they say?
naa3er at 1-Feb-13 15:39pm
there is no sample code for
only php and java
ryanb31 at 1-Feb-13 15:41pm
Even if you don't know php, I imagine you already looked at sample php and saw what properties they were setting? You're missing something and the bank is the best ones to tell you what.
ryanb31 at 1-Feb-13 15:41pm
or, possibly post the same php, if it is short, and your ASp.Net code.
naa3er at 1-Feb-13 16:07pm
php Code:
$client = new nusoap_client($wsdl,true);
$err = $client->getError();
if ($err) {
// echo '

Constructor error

<pre>' . $err . '</pre>';
// echo '


<pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
// exit();

$msg= "مشکل در ارتباط با بانک!";

$params = array(
"verifyRequest" =>array(
'merchantId' => 'FA00',
'referenceNumber' => $referenceId)

$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = true;
$result = $client->call("verify",$params);
} Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
string rc = Request.Form["resultCode"];
string pi = Request.Form["paymentId"];
string ri = Request.Form["referenceId"];
if (rc == "100")
{ ms = new; vr = new { merchantId = "F110", referenceNumber = ri };
Label1.Text = ms.verify(vr).ToString();
catch (Exception ex)
Label1.Text = ex.Message;
ryanb31 at 1-Feb-13 16:14pm
I see setUseCurl(0) and setEndpoint in the php but don't see that in ASP.Net. I don't know what they mean but it looks like if the bank can't help you, you'll have to search and find what those mean in php and try to duplicate.
naa3er at 1-Feb-13 16:51pm
can you help me?
ryanb31 at 1-Feb-13 17:15pm
I haven't done php before. Sorry, I won't be much help at this point. Did the bank refuse to help you?
naa3er at 1-Feb-13 17:17pm
no - thanks a lot

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I believe you created WebService proxy, I recommend you add Service Ref instead webservice.
Add Service Reference to and name it as : PgMerchantService.
Now we can code it easily:
var binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = Int32.MaxValue;
binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue;
binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
binding.ReaderQuotas.MaxDepth = Int32.MaxValue;
binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue;
binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;
binding.ReceiveTimeout = new TimeSpan(24, 0, 0);
EndpointAddress ep = new EndpointAddress("");
PgMerchantService.MerchantClient ms = new PgMerchantService.MerchantClient(binding, ep);
PgMerchantService.verifyRequest vr = new PgMerchantService.verifyRequest();
vr.merchantId = "F110";
vr.referenceNumber = "1";
long res = ms.verify(vr);
I get -80 as response; Is it valid ?
naa3er at 6-Feb-13 10:01am
yes, it is valid, it is an error code
i really appreciate your concern and help
Kuthuparakkal at 7-Feb-13 3:01am
you're most welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 476
1 Sergey Alexandrovich Kryukov 200
2 CHill60 195
3 TheRealSteveJudge 120
4 F-ES Sitecore 120
0 Sergey Alexandrovich Kryukov 9,061
1 OriginalGriff 7,920
2 Peter Leow 4,774
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,176

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100