CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > migration_to_asp.net.migrating_from_php_to_asp.net Tags:
Item Type: NewsGroup Date Entered: 2/21/2008 10:02:31 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 37 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
lvalmorbida
Asp.Net User
How to translate it to .Net2/21/2008 10:02:31 PM

0/0

I have a PHP page that call a  Web service and returns a complex array type. As lame as it might sound, Im strugling to pass the parameters (which are arrays too) to the service. The code works fine calling the PHP page, but I cannot make it work in ASP.NET (C#).

 Here is the PHP code I have:

<?
/*  TEST SCRIPT  */

require_once("SOAP/client.php");

$wsdl = "http://myhost/webservices/ws_rate/index.msw?wsdl";

$soap_client = new Soap_Client($wsdl);
$soap_client->setOpt('timeout',0);

$operation  = 'Rate';
$namespace  = 'urn:XMLRate';

//PARAMATERS
$paramaters = set_paramaters();

//CALL
$response = $soap_client->call($operation, $paramaters, array('namespace'=>$namespace));

//RESPONSE
if( is_object($response) && array_key_exists('result',get_object_vars($response)) )
{
 if($response->result && $response->result_set){ get_results($response); }
 if($response->error_description){ print("<h2 style='color:red'>ERROR!</h2>".$response->error_description); }
}else{ print "<h2 style='color:red'> soap_fault </h2>";  }

function set_paramaters()
{
 /**
  * Input Parameters:
  *
  * FreightBill - TFreightBill
  *
  * output_attributes
  * - Must be a string in the following format:
   *     TableName=field1,field2,field3|TableName2=field1,field2
   *     ex.: TLORDER=unique_id, USER3, detail_line_id, created_time, created_by, caller,FBDetails,FBUserFields,FBTraceNumbers,FBACharge,FBNotes,pick_up_by, pick_up_by_end, actual_pickup, pick_up_appt_req, pick_up_appt_made, pick_up_terminal, deliver_by, deliver_by_end, actual_delivery, delivery_appt, delivery_appt_req, delivery_appt_made, delivery_terminal, podd_signed_by, podd_signed_on, service_level, web_status, status_short_desc, status_long_desc, current_zone, current_zone_desc, start_zone, start_zone_desc, end_zone, end_zone_desc, pickup_terminal, delivery_terminal, bill_number, bill_number_key, master_order, bill_to_code, bill_to, extra_stops, declared_value, total_charges, currency_code, trailer_number, terminal_zone|TLDTL=PIECES, commodity, mmkm|TRACE=K, v, j|ZONE=terminal_zone|ACHARGE_TLORDER=ACODE_ID
   *     ex.: TLORDER=DETAIL_LINE_ID,CUSTOMER,CREATED_TIME
   *
  */

 $details[] = array(
      'commodity'       => '55',
      'weight'          => '1800',
      'temperaturecontrolled' => 'False',
      'pallets'         => 1,
      'pieces'          => 0,
      'length'          => 0,
      'width'           => 0
      );

 $caller = array('internal_id' => 'CUST0001');

 $fb = array(
 'caller'     => $caller,
    'start_zone ' => '92805',
    'end_zone'    => '25005',
    'service_level' => 'STANDARD',
    'FBDetails' => $details
   );

  $input = array(
      'FreightBill' => $fb,
      'output_attributes' => 'TLORDER=unique_id, USER3, detail_line_id, created_time, created_by, caller,FBDetails'
      );

  $params = array('Input' => $input);

  return $params;
}

function get_results($result)
{
 print("<h2 style='color:green'>Success!</h2>");
 foreach($result->result_set as $key => $value)
 {
  print "<br><b>".$key."</b><br>";
  print_r($value);
 }
}
?>

Any help really appreciated.

Luiz ///edox 

 

nikki_doer_of_t
Asp.Net User
Re: How to translate it to .Net2/22/2008 3:59:20 AM

0/0

ASP.NET is very different from PHP. It has a soap serializer that can do soap requests without so much code, and it has an xml serializer and auto-generation of classes from xsd files.

Do you have a schema available for the web service (xsd file)? 


Please Mark As Answer posts that helped you.

"If we learn from our mistakes, I should be brilliant by now."


Replies here get a faster response than private e-mail.
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
The Project Manager's MBA: How to Translate Project Decisions Into Business Success Authors: Dennis J. Cohen, Robert J. Graham, Pages: 243, Published: 2001
How to Code .net: Tips And Tricks for Coding .net 1.1 And .net 2.0 Applications Effectively Authors: Christian Gross, Pages: 216, Published: 2006
Integrated Formal Methods: Third International Conference, IFM 2002, Turku, Finland, May 15-18, 2002 : Proceedings Authors: Michael Butler, Luigia Petre, Kaisa Sere, Pages: 399, Published: 2002
Lectures on Concurrency and Petri Nets: Advances in Petri Nets Authors: Jörg Desel, Wolfgang Reisig, Grzegorz Rozenberg, Pages: 848, Published: 2004
.NET Framework Essentials Authors: Thuan L. Thai, Hoang Q. Lam, Pages: 363, Published: 2003
Artificial Intelligence Applications and Innovations: IFIP TC12 WG12.5--Second IFIP Conference on Artificial Intelligence Applications and Innovations (AIAI2005), September 7-9, 2005, Beijing, China Authors: Daoliang Li, Baoji Wang, Pages: 881, Published: 2005
Tax Consequences of Foreign Exchange Gains and Losses Authors: Organisation for Economic Co-operation and Development, Pages: 71, Published: 1988
The Sexual Brain Authors: Simon LeVay, Pages: 184, Published: 1994
Coloured Petri Nets: Basic Concepts, Analysis Methods and Practical Use Authors: Kurt Jensen, Pages: 234, Published: 1996
XML for ASP.NET Developers Authors: Dan Wahlin, Pages: 484, Published: 2002

Web:
Translate.Net - Free client to network translations services Translate.Net is free and open source client (aggregator) for free online language services - translators (like Google translator), dictionaries (like ...
translateclient - Translate.Net Translate.Net is free and open source client for many online translating services (translators, monolingual and bilingual dictionaries). ...
Learn Languages with Translate.net The Vocabulary Trainer combines Learning with Entertainment. Our Database contains 41608 Vocabularies and 4 Languages (English, German, Spanish & French).
Languages: Translate.Net is One Desktop Translator to Rule Them All Apr 30, 2008 ... Windows only Ever use an online translation service and wonder if you can get more accurate results elsewhere Translate Net.
CodeTranslator: Free Code Translation From VB.NET <-> C# This service will translate the code for you, just start typing the code or upload a file to translate it. For now it only supports from VB.NET to C# and ...
Nabble - Universal Translation - Dev - Re: [Translate-cvs] SF.net ... Re: [Translate-cvs] SF.net SVN: translate:[8976] src/trunk/translate/storage. On Wo, 2008-11-19 at 16:55 +0000, winterstream@... wrote: >...
Translate.Net - Free software downloads and reviews - CNET ... Dec 8, 2008 ... Come to CNET Download.com for free and safe Translate.Net downloads. Access a variety of online language services.
Download Translate.Net, Translate.Net 0.1.3249.6795 Download Dec 7, 2008 ... Free Translate.Net Download, Translate.Net 0.1.3249.6795 Download.
AspAlliance.com: Alex Lowe's ASP.NET Tips and Tricks NET translation tool that I have come across. It's very easy to use. Simply copy and paste your C# code into the textbox and hit the 'Translate' button. ...
How to translate Claroline? - ClarolineDoc Dec 3, 2008 ... Grab the empty language files from the Claroline website (http://www.claroline. net/dlarea/translate/new_language.zip); Extract the files to ...

Videos:
Mother 3 Fan Translation - First Look http://mother3.fobby.net/ Well, Mother fans. the time you've been waiting two years for has finally arrived. The Mother 3 Fan Translation by ...
[SHOW/HQ] 081210 M.Net SCHOOL OF ROCK; SS501 (Part 2/2) (+A ... editll near the talk section I translated just a handful of things they were saying o.o;; Small things~ -- WHAAA I haven't laughed so hard in so ...
Evgenia Vlasova (Евгения Власова): Esly ryadom net tebya (5 ... Подниму руки к небу I'll raise my hands to the sky да взлечу выше солнца - and fly over the sun, был бы ты со мною рядом, (if) you will be ...
how to translate the fe6 rom with ipswin u might wanna watch in full screen ipswin link:http://zerosoft.zophar.net/ipswin.htm fe6 ips patch link: http://darktwilkitri.thegreatbeyond ...
Real UFO Abduction of a Cow! If someone were to tell you that they have a video of a cow being abducted by a UFO, you might laugh in there face. Well, here is that video ...
The MOTHER 3 Fan Translation http://mother3.fobby.net/ MOTHER 3 Fan Translation COMPLETE -- Do It Yourself Devotion! After nearly two years of development, Mother 3 is ...
M3 Translation - Flint vs. Mischievous Mole Some good strides have been made with hacking various battle-related things, and I thought it'd be nice to let people see it in action rather than ...
Quran_Surah 061.As Saff - The Ranks. - by Quranonline.net Quran_Surah 061.As Saff - The Ranks. - by Quranonline.net Reciter: Sheikh Muhammad Jibreel Translation: Saheeh Translation
The GazettE - Burial Applicant PV (english subtitles) I nearly finished this, then saw that someone had already subbed it xD. Oh well. I finished it anyway. Video © Gazette Subs added by me ...
แอน ธิต - ความรักฉันคือเธอ (Ann Thitima - My Love Is You) Title: ความรักฉันคือเธอ (My Love Is You) Artist: แอน ธิต (Ann Thitima) BPM: 92 I can't find the translation over the net... So, I had to ...




Search This Site:










the equivilant of $_session()

password hashing php vs. vb.net (sha1() vs. hashpasswordforstoringinconfigfile)

php library

from php to asp.net

migrating php to asp.net (vb.net)

coming from a php + java background.

same sql support?

simple php script - conversion to asp.net

php style includes

php time() function

classes

how-to put data from a db into (for example) a session

php

is there an accepted way to create database connections?

future of asp.net

work with visual studio 2005

relative $_server[http_host]

passing values from php to asp.net webform

curl equivalent in php

concatenating an iterator onto a string

php -> asp transfer

array of submitted form values

is asp.net overkill?

want to migrate a .pl contact form to asp.net

using migration assistant with visual studio 2005

is it possible to call aspx page from php web site?

see the variables of a soapclient

article on oracle.com - php and asp.net go head-to-head

associated arrays => hashtable ?

educatded reasons as to migrating to asp.net

  Privacy | Contact Us
All Times Are GMT