473,573 Members | 2,822 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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 2228

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

Similar topics

0
2676
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 www.w3.org/2001/XMLSchema unfortunatley I can not seem to findout how to easily change this to be the 2001. Can someone help me? Below is an...
0
2858
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 are generated by server but i m unable to trake it using SOAP::Lite I have tried to... use SOAP::Lite +trace => 'debug';
0
1959
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
3042
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 defined by hand). The .NET client on the other hand does not work at all and i get this error when i send the request. Failed to access class...
6
2792
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 contain any values and is empty. It works fine with arrays....but NOT arraylists....does anyone know WHY? and HOW TO SOLVE THIS ISSUE? Regards,
0
2463
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 on a UNIX box and there is no wsdl file for me to use. My c# code looks like this: class TestApp {
2
6751
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 definitely getting a hit when I use a browser to get to my hibye.cgi server (well, a blank page rather than a 404). However, when I run my hibye.pl...
1
8272
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 like this publishSimpleMetric(Arraylist<String> appinfo,Arraylist<String> metricinfo,String seperator); Now i tried to call the web service from...
0
3292
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 SOAP::Transport::HTTP::Client::get_basic_credentials {
0
7781
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7699
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8202
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8066
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5292
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3733
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2216
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1304
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1041
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.