how can get error message from josn?

http://212.76.95.85:8844/CreateHWB.aspx?from=RYD&to=DMM&shipid=1223456789&shipssn=0&shipname=mohamad&shipphone=0112222&shipcity=riyadh&shipaddress=&rcvssn=0&rcvname=toto&rcvphone=00966506268525&rcvcity=riyadh&rcvaddress=riyadh-takhsusi-%D9%81%D8%B1%D9%82190%D8%B1%D9%8A%D8%A7%D9%84%20%D9%8A%D8%AF%D9%81%D8%B9%D9%87%D8%A7%20%D8%A7%D9%84%D8%B9%D9%85%D9%8A%D9%84%20-%D8%B1%D9%82%D9%85%20%D8%A7%D9%84%D8%B7%D9%84%D8%A8%20%D8%A7%D9%84%D8%A7%D9%88%D9%84%2029396%20&pkgdesc=%D9%85%D9%81%D8%B1%D8%B4%20%D8%AA%D8%B1%D9%83%D9%8A%20%D9%81%D9%86%D8%AF%D9%82%D9%89%20White%20-Gray%20&codvalue=485&pcs=1&customerno=110004&weight=15&passcode=TestPassword&refno=32885

Open in new window

Hamdan ShafiqPHP Full Stack DeveloperAsked:
Who is Participating?
 
Ryan ChongCommented:
the request returned with a json message:

[["ShipAddress is null"]]

Open in new window


you got to check the documentation what is mean by this json message.
0
 
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
This expert suggested creating a Gigs project.
This will take a good bit of work to figure out.

Someone will have to get into your CreateHWB.aspx code + determine what's wrong, how to raise exceptions, how best to pass them back to whatever consumers/code that uses this facility.

Likely best to open a Gig for fastest resolution.
0
 
Hamdan ShafiqPHP Full Stack DeveloperAuthor Commented:
$url='http://212.76.95.85:8844/CreateHWB.aspx?from=RYD&to=DMM&shipid=1223456789&shipssn=0&shipname=mohamad&shipphone=0112222&shipcity=riyadh&shipaddress=&rcvssn=0&rcvname=toto&rcvphone=00966506268525&rcvcity=riyadh&rcvaddress=riyadh-takhsusi-%D9%81%D8%B1%D9%82190%D8%B1%D9%8A%D8%A7%D9%84%20%D9%8A%D8%AF%D9%81%D8%B9%D9%87%D8%A7%20%D8%A7%D9%84%D8%B9%D9%85%D9%8A%D9%84%20-%D8%B1%D9%82%D9%85%20%D8%A7%D9%84%D8%B7%D9%84%D8%A8%20%D8%A7%D9%84%D8%A7%D9%88%D9%84%2029396%20&pkgdesc=%D9%85%D9%81%D8%B1%D8%B4%20%D8%AA%D8%B1%D9%83%D9%8A%20%D9%81%D9%86%D8%AF%D9%82%D9%89%20White%20-Gray%20&codvalue=485&pcs=1&customerno=110004&weight=15&passcode=TestPassword&refno=32885'
 $ch = curl_init();
  $timeout = 0;
  curl_setopt ($ch, CURLOPT_URL, $url);
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

  curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
  curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  $response= curl_exec($ch);
  if (!$response){
           die(curl_error($ch));
  }
  curl_close($ch);
  return $response;

Open in new window

0
 
Ryan ChongCommented:
if you mean to return the json content only, then you should try:

...
curl_close($ch);
  
  $ar = json_decode($response);
  $rtn = $ar[0][0];
  
  return $rtn;

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.