Click here to Skip to main content
12,622,527 members (32,951 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
hi
when i call method verify() on asp.net client server return"The request failed with an empty response."

but i dont know resolve this problem
web service url: http://pg.sabapardazesh.net:9086/paymentGateway/services/merchant.wsdl
also any 9080 port set in project replace with 9086
C#:
net.sabapardazesh.pg.MerchantService ms = new net.sabapardazesh.pg.MerchantService();
net.sabapardazesh.pg.verifyRequest vr = new net.sabapardazesh.pg.verifyRequest() { merchantId = "F110", referenceNumber = "1" };
long result = ms.verify(vr);
please help me!
Posted 1-Feb-13 4:44am
naa3er939
Updated 1-Feb-13 5:38am
v2
Comments
ryanb31 1-Feb-13 10:55am
   
Did you ask whoever created the service?
naa3er 1-Feb-13 15:05pm
   
yes, from bank for settle epayment
ryanb31 1-Feb-13 15:26pm
   
And, what did they say?
naa3er 1-Feb-13 15:39pm
   
there is no sample code for asp.net
only php and java
ryanb31 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 1-Feb-13 15:41pm
   
or, possibly post the same php, if it is short, and your ASp.Net code.
naa3er 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 '

Debug

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

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

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

);
$client->setUseCurl(0);
$client->setEndpoint($wsdl);
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = true;
$result = $client->call("verify",$params);
..
..
}

Asp.net 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)
{
try
{
string rc = Request.Form["resultCode"];
string pi = Request.Form["paymentId"];
string ri = Request.Form["referenceId"];
if (rc == "100")
{
net.sabapardazesh.pg.MerchantService ms = new net.sabapardazesh.pg.MerchantService();
net.sabapardazesh.pg.verifyRequest vr = new net.sabapardazesh.pg.verifyRequest() { merchantId = "F110", referenceNumber = ri };
Label1.Text = ms.verify(vr).ToString();
}
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
}
ryanb31 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 1-Feb-13 16:51pm
   
can you help me?
please
ryanb31 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 1-Feb-13 17:17pm
   
no - thanks a lot

1 solution

Rate this: bad
 
good
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 http://pg.sabapardazesh.net:9086/paymentGateway/services/merchant.wsdl 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("http://pg.tejaratbank.net/paymentGateway/services/merchant.wsdl");
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 ?

Thanks,

Kuthuparakkal
  Permalink  
Comments
naa3er 6-Feb-13 10:01am
   
yes, it is valid, it is an error code
i really appreciate your concern and help
Kuthuparakkal 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2016
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