473,390 Members | 1,272 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,390 software developers and data experts.

PEAR::SOAP help me!

Dear all,
is the first time that I use SOAP, and i must say that i'm having
several problems.
this is SOAP message that expects the server
=================XML EXPECTED FROM THE SERVER================
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
SOAP-ENV:mustUnderstand="1">

<wsse:UsernameToken>

<wsse:Username>isp</wsse:Username>

<wsse:Password>password</wsse:Password>

<wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2005-05-16T07:00:03Z</wsu:Created>

</wsse:UsernameToken>

</wsse:Security>

</SOAP-ENV:Header>

<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<q1:getEcho xmlns:q1="http://echo.help.webservices.xxxxx.xxxx.com" />

</soap:Body>

</SOAP-ENV:Envelope>

================================================== ========

============== XML SENT FROM MY PROGRAM ==================

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"

SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<SOAP-ENV:Header>

<Security SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next"
SOAP-ENV:mustUnderstand="1">

<ns4:wsse:UsernameToken>

<Username xsi:type="xsd:string">allaxia-ws</Username>

<Password
xsi:type="xsd:string">6gVTJFjW1MoerWp</Password></ns4:wsse:UsernameToken></Security>

</SOAP-ENV:Header>

<SOAP-ENV:Body>

<getEcho xsi:nil="true"/>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

================================================== =================

After several vicissitudes, i was able to set up the security header and
the mustUnderstand, but now i have always the same error, the server “
does not recognize” the tag ns4.

I have not created the ns4 tag!

====================== ERROR MESSAGE ================
[error_message_prefix] =>

[mode] => 1

[level] => 1024

[code] => Parser

[message] => XML error on line 1 col 1 byte 0 Empty document

[userinfo] => HTTP/1.1 500 Internal Server Error

Date: Tue, 23 May 2006 13:21:45 GMT

Server: Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.8 mod_jk/1.2.10

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode> soapenv:Server.generalException</faultcode><faultstring>WSDoAllReceiver:
cannot convert into document; nested exception is:
org.xml.sax.SAXParseException: Element type &quot;ns4:wsse&quot; must be
followed by either attribute specifications, &quot;&gt;&quot; or
&quot;/&gt;&quot;.</faultstring><detail><ns1:hostname
xmlns:ns1="http://xml.apache.org/axis/">FSSP085</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

==================== MY SCRIPTS ========================================
require_once('SOAP/Client.php');

/* Create a new SOAP client using PEAR::SOAP's SOAP_Client-class: */
$client = new
SOAP_Client('https://xxxxxx.xx.xxxxx.com/services/Echo',false,443);
$client->setOpt('curl', CURLOPT_VERBOSE, 1);
$client->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
$client->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 1);
$client->setOpt('curl',CURLOPT_PROXY, '10.0.4.90:8080');
$client->setOpt('curl',CURLOPT_PROXYUSERPWD, 'xxxx.xxxxx:sdhksdjfs');

//new
SOAP_Header('wsse:UsernameToken',array('username'= >'isp','password'=>'password'));

$soapheader = new SOAP_Header("wsse:Security", "object",
array("wsse:UsernameToken" =>
new
Soap_Value("{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}wsse:UsernameToken",
"object",
array( "Username" => new Soap_Value("wsse:Username", "string", "isp"),
"Password" => new Soap_Value("wsse:Password", "string", "password")))),1);
$client->addHeader($soapheader);
$method = 'getEcho';
$params = array();
$namespace="http://echo.help.webservices.xxxxx.xxxxxx.com";
$response = $client->call($method);
print_r($response);
print("###################".$client->getEcho());
thanks for the Help, and excuse me for my bad english

Info
May 24 '06 #1
0 5579

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Arne Kösling | last post by:
Hi ! I am new to Web Services. Therefore I ve set up a PHP Installation on Windows (PHP 4.3.2 and Apache 1.3.29). I have tested PHP alone and then installed PEAR. Now I am stuck there (Before...
0
by: Jimmy Jim | last post by:
OK, I am so frustrated with PEAR SOAP, I have it working, but it seems when I include a file and in that file is a function with global variables, those globals are not set. Anyone have ANY...
0
by: Arne Kösling | last post by:
Hi, PEAR:SOAP is not working. I've tried so many examples now and the only one that works, is that amazon example, which is too complex for me to understand. I am so reliant on the Web...
0
by: Doug Farrell | last post by:
Hi all, I'm trying to make use of PEAR::SOAP am and having problems. I've tried a number examples I've found on the web, but to no avail. I've set things up so I have to separate servers on my...
0
by: Henrik Brautaset Aronsen | last post by:
I am having problems converting from Pear SOAP to PHP5 SOAP, especially when it comes to complex types. I would be grateful for any help on how this should be translated: ...
3
by: junkmail | last post by:
on a win 2k server apparantly it is saying i dont have it. or it cant find it. im using mySQL 4.1 php 4.3.x apache 3.0.53 im new to php and am doing some tutorials, but when i run the sripts...
0
by: Alexander Waldmann | last post by:
Hi, i have PEAR::SOAP installed correctly (beta, all dependent packages are installed). When i try out the following simple Script <?php print "Include is ... ";...
0
by: Samuel Zallocco | last post by:
Hi all, I've a problem with PHP5 + PEAR::SOAP. I Have the following 2 script that implements a simple web service: The Server Code running on WinXP + PHP5 + Apache 2.x:...
0
by: wagemage.pt | last post by:
I'm having some trouble with PEAR soap and a response from a webservice when the number of results is one or more than one. Versions are PHP 4.4.2-1build1, PEAR-1.4.6, SOAP-0.9.4 running in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.