in reply to Re: SOAP lite with WCF
in thread SOAP lite with WCF

My script is like this
#!/usr/bin/perl package main; use SOAP::Lite +trace; use LWP::UserAgent; use HTTP::Request::Common; # Variables my $url = 'http://[hostname]/ProfileManager/100818/ProfileManager.svc? +wsdl'; my $url_debug = 'http://localhost:11040/Service1.svc?wsdl'; my $uri = 'urn:::profilemanager:profilemanagerrequestmanager:100818'; my $soap = SOAP::Lite -> ns( 'http://www.w3.org/2001/XMLSchema-instance', 'xsi' ) -> ns( 'urn:::profilemanager:requestmanager', 'a' ) -> ns( 'urn:::profilemanager:contract:110308', 'b' ) -> uri($uri) -> on_action( sub { join '.', 'urn:::profilemanager:requestmanager:100 +818.ProfileScopeServiceContract', $_[1] } ) -> proxy($url); my $method = SOAP::Data->name('ProcessMessage') ->attr({xmlns => 'urn:::profilemanager:profilemanagerrequestmanager:10 +0818'}); my @params = ( SOAP::Data->type("b:Organisation")->name("a:Payload")-> +value( \SOAP::Data->value( SOAP::Data->name("b:OrganisationUnitId")->value(""), SOAP::Data->name("b:OrganisationDescription")->attr( { 'xsi:nil' => "t +rue" } ) ) ), SOAP::Data->name("a:ProcessingInstruction")->value( \SOAP::Data->value( SOAP::Data->name("b:Action")->value("GetOrganisationById"), SOAP::Data->name("b:Strategy")->value( \SOAP::Data->value( SOAP::Data->name("b:Name")->attr( { 'xsi:nil' => "true" } ), SOAP::Data->name("b:Paging")->attr( { 'xsi:nil' => "true" } ), SOAP::Data->name("b:SearchCriteria")->attr( { 'xsi:nil' => "true" + } ) ) ), SOAP::Data->name("b:Meta")->attr( { 'xsi:nil' => "true" } ) ) ) ); print $soap->call($method => @params)->result;

Replies are listed 'Best First'.
Re^3: SOAP lite with WCF
by Anonymous Monk on Jul 05, 2013 at 05:43 UTC
      Possibly but I'm struggling to understand how the function works. If I execute the following:
      my $soap = SOAP::Lite -> ns( 'http://www.w3.org/2001/XMLSchema-instance', 'xsi' ) -> ns( 'urn::sdp:profilemanager:requestmanager', 'a' ) -> ns( 'urn::sdp:profilemanager:contract:110308', 'b' ) -> uri($uri) -> on_action( sub { join '.ProcessMessage', 'urn::sdp:profilemanag +er:requestmanager:100818.ProfileScopeServiceContract', $_[1] } ) -> proxy($url); my $method = SOAP::Data->name('Request') ->attr({xmlns => 'urn::sdp:profilemanager:profilemanagerrequestman +ager:100818'});
      I get the the following so I'm almost there but how do I stop 'Request' being appended to the SOAP Action?
      Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 1365 Content-Type: text/xml; charset=utf-8 SOAPAction: urn::sdp:profilemanager:requestmanager:100818.ProfileScope +Ser viceContract.ProcessMessageRequest <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:namesp1="ur +n:: sdp:profilemanager:profilemanagerrequestmanager:100818" xmlns:a="urn:: +sdp :profilemanager:requestmanager" soap:encodingStyle="http://schemas.xml +soap.org/s oap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" +xmlns:b="u rn::sdp:profilemanager:contract:110308" xmlns:soapenc="http://schemas. +xml soap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-i +nstance" x="" mlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <Request xmlns="urn:telec om:sdp:profilemanager:profilemanagerrequestmanager:100818"> <a:Payload xsi:type=" b:Organisation"> <b:OrganisationUnitId xsi:type="xsd:string"> OrgId</b:Organisat

        I get the the following so I'm almost there but how do I stop 'Request' being appended to the SOAP Action?

        Um, modify on_action so it doesn't append "Request"