Search the Community
Showing results for tags 'soapclient'.
-
Hi, i'm writing a webservice for my application. i can't print and save result of webservice. my php code: <?php .... $client = new SoapClient("http://addresst/code.asmx?wsdl"); $params = array( 'Username'=>$username, 'PassWord'=>$password, 'numberOfMessages'=>$numberOfMessages, 'destNumber'=>$destNumber, 'ErrNum'=>$ErrNum, ); $result = $client->GetAllMessages( $params ); if (is_soap_fault($result)) { echo '<h2>Fault:</h2><pre>'; print_r($result); echo '</pre>'; } else { print_r($result); //testing output echo "<hr/>"; $res = $result->GetAllMessagesResult;//testing output print_r($res); //end get messages } ?> xml schema: <s:element name="GetAllMessages"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="Username" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="PassWord" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="numberOfMessages" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="destNumber" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ErrNum" type="s:int"/></s:sequence></s:complexType></s:element><s:element name="GetAllMessagesResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetAllMessagesResult" type="tns:ArrayOfArrayOfString"/><s:element minOccurs="1" maxOccurs="1" name="ErrNum" type="s:int"/></s:sequence></s:complexType></s:element><s:complexType name="ArrayOfArrayOfString"><s:sequence><s:element minOccurs="0" maxOccurs="unbounded" name="ArrayOfString" nillable="true" type="tns:ArrayOfString"/></s:sequence></s:complexType> what's wrong? please post your code based on XML schema i posted here! Regards Mansour
-
I did some searching on this issue and all the solutions that seemed to be similar did not work for my problem. Anyways, I need to make a SOAP call with a sequence in it, yet soapClient doesn't seem to be converting my object into the correct soap call (it is leaving out the sequence). Below is the part of the wsdl that I cant seem to get, along with the object that I am sending, and lastly the request that soapClient is translating my object into. Any help would be much appreciated. wsdl: <xs:element minOccurs="0" name="option.list"> <xs:complexType> <xs:complexContent> <xs:extension base="cmn:ArrayType"> <xs:sequence> <xs:element maxOccurs="unbounded" minOccurs="0" name="option.list"> <xs:complexType> <xs:complexContent> <xs:extension base="cmn:StructureType"> <xs:sequence> <xs:element minOccurs="0" name="SubItemId" nillable="true" type="cmn:DecimalType"/> <xs:element minOccurs="0" name="SubOptions" nillable="true" type="cmn:StringType"/> <xs:element minOccurs="0" name="SubItemName" nillable="true" type="cmn:StringType"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> my object: [option.list] => Array ( [0] => Array ( [option.list] => Array ( [SubItemId] => 0 [SubOptions] => <?xml version="1.0" encoding="UTF-8" standalone="yes"?><form><select id="DBMS" label="DBMS type:" style="combo">MS SQL<option label="" /><option id="0" label="DB2">DB2</option><option id="1" label="IMS">IMS</option><option id="2" label="MS SQL">MS SQL</option><option id="3" label="Oracle">Oracle</option><option id="4" label="UDB">UDB</option></select><select id="Type" label="lation Type:" style="combo">Add New Instance<option label="" /><option id="0" label="Add New Environment">Add New Environment</option><option id="1" label="Add New Instance">Add New Instance</option><option id="2" label="Add New Database">Add New Database</option><option id="3" label="Modify Environment">Modify Environment</option><option id="4" label="Modify Instance">Modify Instance</option><option id="5" label="Modify Database">Modify Database</option><option id="6" label="Retire Environment">Retire Environment</option><option id="7" label="Retire Instance">Retire Instance</option><option id="8" label="Retire Database">Retire Database</option></select><select id="Complexity" label="xity:" style="combo">Complex [+$2500.00]<option label="" /><option id="0" label="Simple [+$500.00]">Simple [+$500.00]</option><option id="1" label="Medium [+$1000.00]">Medium [+$1000.00]</option><option id="2" label="Complex [+$2500.00]">Complex [+$2500.00]</option></select><select id="RecoveryTier" label="rability Tier:" style="combo">Tier 2<option label="" /><option id="0" label="Tier 1">Tier 1</option><option id="1" label="Tier 2">Tier 2</option><option id="2" label="Tier 3">Tier 3</option></select><select id="Backup" label=" Backup Required?" style="combo">Yes<option label="" /><option id="0" label="Yes">Yes</option><option id="1" label="No">No</option></select><select id="Replication" label=" tables require replication?" style="combo">UDB Dprop<option label="" /><option id="0" label="UDB Dprop">UDB Dprop</option><option id="1" label="Goldengate">Goldengate</option><option id="2" label="ASM">ASM</option><option id="3" label="No">No</option></select></form> [SubItemName] => DB Modification ) ) ) generated request: <ns1:option.list><ns1:option.list/></ns1:option.list>
- 3 replies
-
- soap
- soapclient
-
(and 2 more)
Tagged with:
-
I am new here, and not sure if this is the right place to put this, anyways I had a question about wsdl2php and php Soap Client. I need to send SOAP requests from a PHP applications and I am trying to use wsdl2php to generate the needed classes. (Did this a few times in the past with no issues.) Anyways, this time I am running into an issue where the WSDL has '.' in the element names and there are also nested element names. below is a section of the wsdl that shows this. -<xs:element name="option.list" minOccurs="0">-<xs:complexType>-<xs:complexContent>-<xs:extension base="cmn:ArrayType">-<xs:sequence>-<xs:element name="option.list" minOccurs="0" maxOccurs="unbounded">-<xs:complexType>-<xs:complexContent>-<xs:extension base="cmn:StructureType">-<xs:sequence><xs:element name="FromBundle" type="cmn:DecimalType" nillable="true" minOccurs="0"/><xs:element name="SubItemId" type="cmn:DecimalType" nillable="true" minOccurs="0"/><xs:element name="SubItemName" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubItemType" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubOptions" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubOptionValidations" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubOptionCosts" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubItemOptionInBundle" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubItemQuantityInBundle" type="cmn:DecimalType" nillable="true" minOccurs="0"/><xs:element name="SubItemOptionIdInBundle" type="cmn:StringType" nillable="true" minOccurs="0"/></xs:sequence></xs:extension></xs:complexContent></xs:complexType></xs:element></xs:sequence></xs:extension></xs:complexContent></xs:complexType></xs:element> So, wsdl2php is creating classes with a '.' in them and also declaring classes twice because of the nested element names. If anyone has any ideas on how I can get these soap requests working, or have seen this before, I would be very apprciative. Thanks, Mike
-
I have to following soap resquest .... ( i have changed the credentials because of the security reasons ) <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bau="http://www.babalumra.com/BAU"> <soapenv:Header/> <soapenv:Body> <bau:Authenticate> <!--Optional:--> <bau:username>zawora</bau:username> <!--Optional:--> <bau:password>a12345#</bau:password> <!--Optional:--> <bau:version>1.1.0.0</bau:version> <bau:uoCode>10</bau:uoCode> </bau:Authenticate> </soapenv:Body> </soapenv:Envelope> I am uising the Authenticate Method of the service. the response is as follows . <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header> <OfflineHeader xmlns="http://www.babalumra.com/BAU"> <UO>10</UO> <Ticket>C7F02767212D85CE76385F0D4BB7A840371DD08C491F9D56FED7E4FB1ADFA8016E1750B341DB7B96CCB41D496117790C832CD2BC4D40A</Ticket> <UserIP>188.55.105.132</UserIP> <UserVer>1.1.0.0</UserVer> <UserId>100</UserId> </OfflineHeader> </soap:Header> <soap:Body> <AuthenticateResponse xmlns="http://www.babalumra.com/BAU"> <AuthenticateResult><Result Value="True"/></AuthenticateResult> </AuthenticateResponse> </soap:Body> </soap:Envelope> now the problem is that that in order to use other methods of the services i have to provide returned information from <soapenv:Header> in every other method's <soapenv:Header> here is another request which requires the returened information ( authentication details ) in <soapenv:Header> . <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bau="http://www.babalumra.com/BAU" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <soapenv:Header> <bau:OfflineHeader> <bau:UO>?</bau:UO> <!--Optional:--> <bau:Ticket>?</bau:Ticket> <!--Optional:--> <bau:UserIP>?</bau:UserIP> <!--Optional:--> <bau:UserVer>?</bau:UserVer> <bau:UserId>?</bau:UserId> </bau:OfflineHeader> </soapenv:Header> <soapenv:Body> <bau:GetArrivalDepartueData> <bau:MofaNo>?</bau:MofaNo> <bau:lang>?</bau:lang> <!--Optional:--> <bau:ds> <xs:schema> <!--Ignoring type [{http://www.w3.org/2001/XMLSchema}schema]--> </xs:schema> <!--You may enter ANY elements at this point--> </bau:ds> </bau:GetArrivalDepartueData> </soapenv:Body> </soapenv:Envelope> ----------------------------------------------------- my question is that is there any way that i can embed returend authuntecation information in my request headers (<soapenv:Header>)
- 1 reply
-
- soap
- soapclient
-
(and 1 more)
Tagged with:
-
Issue: Retrieving data from remote HTTP locations. "failed to open stream: HTTP request failed!" Doesn't Work: fopen(), file_get_contents(), SoapClient('[url=]http://remote_wsdl[/url]') Works: curl, wget via CLI & exec() Tried: Set all ini's to allow_url_fopen = 'On' root@OW-WS01:~$ php -v PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar 4 2013 14:05:25) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH root@OW-WS01:~# php -i --php-ini /etc/php5/apache2/php.ini | grep 'fopen' allow_url_fopen => On => On root@OW-WS01:~# grep 'fopen' -R /etc/php5/ /etc/php5/cli/php.ini:; http://php.net/allow-url-fopen /etc/php5/cli/php.ini:allow_url_fopen = On /etc/php5/apache2/php.ini:; http://php.net/allow-url-fopen /etc/php5/apache2/php.ini:allow_url_fopen = On Code Debug: ini_set('default_socket_timeout', 10); ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); echo 'allow_url_fopen:' . (ini_get('allow_url_fopen') ? 'TRUE' : 'FALSE') . '<br/>'; echo 'default_socket_timeout: ' . ini_get('default_socket_timeout') . '<br/>'; $Remote_XML = "valid_path.xml"; $todays_XML = __DIR__ .'/imports/' . date( 'Ymd', time() ) . '.xml'; echo '<hr/><br/> Testing fopen()<br/>'; $from = fopen( $Remote_XML, 'r' ); $to = fopen( $todays_XML, 'w+' ); stream_copy_to_stream( $from, $to ); echo '<hr/><br/> Testing file_get_contents()<br/>'; $fgc = file_get_contents($Remote_XML); file_put_contents($todays_XML, $fgc ); echo '<hr/><br/> Testing SoapClient()<br/>'; try{ $soap = new SoapClient( '/?wsdl', array( 'trace' => TRUE ) ); $soap->login( 'user', 'pass' ); echo 'soap passed'; } catch( SoapFault $e ) { var_dump($e); } phpinfo(INFO_CONFIGURATION); Results in image format: http://i.imm.io/10Hle.png So, how do I overcome this? Have sniffed packets and these requests aren't even getting generated. This code works just dandy on local and on another server, so there's got to be something I haven't figured out yet. Any idea what could be causing this or what to try next? Thanks
- 1 reply
-
- soapclient
- fopen
-
(and 1 more)
Tagged with:
-
I am working with a soap client. What I need to do is create the xml <soapenv:Body> <req:FareSearchRQ> <req:Date req:Qualifier="DEPARTURE">2013-12-07</req:Date> </req:FareSearchRQ> </soapenv:Body> but I am having trouble. I can either get <req:Date>2013-12-07</req:Date> or <req:Date req:Qualifier="DEPARTURE"/> In my php code to get this I create an array with like this $params = array( 'FareSearchRQ' => array( "Date" => array("Qualifier" => "DEPARTURE") ) ); //This creates the first $params = array( 'FareSearchRQ' => array( "Date" => "2013-12-07" ) ); //This creates the second How would I create an array to create the xml shown above?
-
Hello. My mission is to develop a client to a third party's webservice, which server machine and source codes I can't access or handle. All I have is the API specifications and the addresses. The program works fine on DevelopEnvironment without authentication, but at ProductionEnvironment it requires basic http authentication plus certificate, and then I can't even receive any answer. They said me that I could use a self-signed certificate, so I've created one in my Server ( CentOS Apache2+PHP5.3.3 ). The company sent me a functional DotNetServiceClient piece of code, which includes the app.config which follows bellow. I need some example of how to send this authentication and more the certificate in PHP SoapClient or CURL. Here is the C# application's app.config, with fake IP and certificate: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.net> <settings> <servicePointManager expect100Continue="false" /> </settings> </system.net> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_ISyasAutoServices"> <security> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://200.200.200.200/Auto/WebServiceAuto/SyasAutoServices.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISyasAutoServices" contract="ServiceReference1.ISyasAutoServices" name="WSHttpBinding_ISyasAutoServices"> <identity> <certificate encodedValue="AwAAAAEAAAAUAAAAmqc2gWanBIqn7sbzoxWEw==" /> </identity> </endpoint> </client> <behaviors> <endpointBehaviors> <behavior> <clientCredentials> <serviceCertificate> <authentication certificateValidationMode="None" revocationMode="NoCheck"/> </serviceCertificate> </clientCredentials> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> </configuration> And here is my current client code: /* PHP WebService Client */ $connectionParameters = array( 'login' => 'login' ,'password' => 'password' ,'trace' => TRUE ,'encoding' => 'UTF-8' ,'exceptions' => TRUE ,'cache_wsdl' => WSDL_CACHE_NONE ,'soap_version' => SOAP_1_2 ,'local_cert' => file_get_contents('/my/certificate/directory/selfsignedcertificate/thatwebservice.pem') ,'passphrase' => 'd3e343der434wds' ); $theClient = new SoapClient($serverWSDLURL, $connectionParameters); $r = $theClient->GetBasicWorkData(); The answer: No answer! Only timeOut. Any example or tip? Thank you very much.
-
- soapclient
- asp.net
-
(and 3 more)
Tagged with: