Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. perl and C#

perl and C#

Scheduled Pinned Locked Moved C#
csharpperlwcfxmlhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    allenmpcx
    wrote on last edited by
    #1

    I have some perl functions that get called through SOAP and C#. Is there a way to call these functions going from perl to C#? ** NOTE If this shows up twice, its because there was an error and I had to rename my post to post it. ** Mike - I love to program!

    T 1 Reply Last reply
    0
    • A allenmpcx

      I have some perl functions that get called through SOAP and C#. Is there a way to call these functions going from perl to C#? ** NOTE If this shows up twice, its because there was an error and I had to rename my post to post it. ** Mike - I love to program!

      T Offline
      T Offline
      Tom Larsen
      wrote on last edited by
      #2

      The virtual machine implementations of C# and Perl are radically different so calling methods between "byte codes" is almost impossible. You can however do a SOAP proxy like that to do interprocess communications at that level if the lower level IPC is too low.

      A 1 Reply Last reply
      0
      • T Tom Larsen

        The virtual machine implementations of C# and Perl are radically different so calling methods between "byte codes" is almost impossible. You can however do a SOAP proxy like that to do interprocess communications at that level if the lower level IPC is too low.

        A Offline
        A Offline
        allenmpcx
        wrote on last edited by
        #3

        Alright, I have the following perl code: 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; } 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: /// /// /// 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 { ///

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups