473,396 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SOAP::Lite Issue with sending new request to EAI while looping thru multiple record

Hi,

I have been working on a script that loops through multiple records and sends data (one record per call) to a WS.

I am supposed to make a new call for each record before sending the data.
The problem I have is the first record gets processed fine where as the second record always; reason being the EAI expects it to be a seperate call
Though I am creating/reseting a new service everytime within the foreach loop the data seems to be going as a single call.

If you see record 1 and 2 below it has 2 different namespace i.e. namesp1 and namesp2; The EAI is expection namesp1 for both.

Any suggestions on this would be greatly appreciated.

Please find the sample code below

Thanks,
Vignesh


Expand|Select|Wrap|Line Numbers
  1. Result:
  2.  
  3. ----------Record 1--------------------
  4.  
  5. SOAP::Transport::HTTP::Client::send_receive: POST http://bcv50s6e.vz.cit.a.com:6055/soap/WSSparePartProcessforeSpare
  6. Accept: text/xml
  7. Accept: multipart/*
  8. Content-Length: 4174
  9. Content-Type: text/xml; charset=iso-8859-1
  10. SOAPAction: "http://bcv50s6e.vz.cit.a.com:6055/soap/WSSparePartProcessforeSpare#MyService"
  11.  
  12. <?xml version="1.0" encoding="iso-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
  13. <SOAP-ENV:Body><namesp1:MyService xmlns:namesp1="http://bcv50s6e.vz.cit.a.com:6055/soap/WSSparePartProcessforeSpare">
  14. <eSparesMessage>
  15. <Header>
  16. <Basic>
  17. <ServiceType xsi:type="xsd:string">Return for Repair</ServiceType>
  18. <OrderType xsi:type="xsd:string">SO</OrderType>
  19. <ServiceObjectiveType xsi:type="xsd:string">Deliver</ServiceObjectiveType>
  20. </Header>
  21. <LineItem>
  22. <PartTrackingNumber xsi:type="xsd:string">5-0277051.001</PartTrackingNumber>
  23. <ItemLineNumber xsi:type="xsd:int">1</ItemLineNumber>
  24. </LineItem></eSparesMessage>
  25. </namesp1:MyService></SOAP-ENV:Body></SOAP-ENV:Envelope>
  26.  
  27. SOAP::Transport::HTTP::Client::send_receive: HTTP/1.0 200 OK
  28. Connection: Close
  29. Content-Length: 551
  30. Content-Type: text/xml;charset=utf-8
  31. Client-Date: Mon, 18 May 2009 13:45:52 GMT
  32. Client-Peer: 139.54.50.110:6055
  33. Client-Response-Num: 1
  34. Set-Cookie: ssnid=607wTxHRjth3kUcEx81g2G648Lg4bA-6055110; path=/;
  35.  
  36. <?xml version="1.0" encoding="UTF-8"?>
  37. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  38. <SOAP-ENV:Body>
  39. <namesp1:ReturnCode xmlns:namesp1="http://www.alu.com/webservices/asi/WSSparePartProcessforeSpare">
  40.   <Number>409</Number>
  41.   <Message>Error on SPT 5-0277051.001 RMA already exist</Message>
  42. </namesp1:ReturnCode></SOAP-ENV:Body>
  43. </SOAP-ENV:Envelope>
  44.  
  45.  
  46.  
  47. -----------------Record 2-----------------------
  48. SOAP::Transport::HTTP::Client::send_receive: POST http://bcv50s6e.vz.cit.a.com:6055/soap/WSSparePartProcessforeSpare
  49. Accept: text/xml
  50. Accept: multipart/*
  51. Content-Length: 4851
  52. Content-Type: text/xml; charset=iso-8859-1
  53. SOAPAction: "http://bcv50s6e.vz.cit.a.com:6055/soap/WSSparePartProcessforeSpare#MyService"
  54.  
  55. <?xml version="1.0" encoding="iso-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
  56. <SOAP-ENV:Body><namesp2:MyService xmlns:namesp2="http://bcv50s6e.vz.cit.a.com:6055/soap/WSSparePartProcessforeSpare">
  57. <eSparesMessage>
  58. <Header>
  59. <Basic>
  60. <ServiceType xsi:type="xsd:string">Return for Repair</ServiceType>
  61. <OrderType xsi:type="xsd:string">SO</OrderType>
  62. <ServiceObjectiveType xsi:type="xsd:string">Deliver</ServiceObjectiveType>
  63. </Header>
  64. <LineItem>
  65. <PartTrackingNumber xsi:type="xsd:string">5-0277051.001</PartTrackingNumber>
  66. <ItemLineNumber xsi:type="xsd:int">1</ItemLineNumber>
  67. </LineItem></eSparesMessage>
  68. </namesp1:MyService></SOAP-ENV:Body></SOAP-ENV:Envelope>
  69.  
  70. SOAP::Transport::HTTP::Client::send_receive: HTTP/1.0 200 OK
  71. Connection: Close
  72. Content-Length: 483
  73. Content-Type: text/xml;charset=utf-8
  74. Client-Date: Mon, 18 May 2009 13:46:03 GMT
  75. Client-Peer: 139.54.50.110:6055
  76. Client-Response-Num: 1
  77. Set-Cookie: ssnid=608VHK+hloKXk7KOxJLtI5+9F|Jh0U-6055110; path=/;
  78.  
  79. <?xml version="1.0" encoding="UTF-8"?>
  80. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  81. <SOAP-ENV:Body>
  82. <namesp1:ReturnCode xmlns:namesp1="http://www.alu.com/webservices/asi/WSSparePartProcessforeSpare">
  83.   <Number>2</Number>
  84. </namesp1:ReturnCode></SOAP-ENV:Body>
  85. </SOAP-ENV:Envelope>
  86.  
Script:
Expand|Select|Wrap|Line Numbers
  1. foreach $rank_temp (@temp_arr){
  2.  
  3.         ......Queries for rank to get corresponding records......
  4.  
  5.         ......Loop for each record......
  6.         foreach  (keys %eSpares_entries){
  7.  
  8.             $service = SOAP::Lite->uri($wsdl_path)
  9.                           ->proxy($proxy_path)
  10.                          ->encoding('iso-8859-1');
  11.  
  12.  
  13.             ......Get required data to be sent through EAI......
  14.  
  15.  
  16.              foreach $prd_id (keys %prd_entries){
  17.  
  18.                 $lineitem++;
  19.                 $lineitem_data = SOAP::Data->name('LineItem'            => \SOAP::Data->value(SOAP::Data
  20.                                        ->name('PartTrackingNumber'  => $prd_entries{$prdid}->{$prd_field_values{'Supplier Service Order'}}), SOAP::Data
  21.                                        ->name('ItemLineNumber'        => $lineitem), SOAP::Data
  22.                                        ->name('MaterialCode'        => '3AL01001PP'), SOAP::Data
  23.                                        ->name('SwapAllowed'            => $swap_allowed), SOAP::Data
  24.                                        ->name('ScrapAllowed'        => $scrap_allowed), SOAP::Data
  25.                                        ->name('ReturnWarrantyFlag'    => $prd_entries{$prdid}->{$prd_field_values{'Return Warranty Flag'}}), SOAP::Data
  26.                                        ->name('WBSNumber'            => $sae_entries{$sae_id}->{$wbs_field_name}), SOAP::Data
  27.                                        ->name('InventoryAccount'    => $prd_entries{$prdid}->{$prd_field_values{'Inventory Account'}}), SOAP::Data
  28.                                        ->name('ProblemSummary'        => $prd_entries{$prdid}->{$prd_field_values{'Problem Description'}}), SOAP::Data
  29.                                        ->name('SWRelease'            => $prd_entries{$prdid}->{$prd_field_values{'Additional Info'}})));
  30.  
  31.                 push (@lineitem_arr, $lineitem_data);
  32.             }
  33.  
  34.  
  35.                  $header_data =    SOAP::Data->name('eSparesMessage'                => \SOAP::Data->value(SOAP::Data 
  36.                                           ->name('Header'                        => \SOAP::Data->value(SOAP::Data
  37.                                           ->name('Basic'                        => \SOAP::Data->value(SOAP::Data
  38.                                           ->name('ServiceType'                    => $supp_serv_ord_type), SOAP::Data
  39.                                           ->name('DirectShipmentIndicator'        => 'Y'), SOAP::Data
  40.                                           ->name('OperationalFlowIndicator'     => 'C'), SOAP::Data
  41.                                           ->name('CustomerRequestedDate'        => $cust_req_date), SOAP::Data
  42.                                           ->name('IncotermsType'                => 'DDP'), SOAP::Data
  43.                                           ->name('IncotermsCity'                => $inc_city), SOAP::Data
  44.                                           ->name('PaymentTerm'                    => $pay_term), SOAP::Data
  45.                                           ->name('B2BAgreementNumber'            => $b2b_agreement), SOAP::Data
  46.                                           ->name('ServiceSLA'                    => $service_sla), SOAP::Data
  47.                                           ->name('ReplenishmentFlag'            => $rep_flag), SOAP::Data
  48.                                           ->name('RMANumber'                    => $rma_number), SOAP::Data
  49.                                           ->name('CustomerReference'            => $customer_reference), SOAP::Data
  50.                                           ->name('DeliveryTimeLine'                => $delivery_time_line),SOAP::Data
  51.                                           ->name('DirectShipmentIndicator' => 'Y'))
  52.                                             ), SOAP::Data
  53.                                           ->name('lines'                        => @lineitem_arr)))); 
  54.  
  55.             ..... Send data to EAI......
  56.             $result = $service[$y]->MyService($header_data);
  57.  
  58.             }
  59.  
May 19 '09 #1
0 2201

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Blaine Everingham | last post by:
Hello, I have installed SOAP::Lite 0.60 and am running a simple test to see the XML output. I noticed that the output indicated it's using the www.w3.org/1999/XMLSchema instead of the prefered...
0
by: Rushikesh Joshi | last post by:
I have really no any idea how can i trace the error that are generated at runtime. Like invalide arguments, error in type conversion, user already registered, user deactive.. This fault strings...
0
by: fliversen | last post by:
Hello, I want to use my scripts on my site with webservices. So, with the book 'Programming Web Services with SOAP' I make tests with Server: SOAP::Lite 'myhibye.cgi'...
3
by: Ben Crinion | last post by:
Hi im having a few problems consuming a SOAP::Lite web service. I think the problem is actually with the WSDL but im not sure. I have a SOAP::Lite client which works ok using the WSDL (which i...
6
by: Vinit | last post by:
Hi I am passing an arraylist to a c#/.net webmethod from a perl client using soap:lite. The trace shows the elements in the xml request. The arraylist input in the webmethod however does not...
0
by: kim123 | last post by:
I got to write a c# client will ask a SOAP::Lite server for a list of data. In the request I have to send the following attributes: string, string, array, string, string The SOAP:Lite server is...
2
by: furrypop | last post by:
Hi, I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also...
1
by: parimalb | last post by:
Hi All, I want to pass an array argument to the java webservice from perl client using SOAP::LITE package. Please let me know if anyone knows about this. The web method declaration in java is...
0
by: cbeels | last post by:
The client code is #install SOAP-Lite and MIME-tools packages use SOAP::Lite 'trace', 'debug'; #override version SOAP::Lite->soapversion('1.2'); #override credentials sub...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.