RE: [SOAP] Re: Newbie question
| From: | Patrick Hanna | Date: | Tue, 31 Jan 2006 23:26:13 +0000 |
| Subject: | RE: [SOAP] Re: Newbie question | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-2102@lists.php.net to get a copy of this message | ||
I figured out that I had set up the original beanMapping incorrectly and I
fixed it and now it works. But now that you meantion my namespaces problem,
how should I fix it? Do I need to set up schemas for my custom types?
Thanks,
Patrick
-----Original Message-----
From: Peter Guy [mailto:pguy@vrcis.com]
Sent: Tuesday, January 31, 2006 5:55 PM
To: soap@lists.php.net
Subject: [SOAP] Re: Newbie question
The structure of your WSDL looks alright, although the namespaces are not
setup correctly.
That may be because you cut them out for brevity in your post...
I think your problem is with Axis, not PHP.
What's happening is that Axis doesn't know how to turn the "Number" complex
type into a Java object (it's called "deserialization", and it's the bane of
the Web Service author).
You need to help Axis out a little by including a beanMapping element in
your wsdd file. Something along these lines may work:
<service>
...
<beanMapping qname="ns:Number"
languageSpecificType="java:samples.stock.StockQuoteService.Number"/>
...
</service>
Although you may need to use a typeMapping element, depending on your Java
object.
Check out http://www.osmoticweb.com/axis-wsdd/
for more wsdd goodness.
hth,
-Peter
"Patrick Hanna" <phanna@email.unc.edu> wrote in message
news:C0052195.22EF%phanna@email.unc.edu...
> I cannot for the life of me get this to work. I have a service with this
> wsdl:
>
> <wsdl:definitions
>
> targetNamespace="http://192.168.0.2:8080/axis/services/quotes">
> <!--
> WSDL created by Apache Axis version: 1.3
> Built on Oct 05, 2005 (05:23:37 EDT)
> -->
> <wsdl:types>
> <schema
> targetNamespace="http://stock.samples/">
> <import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> <complexType name="Number">
> <sequence>
> <element name="data" type="xsd:float"/>
> </sequence>
> </complexType>
> </schema>
> </wsdl:types>
> <wsdl:message name="testResponse">
> <wsdl:part name="testReturn" type="tns1:Number"/>
> </wsdl:message>
> <wsdl:message name="testRequest">
> <wsdl:part name="in0" type="tns1:Number"/>
> </wsdl:message>
> <wsdl:portType name="StockQuoteService">
> <wsdl:operation name="test" parameterOrder="in0">
> <wsdl:input message="impl:testRequest"
> name="testRequest"/>
> <wsdl:output message="impl:testResponse"
> name="testResponse"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="quotesSoapBinding"
> type="impl:StockQuoteService">
> <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="test">
> <wsdlsoap:operation soapAction=""/>
> <wsdl:input name="testRequest">
> <wsdlsoap:body
>
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> namespace="http://stock.samples"
> use="encoded"/>
> </wsdl:input>
> <wsdl:output name="testResponse">
> <wsdlsoap:body
>
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
> namespace="http://192.168.0.2:8080/axis/services/quotes"
> use="encoded"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="StockQuoteServiceService">
> <wsdl:port binding="impl:quotesSoapBinding" name="quotes">
> <wsdlsoap:address
>
> location="http://192.168.0.2:8080/axis/services/quotes"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
> Basically I have a service with a test() method that takes a complexType
> Number and returns another complexType Number. I've been able to return
> things from the test method and bind them to a Number object or just use
> ->{"data"} to access the result. I cannot pass objects correctly though.
>
> All my attempts at passing objects result in "org.xml.sax.SAXException: No
> object was found for class type class samples.stock.StockQuoteService."
I'm
> not sure what I'm doing wrong or if my wsdl is incorrect. What is the
proper
> way to pass a complex type to an object? I've tried using wsdl2php but I
> received the same error so I assume my wsdl must be incorrect.
>
> Can someone please help? Any pointers will be appreciated.
>
> Pat
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php