jeanba has asked for the wisdom of the Perl Monks concerning the following question:
I build the Complextype with the SOAP::Data::ComplexType mod and when i call the method i have this error message :<complexType name="Context"> <sequence> <element name="agent" type="xsd:boolean"/> <element name="deliveryBlockedByApproval" type="xsd:boolean"/> <element name="fiabilisation" type="xsd:boolean"/> <element name="fromDispatch" type="xsd:boolean"/> <element name="fromEmission" type="xsd:boolean"/> <element name="fromSite" type="xsd:boolean"/> <element name="hasComment" nillable="true" type="soapenc:string"/ +> <element name="hasMetaDossier" nillable="true" type="soapenc:stri +ng"/> <element name="market" nillable="true" type="soapenc:string"/> <element name="mdHasConstraints" type="xsd:boolean"/> <element name="user" nillable="true" type="soapenc:string"/> </sequence> </complexType>
FYI the complex type looks like this :Type 'Context' can't be found in a schema class 'SOAP::Serializer'
the way i build the complex type is :<?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:namesp2="http://namespaces.soaplite.com/perl" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <namesp1:Context xmlns:namesp1="http://wsprod.egencia.com/services/D +eliveryWS?wsdl" xsi:type="namesp2"> <agent xsi:type="xsd:int">1</agent> <user xsi:type="xsd:string">jbbec</user> </namesp1:Context> </SOAP:ENV>
and the mod ContextType_inner.pm is like :my $request_obj = ContextType_inner->new({Context=>{ user => 'jbbec', agent => 1 }}); print $request_obj->as_xml_data;# it's printing what is written above
Could someone help me please ?package ContextType; use strict; use warnings; use SOAP::Data::ComplexType; use vars qw(@ISA); @ISA = qw(SOAP::Data::ComplexType); use constant OBJ_URI => 'http://my_serv/services/DeliveryWS?wsdl'; use constant OBJ_TYPE => ''; use constant OBJ_FIELDS => { user => ['string', undef, undef], agent => ['int', undef, undef], }; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $data = shift; my $obj_fields = shift; $obj_fields = defined $obj_fields && ref($obj_fields) eq 'HASH' +? {%{$obj_fields}, %{+OBJ_FIELDS}} : OBJ_FIELDS; my $self = $class->SUPER::new($data, $obj_fields); return bless($self, $class); } package ContextType_inner; use strict; use warnings; use SOAP::Data::ComplexType; use vars qw(@ISA); @ISA = qw(SOAP::Data::ComplexType); use constant OBJ_URI => 'http://my_serv/services/DeliveryWS?wsdl'; use constant OBJ_TYPE => ''; use constant OBJ_FIELDS => { Context => [ [ ContextType::OBJ_TYPE, ContextType::OBJ_FIELDS ], ContextType::OBJ_URI, undef ] }; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $data = shift; my $obj_fields = shift; $obj_fields = defined $obj_fields && ref($obj_fields) eq 'HASH +' ? {%{$obj_fields}, %{+OBJ_FIELDS}} : OBJ_FIELDS; my $self = $class->SUPER::new($data, $obj_fields); return bless($self, $class); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using a client SOAP with SOAP::Lite with ComplexType
by gellyfish (Monsignor) on May 11, 2006 at 14:49 UTC | |
by jeanba (Novice) on May 11, 2006 at 15:10 UTC | |
by gellyfish (Monsignor) on May 11, 2006 at 15:49 UTC | |
by jeanba (Novice) on May 12, 2006 at 06:40 UTC | |
by gellyfish (Monsignor) on May 12, 2006 at 08:18 UTC | |
|