- Hi, i have created a simple web service using Php Nusoap. its working correctly but the only thing missing is to add the default xmlns attribute to the response tag.
-
-
Here is the copy of Response :
-
-
<?xml version="1.0" encoding="ISO-8859-1"?>
-
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 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/">
-
<SOAP-ENV:Body>
-
<LoginResponse xmlns="">
-
<LoginResult>
-
<register>
-
<customer>d2ff3b88d34705e01d150c21fa7bde07</customer>
-
</register>
-
</LoginResult>
-
</LoginResponse>
-
</SOAP-ENV:Body>
-
</SOAP-ENV:Envelope>
-
-
-
Here is the code :
-
-
<?php
-
-
require_once ('nusoap.php');
-
// set namespace
-
$ns = 'mynamspace';
-
// set up soap server
-
$server = new soap_server ();
-
$server->configureWSDL ( 'testservice', $ns);
-
$server->wsdl->schemaTargetNamespace = $ns;
-
// define new user data type
-
-
-
// define results
-
-
-
$server->wsdl->addComplexType ( 'customer', 'complexType', 'struct', '', '', array ('customer' => array ('name' => 'customer', 'type' => 'xsd:string' ) ) );
-
$server->wsdl->addComplexType ( 'register', 'complexType', 'struct', '', '', array ('register' => array ('name' => 'register', 'type' => 'tns:customer' ) ) );
-
$server->wsdl->addComplexType ( 'LoginResult', 'complexType', 'struct', '', '', array ('LoginResult' => array ('name' => 'LoginResult', 'type' => 'tns:register' ) ) );
-
-
// register Login function
-
$server->register ( 'Login', // method name
-
array ('username' => 'xsd:string', 'password' => 'xsd:string' ), // input parameters
-
array ('LoginResult' => 'tns:register' ), // output parameters
-
'urn:mynamespace', // namespace
-
'urn:mynamespaceAction', // soapaction
-
'document', // style
-
'literal', // use
-
'Login service for testing' ); // documentation
-
-
-
function Login($username, $password) {
-
if (isset ( $username ) && isset ( $password )) {
-
$hash = md5 ( $username );
-
return array ('LoginResult' => array ('register' => array ('customer' => $hash ) ));
-
-
}
-
}
-
-
// Use the request to (try to) invoke the service
-
$HTTP_RAW_POST_DATA = isset ( $HTTP_RAW_POST_DATA ) ? $HTTP_RAW_POST_DATA : '';
-
$server->service ( $HTTP_RAW_POST_DATA );
-
?>
-
0 1739 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Hyunchan Kim |
last post by:
To indent xml file, I made an instance of Transformer from Templates
using following.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
|
by: Michael TEpperis |
last post by:
hello,
my xml files starts with
+++++++
<?xml version='1.0' encoding='utf-8' ?>
<?integrity app='Visio' version='10.0' buildnum='525' metric='1'...
|
by: David S. Alexander |
last post by:
I am trying to transform XML to XML using an XSLT in C#, but the root node
of my XML is not being matched by the XSLT if it has an xmlns attribute. Am
I handling my namespaces incorrectly?
My C#...
|
by: Ewan Fairweather |
last post by:
Hi,
I'm generating the below XML in c# for an asp.net application
When i've generated this XML the <LaboratoryDetails xmlns=""> element has a
blank xmlns set. How do i either a) remove this...
|
by: Ewan Fairweather |
last post by:
Hi,
I'm generating the below XML in c# for an asp.net application
When i've generated this XML the <LaboratoryDetails xmlns=""> element has a
blank xmlns set. How do i either a) remove this...
|
by: fzhang |
last post by:
I am relatively new to XML and C#. So, forgive me if this question is
too newbie. :-)
While assuming this is an easy programming task, I couldn't find a
single reference anywhere for how to do...
|
by: =?Utf-8?B?R3JlZw==?= |
last post by:
If I have an XmlDocument with a deep hierarchy of nodes, with a
documentElement having an attribute xmlns="http://someurl.com" and all
children inheriting that namespace (but not having the xmlns...
|
by: =?Utf-8?B?UmFqaXY=?= |
last post by:
Hi,
I have a webservices(developed in .net 2.0, using c#) with a webmethod that
returns a XML document. The problem is that the XML returned from the
webservice is having a attribute xmlns="" in...
|
by: C.W.Holeman II |
last post by:
I have an xmlns attribute that produces an XHTML validation error and I
do not understand why it is considered an error.The file displays as
expected on Firefox and IE7.
...
|
by: Amit |
last post by:
Suppose I am having this input xml:<Event><Test></Test><Result
Value="true"><Request xmlns='http://tempuri.org/AtoB.xsd' RequestID=""
MessageID=""...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |