PB 9.0 Web Service Proxy Wizard

PB 9.0 Web Service Proxy Wizard

Post by masterofho » Sun, 14 Sep 2003 09:01:57


'm experimenting with PB 9.0 Enterprise and I have the following
problem:

I created a simple web service on my computer using Java. The web
service has 1 method that takes a string. It returns an object of
type PassParent. That object has two properties: an integer and a
reference to an object of type PassChild. The PassChild object has
two properties, one an int, the other a string. Simple enough.

I ran the Web Service Proxy Wizard and it created the structures.
That part went fine. When I ran my program, I got an error saying it
couldn't find the int property of the child by name. I finally
figured out that the problem occurred because, in my web service, I
hadn't created a new instance of the child for the parent (I had a
null pointer). What's weird is that I wasn't even trying to access
the properties of the child in PB. When I created a client program in
Java, it worked just fine.

I went back to my web service and added: child = new PassChild();
That seemed to fix the problem that PB was having. The Java client
worked either way.

This behavior concerns me. I don't know much about web services and
SOAP, but by looking at the WSDL (provided below) it says that the
property for the child is "nillable". I assume that means that the
child does not have to created, that it can be null. The Java client
seems to respond that way. If that is the case, then why is PB trying
to populate that child object? I can always force all of my own web
services to always populate the objects but what if I want to call an
outside service that doesn't? Is there something I'm missing here?



WSDL:
---------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost:8080/axis/services/MultiPassService"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8080/axis/services/MultiPassService"
xmlns:intf="http://localhost:8080/axis/services/MultiPassService"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="urn:BeanService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="urn:BeanService"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="PassChild">
<sequence>
<element name="age" type="xsd:int"/>
<element name="name" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="PassParent">
<sequence>
<element name="age" type="xsd:int"/>
<element name="child" nillable="true" type="tns1:PassChild"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="getParentRequest">
<wsdl:part name="in0" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getParentResponse">
<wsdl:part name="getParentReturn" type="tns1:PassParent"/>
</wsdl:message>
<wsdl:portType name="Multipass">
<wsdl:operation name="getParent" parameterOrder="in0">
<wsdl:input message="impl:g