Loading ...
Sorry, an error occurred while loading the content.

2547Re: replace namesp1 from method call?

Expand Messages
  • Rich
    Apr 23 5:49 AM
    • 0 Attachment
      Thanks Byrne, you got me started on it, ya might have made a typo
      though so here is my final result for posterity (note prefix and uri
      change in method:

      my $method = SOAP::Data->name("getAllPendingDocumentInfo")
      ->uri("nsMerchantDataExchange")
      ->prefix("ns");
      my $results = $soap->call($method => (SOAP::Data
      ->name("merchant")
      ->type("ns:Merchant")
      ->value(
      \SOAP::Data->value(
      SOAP::Data->name("merchantName" => "1922"),
      SOAP::Data->name("merchantIdentifier" => "1922")
      ->type("ns:MerchantIdentifier"),
      ) ),
      SOAP::Data->name("messageType" => "_GET_ORDERS_DATA_")
      ->type("ns:MessageType")
      ) );

      and the XML on the wire is:

      <SOAP-ENV:Body>
      <ns:getAllPendingDocumentInfo xmlns:ns="nsMerchantDataExchange">
      <merchant xsi:type="ns:Merchant">
      <merchantName xsi:type="xsd:string">1922</merchantName>
      <merchantIdentifier
      xsi:type="ns:MerchantIdentifier">1922</merchantIdentifier>
      </merchant>
      <messageType
      xsi:type="ns:MessageType">_GET_ORDERS_DATA_</messageType>
      </ns:getAllPendingDocumentInfo>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>


      --- In soaplite@yahoogroups.com, Byrne Reese <breese@g...> wrote:
      > Try this:
      >
      > my $method = SOAP::Data->name("getAllPendingDocumentInfo)
      > ->uri("ns");
      >
      > my $results = $soap->call($method =>
      > SOAP::Data
      > ->name("merchant")
      > ->type("ns:Merchant")
      > ->value(
      > \SOAP::Data->value(
      > SOAP::Data->name("merchantName" => "1922"),
      > SOAP::Data->name("merchantIdentifier" => "1922")
      > ->type("ns:MerchantIdentifier"),
      > ) ),
      > SOAP::Data->name("messageType" => "_GET_ORDERS_DATA_")
      > ->type("ns:MessageType")
      > );
      >
      >
      > -----Original Message-----
      > From: Rich [mailto:krush_groover@y...]
      > Sent: Tuesday, April 22, 2003 4:09 PM
      > To: soaplite@yahoogroups.com
      > Subject: [soaplite] replace namesp1 from method call?
      >
      >
      > How do I replace the namespace (namesp1) in the method call with
      > something simpler, like "ns"? Here's the perl I'm using:
      >
      > my $results = $soap->getAllPendingDocumentInfo(SOAP::Data
      > ->name("merchant")
      > ->type("ns:Merchant")
      > ->value(
      > \SOAP::Data->value(
      > SOAP::Data->name("merchantName" => "1922"),
      > SOAP::Data->name("merchantIdentifier" => "1922")
      > ->type("ns:MerchantIdentifier"),
      > ) ),
      > SOAP::Data->name("messageType" => "_GET_ORDERS_DATA_")
      > ->type("ns:MessageType")
      > );
      >
      > Here's the XML it generates:
      >
      > <namesp1:getAllPendingDocumentInfo
      > xmlns:namesp1="nsMerchantDataExchange">
      > <merchant xsi:type="ns:Merchant">
      > <merchantName xsi:type="xsd:string">1922</merchantName>
      > <merchantIdentifier
      > xsi:type="ns:MerchantIdentifier">1922</merchantIdentifier>
      > </merchant>
      > <messageType
      xsi:type="ns:MessageType">_GET_ORDERS_DATA_</messageType>
      > </namesp1:getAllPendingDocumentInfo>
      > </SOAP-ENV:Body></SOAP-ENV:Envelope>
      >
      >
      > thanks in advance!
      > -Rich
      >
      >
      >
      >
      > Yahoo! Groups Sponsor
      >
      >
      <http://rd.yahoo.com/M=249982.3179269.4495679.1728375/D=egroupweb/S=17
      057010
      > 14:HM/A=1524963/R=0/*http://hits.411web.com/cgi-bin/autoredir?
      camp=556&linei
      > d=3179269&prop=egroupweb&pos=HM>
      >
      > <http://us.adserver.yahoo.com/l?
      M=249982.3179269.4495679.1728375/D=egroupmai
      > l/S=:HM/A=1524963/rand=141278554>
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
      > <http://docs.yahoo.com/info/terms/> .
    • Show all 4 messages in this topic