sub getComplexObj { my $_count = 12 my $mike = { 'Count'=> SOAP::Data->new( name => 'Count', value => $_count, type => 'xsd:int' )->attr({ 'xmlns' => $MC_XMLNS }), 'test' => SOAP::Data->new( name => 'test', value => 'test string', type =>'xsd:string' )->attr({ 'xmlns'=> $MC_XMLNS })}; my $foo = SOAP::Data->new( name => 'return', value =>bless{ $self ,('compObj')->attr({ 'xsi:type' => typens:'compObj' })} )->attr({ 'xmlns' => $MC_XMLNS }); return $foo; } #### my $foo = SOAP::Data->name('return')->value(bless{ $self ,'compObj'})->attr({ 'xmlns' => $MC_XMLNS }); #### /// /// /// foo /// [System.Web.Services.WebServiceBinding(Name="ComplexObjectPort", Namespace="http://VALIDHTTP")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public class ComplexObj : System.Web.Services.Protocols.SoapHttpClientProtocol { public ComplexObj() { this.Url = "http://VALIDHTTP/co.pcgi"; } [System.Web.Services.Protocols.SoapRpcMethodAttribute("http://VALIDHTTP#getComplexObj", RequestNamespace="http://VALIDHTTP", ResponseNamespace="http://VALIDHTTP")] [return: System.Xml.Serialization.SoapElement("return")] public compObj getComplexObj() { object[] results = this.Invoke("getComplexObj", new object[]); return ((compObj)(results[0])); } public System.IAsyncResult BegingetComplexObj(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("getComplexObj", new object[], callback, asyncState); } public compObj EndgetComplexObj(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((compObj)(results[0])); } } /// [System.Xml.Serialization.SoapType(Namespace="http://VALID HTTP")] public class compObj { /// public int Count; /// public string test; } #### try { ComplexObject co = new ComplexObject(); compObj comp = co.getComplexObj(); } catch( Exception e ) { richTextBox1.Text+=e.Message + "\n" + e.StackTrace; }