473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

consuming a .net web service using php

Hi,
I am trying to access a .net web service using php.A member function in the web service has an object as a parameter.
I was not able to access that member function.
Here is the web service coding..
Expand|Select|Wrap|Line Numbers
  1. public MemberView ChangeEmailAddress(InfiSession infiSes, string oldEmailAddress, string newEmailAddress)
  2.         {
  3.             try
  4.             {
  5.                 MemberManager memberManager = new MemberManager(infiSes);
  6.                 Member mem = memberManager.ChangeEmailAddress(infiSes.MemberId, oldEmailAddress, newEmailAddress);
  7.                 MemberView memView = memberManager.GetMemberViewByEmailAddress(mem.EmailAddress);
  8.                 return (memView);
  9.             }
  10.             catch (Exception ex)
  11.             {
  12.                 InfiDebugLog.AppServer.WriteError(ex);
  13.                 throw FaultUtility.GetFaultException(ex);
  14.             }
  15.         }
  16.  
  17. I am trying to access the above member function ChangeEmailAddress.
  18. For that i have to pass 3 parameters 1.an object 2.old email address 3.new email address.
  19.  
  20. Here is my php coding...
  21.  
  22. <?php
  23. ob_start();
  24. session_start();
  25. require_once('nusoap.php');
  26. $client = new nusoap_client('http://n1app1exc.corp.lan:8082/MemberService.svc?wsdl', 'wsdl'); 
  27.  
  28. $err = $client->getError();
  29.  
  30. //$memberid =($client->"InfiSession.infiSes");
  31. if ($err) {
  32.     echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
  33. }
  34.  
  35. $client->soap_defencoding = 'UTF-8';
  36. $client->setHTTPEncoding('deflate, gzip');
  37.  
  38.  
  39. //ss$infiSes =new InfiSession;
  40.  
  41. $id = $infiSes =$_SESSION['mid'];
  42.  
  43.  
  44. //$memberid= $_SESSION['mid'];
  45. echo $memberid;
  46. $old = $_REQUEST['oldemail']; 
  47. $new = $_REQUEST['Newemail'];     
  48. //echo $id;
  49.  
  50. //echo $infiSes;
  51. print "<pre>";
  52. $infi=$client->call("MemberService->InfiSession()" );
  53.  
  54.  
  55.               //s  MemberService.InfiSession myInfiSession = new MemberService.InfiSession();
  56.  
  57. //var_dump($client);
  58. class InfiSession
  59. {
  60. function  getvalue()
  61.     {
  62. $_MemberId=$id;
  63. $_ContextOrgId="0";
  64. $_OrgMemberId="0";
  65. $_ServerUrl="";
  66.     }
  67. }
  68. $infiSes=new InfiSession;
  69.  
  70.  $result = $client->call('ChangeEmailAddress', array ("InfiSession infiSses" =>$infiSes,"oldEmailAddress"=>$old,"newEmailAddress" =>$new));
  71. var_dump($result);
  72. if($result['faultstring']!="")
  73. { echo $result['faultstring']['!'];
  74. }
  75. print_r($result); 
  76.  
  77. ?>
i was not able access the function..
Please help me..
I have to do this with in a week..
Thanks in advance

Riaz

Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator
Mar 5 '08 #1
1 2209
pbmods
5,821 Expert 4TB
Heya, Riaz.

In my experience, NuSoap does not work properly with .NET webservices because .NET doesn't understand namespaces properly.

Try passing some sample XML that you know should work to your .NET server to see if that part of it is working.
Jun 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ezhil | last post by:
Hi All, we have an asp.net application which is consuming a third party java web service.In order to access the web service a login and password are required and they're passed as SOAP headers....
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
6
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without...
1
by: BestofAbhi | last post by:
I am consuming Java Web Services in .NET. The Java Web Services have been coded using Apache Axis. The binding style in the WSDL is 'Document' and type is 'Literal'. I have added these Java...
0
by: Abhijit Salvi | last post by:
I am consuming Java Web Services in .NET. The Java Web Services have been coded using Apache Axis. The binding style in the WSDL is 'Document' and type is 'Literal'. I have added these Java...
1
by: leslie_tighe | last post by:
Hello, I have webservice created with Axis 1.2.1 and that I am trying to consuming in .NET (VB) using the Microsoft provided tools. While I am able to consume methods on the service that return...
2
by: Glenn Venzke | last post by:
Is there any way to tell what type of application is consuming a web service? I'm writing a web service that returns a string with 2 carriage returns. What I want to do is replace these carriage...
0
by: plmanikandan | last post by:
I need to develop a application to consume a webservice. For consuming web service i tried a example in Consuming a Web Service in C# in http://www.csharphelp.com.But i am uanble to use that...
3
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object...
1
by: =?Utf-8?B?R29yZG9u?= | last post by:
Hi; I can consume a web service from an asp.net application with no problem. The web service connects to a remote server through ODBC and returns a data set to the consuming software. When...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.