Hello,

I'm in the process of updating some code around and wanted to provide webservices from my WO app to a Cocoa application. I've got the basic communication going, but for some reason, can't get my WO webservices to properly send out a complex object. There is a services called LicenseServices. It has a method authorizeClientWithUserAndKey. The response should be a custom object called LicenseAuthorizationResponse. For some reason, the custom object does not get rendered correctly (though the rest of the response does). The WSDL looks right. So, I'm not sure what's going on. If I modify the method to send out a standard object (String, NSDictionary, etc.), everything gets sent out as expected. Details below. If anyone can spot the problem, please chime in. It's been several years since doing webservices and some details seem to have slipped my mind. Thanks.

------------------------ application.java -------------------

WOWebServiceRegistrar.registerWebService("LicenseServices", LicenseServices.class, true);
        BeanDeserializerFactory deserializer;
        BeanSerializerFactory serializer;
        QName qName;

qName = new QName("webservices.server.thoughtconduit.net", "LicenseAuthorizationResponse"); serializer = new BeanSerializerFactory(LicenseAuthorizationResponse.class, qName); deserializer = new BeanDeserializerFactory(LicenseAuthorizationResponse.class, qName);

        WOWebServiceRegistrar.registerFactoriesForClassWithQName(
serializer, deserializer, LicenseAuthorizationResponse.class, qName);

------------------- LicenseServices.java --------------

public LicenseAuthorizationResponse authorizeClientWithUserAndKey(String appID, String name, String licenseKey) {

LicenseAuthorizationResponse response = new LicenseAuthorizationResponse("wally");
                return response;
        }

---------------- LicenseAuthorizationResponse.java -------------------------------------------

public class LicenseAuthorizationResponse extends Object implements java.io.Serializable {

        private static final long serialVersionUID = -8359021596117741689L;
        protected String taco;

        public LicenseAuthorizationResponse(String aValue) {
                super();
                setTaco(aValue);
        }
        
        public String taco() {
                return taco;
        }
        
        public void setTaco(String aTaco) {
                taco = aTaco;
        }

}
----------------- wsdl (sorry about the lack of formatting ---------------------------------------

<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://ovid.sensoryresearch.net:16000/cgi-bin/WebObjects/ThoughtConduitRemote.woa/ws/LicenseServices " xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="http://ovid.sensoryresearch.net:16000/cgi-bin/WebObjects/ThoughtConduitRemote.woa/ws/LicenseServices " xmlns:intf="http://ovid.sensoryresearch.net:16000/cgi-bin/WebObjects/ThoughtConduitRemote.woa/ws/LicenseServices " xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:tns1="webservices.server.thoughtconduit.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/ " xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema "><!--WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)--><wsdl:types><schema targetNamespace="webservices.server.thoughtconduit.net" xmlns="http://www.w3.org/2001/XMLSchema "><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/ ><complexType name="LicenseAuthorizationResponse"><sequence><element name="taco" nillable="true" type="soapenc:string"/></sequence></ complexType></schema></wsdl:types> <wsdl:message name="authorizeClientWithUserAndKeyRequest"> <wsdl:part name="appID" type="soapenc:string"/> <wsdl:part name="name" type="soapenc:string"/> <wsdl:part name="licenseKey" type="soapenc:string"/> </wsdl:message> <wsdl:message name="authorizeClientWithUserAndKeyResponse"> <wsdl:part name="authorizeClientWithUserAndKeyReturn" type="tns1:LicenseAuthorizationResponse"/> </wsdl:message> <wsdl:portType name="LicenseServices"> <wsdl:operation name="authorizeClientWithUserAndKey" parameterOrder="appID name licenseKey"> <wsdl:input message="impl:authorizeClientWithUserAndKeyRequest" name="authorizeClientWithUserAndKeyRequest"/> <wsdl:output message="impl:authorizeClientWithUserAndKeyResponse" name="authorizeClientWithUserAndKeyResponse"/> </wsdl:operation> </ wsdl:portType> <wsdl:binding name="LicenseServicesSoapBinding" type="impl:LicenseServices"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http "/> <wsdl:operation name="authorizeClientWithUserAndKey"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="authorizeClientWithUserAndKeyRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://webservices.server.thoughtconduit.net " use="encoded"/> </wsdl:input> <wsdl:output name="authorizeClientWithUserAndKeyResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://ovid.sensoryresearch.net:16000/cgi-bin/WebObjects/ThoughtConduitRemote.woa/ws/LicenseServices " use="encoded"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="LicenseServices"> <wsdl:port binding="impl:LicenseServicesSoapBinding" name="LicenseServices"> <wsdlsoap:address location="http://ovid.sensoryresearch.net:16000/cgi-bin/WebObjects/ThoughtConduitRemote.woa/ws/LicenseServices "/> </wsdl:port> </wsdl:service> </wsdl:definitions>

------------ Request Response --------------------------------------------------

<?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>
<ns1:authorizeClientWithUserAndKeyResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ " xmlns:ns1="http://webservices.server.thoughtconduit.net";>
                        <authorizeClientWithUserAndKeyReturn href="#id0"/>
                </ns1:authorizeClientWithUserAndKeyResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ " xsi:type="ns2:LicenseAuthorizationResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/ " xmlns:ns2="webservices.server.thoughtconduit.net"/>
        </soapenv:Body>
</soapenv:Envelope>

Jaime Magiera

Sensory Research
http://www.sensoryresearch.net

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to