Click here to Skip to main content
15,895,709 members
Home / Discussions / C#
   

C#

 
AnswerRe: A statistical random function Pin
CWIZO20-Mar-06 9:42
CWIZO20-Mar-06 9:42 
GeneralRe: A statistical random function Pin
Madmaximus20-Mar-06 10:23
Madmaximus20-Mar-06 10:23 
GeneralRe: A statistical random function Pin
Dan Neely20-Mar-06 10:30
Dan Neely20-Mar-06 10:30 
Questionadding xml schema location to serialized xml file Pin
Dan Neely20-Mar-06 9:32
Dan Neely20-Mar-06 9:32 
AnswerRe: adding xml schema location to serialized xml file Pin
Dan Neely20-Mar-06 10:01
Dan Neely20-Mar-06 10:01 
Questionperl and C# Pin
allenmpcx20-Mar-06 9:11
allenmpcx20-Mar-06 9:11 
AnswerRe: perl and C# Pin
Tom Larsen20-Mar-06 10:19
Tom Larsen20-Mar-06 10:19 
QuestionRe: perl and C# Pin
allenmpcx25-Mar-06 10:16
allenmpcx25-Mar-06 10:16 
Alright, I have the following perl code:

<br />
sub getComplexObj<br />
{<br />
my $_count = 12<br />
my $mike = {<br />
'Count'=> SOAP::Data->new( name => 'Count', value => $_count, type => 'xsd:int' )->attr({ 'xmlns' => $MC_XMLNS }),<br />
'test' => SOAP::Data->new( name => 'test', value => 'test string', type =>'xsd:string' )->attr({ 'xmlns'=> $MC_XMLNS })};<br />
<br />
my $foo = SOAP::Data->new(<br />
name => 'return',<br />
value =>bless{ $self ,('compObj')->attr({ 'xsi:type' => typens:'compObj' })}<br />
)->attr({ 'xmlns' => $MC_XMLNS });<br />
<br />
return $foo;<br />
}<br />


I have a WSDL file and I use that to automatically generate a C# file that uses a SOAP proxy to call this function. When I run my code, I get the following error from .NET:

"Failed to access class (CS3::SOAP::ComplexObject): syntax error at CS3/SOAP/ComplexObject.pm line 13, near \"typens:\"\nCompilation failed in require at (eval 201) line 3.\n"

When I change the $foo object to:
my $foo = SOAP::Data->name('return')->value(bless{ $self ,'compObj'})->attr({ 'xmlns' => $MC_XMLNS });

I get this error from .NET:
"Cannot assign object of type System.Xml.XmlNode[] to an object of type compObj."

Just for reference, my C# file looks like this:
<br />
/// <remarks/><br />
/// <summary><br />
/// foo<br />
/// </summary><br />
[System.Web.Services.WebServiceBinding(Name="ComplexObjectPort", Namespace="http://VALIDHTTP")]<br />
[System.Diagnostics.DebuggerStepThroughAttribute()]<br />
[System.ComponentModel.DesignerCategoryAttribute("code")]<br />
public class ComplexObj : System.Web.Services.Protocols.SoapHttpClientProtocol {<br />
    <br />
    public ComplexObj() {<br />
        this.Url = "http://VALIDHTTP/co.pcgi";<br />
    }<br />
    <br />
    [System.Web.Services.Protocols.SoapRpcMethodAttribute("http://VALIDHTTP#getComplexObj", RequestNamespace="http://VALIDHTTP", ResponseNamespace="http://VALIDHTTP")]<br />
    [return: System.Xml.Serialization.SoapElement("return")]<br />
    public compObj getComplexObj() {<br />
        object[] results = this.Invoke("getComplexObj", new object[]);<br />
        return ((compObj)(results[0]));<br />
    }<br />
    <br />
    public System.IAsyncResult BegingetComplexObj(System.AsyncCallback callback, object asyncState) {<br />
        return this.BeginInvoke("getComplexObj", new object[], callback, asyncState);<br />
    }<br />
    <br />
    public compObj EndgetComplexObj(System.IAsyncResult asyncResult) {<br />
        object[] results = this.EndInvoke(asyncResult);<br />
        return ((compObj)(results[0]));<br />
    }<br />
}<br />
<br />
/// <remarks/><br />
[System.Xml.Serialization.SoapType(Namespace="http://VALID HTTP")]<br />
public class compObj {<br />
    <br />
    /// <remarks/><br />
    public int Count;<br />
    <br />
    /// <remarks/><br />
    public string test;<br />
}<br />


Then in a main file I have:
<br />
try<br />
{<br />
    ComplexObject co = new ComplexObject();<br />
    compObj comp = co.getComplexObj();<br />
}<br />
catch( Exception e )<br />
{<br />
    richTextBox1.Text+=e.Message + "\n" + e.StackTrace;<br />
}<br />


My ultimate goal is simply to call a function from perl that returns a complex object. ANY help would be greatly appreciated.



Mike - I love to program!

-- modified at 16:42 Saturday 25th March, 2006
QuestionIBMDA400 OLE DB Provider, data connection Pin
enasromios20-Mar-06 8:16
enasromios20-Mar-06 8:16 
QuestionLabels at runtime Pin
alexdg0420-Mar-06 8:03
alexdg0420-Mar-06 8:03 
AnswerRe: Labels at runtime Pin
CWIZO20-Mar-06 9:26
CWIZO20-Mar-06 9:26 
GeneralRe: Labels at runtime Pin
alexdg0420-Mar-06 9:29
alexdg0420-Mar-06 9:29 
AnswerRe: Labels at runtime Pin
CWIZO20-Mar-06 9:32
CWIZO20-Mar-06 9:32 
GeneralRe: Labels at runtime Pin
alexdg0420-Mar-06 9:37
alexdg0420-Mar-06 9:37 
GeneralRe: Labels at runtime Pin
CWIZO20-Mar-06 9:41
CWIZO20-Mar-06 9:41 
GeneralRe: Labels at runtime Pin
Dave Kreskowiak20-Mar-06 10:24
mveDave Kreskowiak20-Mar-06 10:24 
Questiondesing label like in desing time but in runtime Pin
alexdg0420-Mar-06 7:54
alexdg0420-Mar-06 7:54 
AnswerRe: desing label like in desing time but in runtime Pin
Baeltazor21-Feb-10 21:02
Baeltazor21-Feb-10 21:02 
AnswerRe: desing label like in desing time but in runtime Pin
Baeltazor21-Feb-10 21:03
Baeltazor21-Feb-10 21:03 
QuestionHow to get the dynanic part of an website ? Pin
K.A.L20-Mar-06 7:30
K.A.L20-Mar-06 7:30 
AnswerRe: How to get the dynanic part of an website ? Pin
darkelv20-Mar-06 7:48
darkelv20-Mar-06 7:48 
GeneralRe: How to get the dynanic part of an website ? Pin
K.A.L20-Mar-06 9:41
K.A.L20-Mar-06 9:41 
GeneralRe: How to get the dynanic part of an website ? Pin
darkelv21-Mar-06 0:34
darkelv21-Mar-06 0:34 
GeneralRe: How to get the dynanic part of an website ? Pin
K.A.L21-Mar-06 10:41
K.A.L21-Mar-06 10:41 
Questioninterface(s) on inheritance Pin
spin vector20-Mar-06 7:10
spin vector20-Mar-06 7:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.