in reply to perl, SOAP and C#

I can't help you with your C# code but I can tell you why you got that syntax error. It's because of this snippet right here:
{ 'xsi:type' => typens:'compObj' }
just as the Perl compiler said. I assume what you really meant is this:
{ 'xsi:type' => 'typens:compObj' }
which is valid Perl.

Replies are listed 'Best First'.
Re^2: perl, SOAP and C#
by allenmpcx (Initiate) on Mar 27, 2006 at 10:24 UTC
    Thanks for the help! That fixed my syntax error, but now I get the error: "Can't locate object method \"attr\" via package \"compObj\" (perhaps you forgot to load \"compObj\"?) at...." where I assign the $foo object. Any thoughts??
      There is still something a bit strange in this fragment:
      value =>bless{ $self ,('compObj')->attr({ 'xsi:type' => 'typens:compOb +j' })}
      There are two issues here. First, you're blessing, into the current package, a hash reference with a single pair in which the key is $self. This makes me a little suspicious because $self is presumably a reference of some sort so I'm not totally clear on what the bless call is supposed to do. The second thing, which is what the error is coming from, is that you're calling the attr method, not on an object, but on the string 'compObj' which makes Perl think that attr is a class method in the package 'compObj', which I suspect is not what you want. Unfortunately I don't know what exactly the result is supposed to be so I can't suggest how to change it.
        I am sorry. I am new to perl so I'm not familiar with everything yet. Basically, I want to have something like this:
        sub makeSandwhich { my $lettuce = 'green'; my $bread = 2; my $sandwhich = "perl equivalent of lettuce and bread in one object"; return $sandwhich; }
        Basically, I am trying to make a complex object, and then return it in perl, so that I can use SOAP to get the object in C#.