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

why does soapserver always returns a null object?

hi,

i am trying to implement a web service using php. it should return a
complex type, but it is always null.

i have the following wsdl:
<?xml version="1.0" encoding="utf-8"?>

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://www.test.co.uk/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://www.test.co.uk/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<wsdl:types>

<s:schema elementFormDefault="qualified"
targetNamespace="http://www.test.co.uk/soap/">

<s:element name="func">

<s:complexType>

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="a"
type="tns:thing" />

</s:sequence>

</s:complexType>

</s:element>

<s:complexType name="thing">

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="a"
type="s:string" />

</s:sequence>

</s:complexType>

<s:element name="funcResponse">

<s:complexType>

<s:sequence>

<s:element minOccurs="0" maxOccurs="1" name="funcResult"
type="tns:thing" />

</s:sequence>

</s:complexType>

</s:element>

</s:schema>

</wsdl:types>

<wsdl:message name="funcSoapIn">

<wsdl:part name="parameters" element="tns:func" />

</wsdl:message>

<wsdl:message name="funcSoapOut">

<wsdl:part name="parameters" element="tns:funcResponse" />

</wsdl:message>

<wsdl:portType name="testSoap">

<wsdl:operation name="func">

<wsdl:input message="tns:funcSoapIn" />

<wsdl:output message="tns:funcSoapOut" />

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="testSoap" type="tns:testSoap">

<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="func">

<soap:operation soapAction="http://www.test.co.uk/soap/func"
style="document" />

<wsdl:input>

<soap:body use="literal" />

</wsdl:input>

<wsdl:output>

<soap:body use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:binding name="testSoap12" type="tns:testSoap">

<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="func">

<soap12:operation soapAction="http://www.test.co.uk/soap/func"
style="document" />

<wsdl:input>

<soap12:body use="literal" />

</wsdl:input>

<wsdl:output>

<soap12:body use="literal" />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="test">

<wsdl:port name="testSoap" binding="tns:testSoap">

<soap:address location="http://localhost/test.php" />

</wsdl:port>

<wsdl:port name="testSoap12" binding="tns:testSoap12">

<soap12:address location="http://localhost/test.php" />

</wsdl:port>

</wsdl:service>

</wsdl:definitions>
i then have the following php script:
<?php

class thing
{
public $a;
}

class test
{
public function func($a)
{
$a->a = "returning";
return $a;
}
}

$wsdl = "test.wsdl";

ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer( $wsdl, array('soap_version' =SOAP_1_2));

$server->setClass("test");
$server->handle();

?>

however, whatever i pass to the web method i get:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.test.co.uk/soap/">
<SOAP-ENV:Body>
<ns1:funcResponse/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

ie. funcResponse is null.

i'm sure i'm missing something simple so any help would be much
appreciated.

many thanks,
mike.

Oct 16 '06 #1
0 1565

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

Similar topics

2
by: Rene van Hoek | last post by:
Hi, I am using Xalan 1.8.0 and Xerces 2.6.0 in C++. I have an XML document which I first transform into an other XML document using an XSL styelsheet. Then I want to parse with XPathEvaluator...
1
by: Sergio Geralnik | last post by:
I am trying to use this method to get a MethodInfo object but the method always returns a null. See my sample code below: this.button1 = new System.Windows.Forms.Button(); this.button1.Click +=...
2
by: RobertHillEDS | last post by:
While using the Soap generated ASP code, I would like to dump the raw contents of the request and response objects using Response.AppendToLog. I have tried using variations of the following code,...
24
by: David Mathog | last post by:
If this: int i,sum; int *array; for(sum=0, i=0; i<len; i++){ sum += array; } is converted to this (never mind why for the moment):
8
by: Brian | last post by:
This is causing me to not be able to create a relation in my dataset. Here's my code: dc1 = ds.Tables .Columns ; dc2 = ds.Tables .Columns ; dr1 = new System.Data.DataRelation...
7
by: John Grandy | last post by:
make a call to XML Web Service WebMethod ... returns object myArray with no error ... myArray contains objects of type StringKeyStringValue runtime error occurs on accessing properties of...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
3
by: axlq | last post by:
I wrote the function below to get the vertical scroll position of an anchor. That is, a URL of the form http://www.example.com/mypage.html#anchorname should scroll to the point on the page that...
0
by: sherlockweb | last post by:
Hi there, Has anyone run into the problem of persistence not working when using classes & SOAP server lately? There was a thread last year with the same issue: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.