in reply to Re: WebService client with SOAP::Lite and ComplexType
in thread WebService client with SOAP::Lite and ComplexType

Thanks for the reply. I did exactly what you said but the problem remains. The request_obj->as_xml_data became:
<?xml version="1.0" encoding="UTF-8"?> <SOAP:ENV xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <namesp1:PublishRequestMessage xmlns:namesp1="http://services.mydoma +in.org/broker" xsi:type="ns1:PublishRequestMessage"> <namesp2:brokerMessage xsi:type="ns1:brokerMessage" xmlns:namesp2= +"http://services.mydomain.org/broker"> <destinationName xsi:type="xsd:string">blogs</destinationName> <textPayload xsi:type="xsd:string">TEST</textPayload> </namesp2:brokerMessage> </namesp1:PublishRequestMessage> </SOAP:ENV>
But running the client produces the same result:
Type 'PublishRequest' can't be found in a schema class 'SOAP::Serializ +er'
The <Body> tag is also missing... Any thoughts?

Replies are listed 'Best First'.
Re^3: WebService client with SOAP::Lite and ComplexType
by gellyfish (Monsignor) on Jul 05, 2006 at 10:59 UTC

    Can you set use SOAP::Lite +trace => qw(debug); in the client and give us the entire output? The SOAP envelope I'm seeing here is different to what you have above and it's rather difficult not having the service you are using to test with.

    /J\

      I already have debug activated. The whole output really is:
      lj@huge:~$ ./complex.pl document/literal support is EXPERIMENTAL in SOAP::Lite at /usr/local/s +hare/perl/5.8.7/SOAP/Lite.pm line 2818. Type 'PublishRequest' can't be found in a schema class 'SOAP::Serializ +er' lj@huge:~$

        er, well it certainly does work for me:

        document/literal support is EXPERIMENTAL in SOAP::Lite at /usr/lib/per +l5/site_perl/5.8.1/SOAP/Lite.pm line 2818. SOAP::Transport::HTTP::Client::send_receive: POST http://localhost:800 +0/broker/producer HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 944 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://services.mydomain.org/broker/publish" <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:namesp6="http://services.mydomain.org/broker"> <soap:Body> <typens:publish> <namesp4:PublishRequestMessage xsi:type="ns1:PublishRequest" xml +ns:namesp4="http://services.mydomain.org/broker"> <namesp6:brokerMessage xsi:type="ns1:BrokerMessage" xmlns:name +sp6="http://services.mydomain.org/broker"> <destinationName xsi:type="xsd:string">blogs</destinationNam +e> <textPayload xsi:type="xsd:string">TEST</textPayload> </namesp6:brokerMessage> </namesp4:PublishRequestMessage> </typens:publish> </soap:Body> </soap:Envelope> SOAP::Transport::HTTP::Client::send_receive: 500 Can't connect to loca +lhost:8000 (connect: Connection refused) Content-Type: text/plain Client-Date: Wed, 05 Jul 2006 11:21:37 GMT Client-Warning: Internal response 500 Can't connect to localhost:8000 (connect: Connection refused) 500 Can't connect to localhost:8000 (connect: Connection refused) at t +tt.2 line 26
        However there seems to be a namespace problem here - you are using the 'ns1:' prefix for your types but that doesn't appear to be defined anywhere. You might try switching the types to use one of the namespace prefixes that SOAP::Lite generates for the data. I don't really understand what prefix you are supposed to use with these though - it appears that a new one is create to the namespace ' http://namespaces.soaplite.com/perl' if you omit the prefix.

        /J\

        A reply falls below the community's threshold of quality. You may see it by logging in.