• Publicidad

Fallo al usar SOAP en Perl

¿Ya sabes lo que es una referencia? Has progresado, el nível básico es cosa del pasado y ahora estás listo para el siguiente nivel.

Fallo al usar SOAP en Perl

Notapor torrm17 » 2013-01-14 20:47 @908

Buenas tardes.

Me gustaría que me ayudaras con un tema de SOAP con Perl.

Fíjate que tengo que enviar un xml hacia un servidor web usando SOAP. Este script, al enviar la información debe de abrir un reporte de falla en el servidor.

Ya tengo todo, y al ejecutarlo me aparece un error.

Este es mi script.
Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. ###################################### SCRIPT
  2. #!/usr/bin/perl -w
  3.  
  4. use SOAP::Lite +trace=> 'debug';
  5.  
  6. my $message="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sch=\"http://www.tibco.com/schemas/Inventory_root/SharedResources/Schema.xsd2\" xmlns:amd=\"amdXml\"><soapenv:Header/><soapenv:Body><sch:IncidentInput><sch:serviceClasification/><sch:Impact>2000</sch:Impact><sch:urgency>1000</sch:urgency><sch:eventType>1</sch:eventType><sch:Status>1</sch:Status><sch:sourceReported>17000</sch:sourceReported><sch:useServiceType>true</sch:useServiceType><sch:user>GIATUSER</sch:user><sch:password>GIATUSER</sch:password><sch:hasChilds>true</sch:hasChilds><sch:CI><sch:CILevel1>Requerimiento</sch:CILevel1><sch:CILevel2>Requerimiento</sch:CILevel2><sch:CILevel3>Validar Red y Enlaces.</sch:CILevel3></sch:CI><sch:CP><sch:CPLevel1>Servicios</sch:CPLevel1><sch:CPLevel2>Servicios de la red</sch:CPLevel2><sch:CPLevel3>RED VPN</sch:CPLevel3></sch:CP><sch:repeatCustomer>true</sch:repeatCustomer><sch:posibleProblem>true</sch:posibleProblem><sch:informationType>5000</sch:informationType><sch:contactInfo><sch:contactId>9cfbbb4d</sch:contactId><sch:contactName>Stephany</sch:contactName><sch:lastName>Bernabe</sch:lastName><sch:maidenName>Rojas</sch:maidenName><sch:ocuppation>Administrador</sch:ocuppation><sch:contactType>Principal</sch:contactType><sch:contactRol>Facilitador</sch:contactRol><sch:phone>9299</sch:phone><sch:mobile>9484</sch:mobile><sch:officeTime>4pm-9pm</sch:officeTime><sch:mobileTime>4am-4pm</sch:mobileTime><sch:redPhone>53354</sch:redPhone><sch:timeScaling>09 horas</sch:timeScaling><sch:Comments>Ninguno</sch:Comments><sch:email>sb\@alestra.com.mx</sch:email></sch:contactInfo><sch:serviceAccountInfo><sch:serviceAccountId>8d3d30a5</sch:serviceAccountId><sch:serviceAccountNumber>3786</sch:serviceAccountNumber><sch:serviceAccount/><sch:customerType>Platino premier</sch:customerType><sch:customerCategory>Premier Plus</sch:customerCategory><sch:city>Durango</sch:city><sch:street>Esmeralda</sch:street><sch:number>302257</sch:number><sch:state>Angostura</sch:state><sch:country>Dinamarca</sch:country><sch:zipCode>995</sch:zipCode><sch:sensitiveCustomer>true</sch:sensitiveCustomer><sch:importantSite>true</sch:importantSite><sch:eCustomer>true</sch:eCustomer><sch:razonSocial>COSTOS EMPRESARIALES</sch:razonSocial><sch:serviceAccountGroup>DESARROLLO</sch:serviceAccountGroup></sch:serviceAccountInfo><sch:ServiceInstance><sch:serviceKey>1-10I2GS0</sch:serviceKey><sch:serviceInstance>DENL-305394</sch:serviceInstance><sch:instanceType>Enlace</sch:instanceType><sch:businessPlan>Bien</sch:businessPlan><sch:activationDate>2012-04-18T18:46:12Z</sch:activationDate><sch:serviceStatus>Activado</sch:serviceStatus><sch:offer>Extra</sch:offer><sch:managedService>true</sch:managedService></sch:ServiceInstance><sch:Equipment><sch:equipment>Base 594929</sch:equipment><sch:Port>64</sch:Port><sch:supplierId>ID-3a6b0dd0</sch:supplierId><sch:workDetail>9004</sch:workDetail></sch:Equipment></sch:IncidentInput></soapenv:Body></soapenv:Envelope>";
  7.  
  8. my $client = SOAP::Lite->new();
  9. $client=$client->service('http://tibuat01:11266/ServicesIncidentService.serviceagent?wsdl');
  10. $result=$client->generateIncident($message);
  11. print "$result\n";
  12. ###################################### SCRIPT
Coloreado en 0.002 segundos, usando GeSHi 1.0.8.4


Y este es el resultado que me sale al momento de ejecutar el script.

Sintáxis: [ Descargar ] [ Ocultar ]
Using text Syntax Highlighting
###################################### RESULTADO
user@home# ./soap7.pl
SOAP::Transport::HTTP::Client::send_receive: POST http://tibuat01:11266/Services/IncidentService.serviceagent/IncidentsEndpoint1 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 4639
Content-Type: text/xml; charset=utf-8
SOAPAction: "/Services/IncidentService.serviceagent/IncidentsEndpoint1/generateIncident"

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:ns3="amdXml" xmlns:ns1="http://www.tibco.com/schemas/Inventory_root_root/SharedResources/Schema.xsd" xmlns:ns2="http://www.tibco.com/schemas/Inventory_root/SharedResources/Schema.xsd" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://www.tibco.com/schemas/Inventory_root/SharedResources/Schema.xsd2" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xmlns.example.com/1335219893681"><soap:Body><tns:generateIncident><incidentID xsi:type="xs:string">&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.tibco.com/schemas/Inventory_root/SharedResources/Schema.xsd2" xmlns:amd="amdXml"&gt;&lt;soapenv:Header/&gt;&lt;soapenv:Body&gt;&lt;sch:IncidentInput&gt;&lt;sch:serviceClasification/&gt;&lt;sch:Impact&gt;2000&lt;/sch:Impact&gt;&lt;sch:urgency&gt;1000&lt;/sch:urgency&gt;&lt;sch:eventType&gt;1&lt;/sch:eventType&gt;&lt;sch:Status&gt;1&lt;/sch:Status&gt;&lt;sch:sourceReported&gt;17000&lt;/sch:sourceReported&gt;&lt;sch:useServiceType&gt;true&lt;/sch:useServiceType&gt;&lt;sch:user&gt;GIATUSER&lt;/sch:user&gt;&lt;sch:password&gt;GIATUSER&lt;/sch:password&gt;&lt;sch:hasChilds&gt;true&lt;/sch:hasChilds&gt;&lt;sch:CI&gt;&lt;sch:CILevel1&gt;Requerimiento&lt;/sch:CILevel1&gt;&lt;sch:CILevel2&gt;Requerimiento&lt;/sch:CILevel2&gt;&lt;sch:CILevel3&gt;Validar Red y Enlaces.&lt;/sch:CILevel3&gt;&lt;/sch:CI&gt;&lt;sch:CP&gt;&lt;sch:CPLevel1&gt;Servicios&lt;/sch:CPLevel1&gt;&lt;sch:CPLevel2&gt;Servicios de la red&lt;/sch:CPLevel2&gt;&lt;sch:CPLevel3&gt;RED VPN&lt;/sch:CPLevel3&gt;&lt;/sch:CP&gt;&lt;sch:repeatCustomer&gt;true&lt;/sch:repeatCustomer&gt;&lt;sch:posibleProblem&gt;true&lt;/sch:posibleProblem&gt;&lt;sch:informationType&gt;5000&lt;/sch:informationType&gt;&lt;sch:contactInfo&gt;&lt;sch:contactId&gt;9cfbbb4d&lt;/sch:contactId&gt;&lt;sch:contactName&gt;Stephany&lt;/sch:contactName&gt;&lt;sch:lastName&gt;Bernabe&lt;/sch:lastName&gt;&lt;sch:maidenName&gt;Rojas&lt;/sch:maidenName&gt;&lt;sch:ocuppation&gt;Administrador&lt;/sch:ocuppation&gt;&lt;sch:contactType&gt;Principal&lt;/sch:contactType&gt;&lt;sch:contactRol&gt;Facilitador&lt;/sch:contactRol&gt;&lt;sch:phone&gt;9299&lt;/sch:phone&gt;&lt;sch:mobile&gt;9484&lt;/sch:mobile&gt;&lt;sch:officeTime&gt;4pm-9pm&lt;/sch:officeTime&gt;&lt;sch:mobileTime&gt;4am-4pm&lt;/sch:mobileTime&gt;&lt;sch:redPhone&gt;53354&lt;/sch:redPhone&gt;&lt;sch:timeScaling&gt;09 horas&lt;/sch:timeScaling&gt;&lt;sch:Comments&gt;Ninguno&lt;/sch:Comments&gt;&lt;sch:email&gt;[email protected]&lt;/sch:email&gt;&lt;/sch:contactInfo&gt;&lt;sch:serviceAccountInfo&gt;&lt;sch:serviceAccountId&gt;8d3d30a5&lt;/sch:serviceAccountId&gt;&lt;sch:serviceAccountNumber&gt;3786&lt;/sch:serviceAccountNumber&gt;&lt;sch:serviceAccount/&gt;&lt;sch:customerType&gt;Platino premier&lt;/sch:customerType&gt;&lt;sch:customerCategory&gt;Premier Plus&lt;/sch:customerCategory&gt;&lt;sch:city&gt;Durango&lt;/sch:city&gt;&lt;sch:street&gt;Esmeralda&lt;/sch:street&gt;&lt;sch:number&gt;302257&lt;/sch:number&gt;&lt;sch:state&gt;Angostura&lt;/sch:state&gt;&lt;sch:country&gt;Dinamarca&lt;/sch:country&gt;&lt;sch:zipCode&gt;995&lt;/sch:zipCode&gt;&lt;sch:sensitiveCustomer&gt;true&lt;/sch:sensitiveCustomer&gt;&lt;sch:importantSite&gt;true&lt;/sch:importantSite&gt;&lt;sch:eCustomer&gt;true&lt;/sch:eCustomer&gt;&lt;sch:razonSocial&gt;COSTOS EMPRESARIALES&lt;/sch:razonSocial&gt;&lt;sch:serviceAccountGroup&gt;DESARROLLO&lt;/sch:serviceAccountGroup&gt;&lt;/sch:serviceAccountInfo&gt;&lt;sch:ServiceInstance&gt;&lt;sch:serviceKey&gt;1-10I2GS0&lt;/sch:serviceKey&gt;&lt;sch:serviceInstance&gt;DENL-305394&lt;/sch:serviceInstance&gt;&lt;sch:instanceType&gt;Enlace&lt;/sch:instanceType&gt;&lt;sch:businessPlan&gt;Bien&lt;/sch:businessPlan&gt;&lt;sch:activationDate&gt;2012-04-18T18:46:12Z&lt;/sch:activationDate&gt;&lt;sch:serviceStatus&gt;Activado&lt;/sch:serviceStatus&gt;&lt;sch:offer&gt;Extra&lt;/sch:offer&gt;&lt;sch:managedService&gt;true&lt;/sch:managedService&gt;&lt;/sch:ServiceInstance&gt;&lt;sch:Equipment&gt;&lt;sch:equipment&gt;Base 594929&lt;/sch:equipment&gt;&lt;sch:Port&gt;64&lt;/sch:Port&gt;&lt;sch:supplierId&gt;ID-3a6b0dd0&lt;/sch:supplierId&gt;&lt;sch:workDetail&gt;9004&lt;/sch:workDetail&gt;&lt;/sch:Equipment&gt;&lt;/sch:IncidentInput&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;</incidentID></tns:generateIncident></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Connection: close
Date: Tue, 15 Jan 2013 01:41:48 GMT
Server: Apache-Coyote/1.1
Content-Length: 357
Content-Type: text/xml;charset=utf-8
Client-Date: Tue, 15 Jan 2013 01:40:27 GMT
Client-Peer: 10.1.50.85:11266
Client-Response-Num: 1

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xmlns="">SOAP-ENV:Server.InternalServerError</faultcode><faultstring xmlns="">[Ljava.lang.String; cannot be cast to java.lang.String</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
###################################### RESULTADO
Coloreado en 0.001 segundos, usando GeSHi 1.0.8.4


¿Qué crees que pueda ser?

Ahora tengo otro script en el cual uso lo siguiente.

Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. ###################################### script 2
  2. #!/usr/bin/perl -w
  3.  
  4. use LWP::UserAgent;
  5. use HTTP::Request;
  6.  
  7. my $message="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sch=\"http://www.tibco.com/schemas/Inventory_root/SharedResources/Schema.xsd2\" xmlns:amd=\"amdXml\"><soapenv:Header/><soapenv:Body><sch:IncidentInput><sch:serviceClasification/><sch:Impact>2000</sch:Impact><sch:urgency>1000</sch:urgency><sch:eventType>1</sch:eventType><sch:Status>1</sch:Status><sch:sourceReported>17000</sch:sourceReported><sch:useServiceType>true</sch:useServiceType><sch:user>GIATUSER</sch:user><sch:password>GIATUSER</sch:password><sch:hasChilds>true</sch:hasChilds><sch:CI><sch:CILevel1>Requerimiento</sch:CILevel1><sch:CILevel2>Requerimiento</sch:CILevel2><sch:CILevel3>Validar Red y Enlaces.</sch:CILevel3></sch:CI><sch:CP><sch:CPLevel1>Servicios</sch:CPLevel1><sch:CPLevel2>Servicios de la red</sch:CPLevel2><sch:CPLevel3>RED VPN</sch:CPLevel3></sch:CP><sch:repeatCustomer>true</sch:repeatCustomer><sch:posibleProblem>true</sch:posibleProblem><sch:informationType>5000</sch:informationType><sch:contactInfo><sch:contactId>9cfbbb4d</sch:contactId><sch:contactName>Stephany</sch:contactName><sch:lastName>Bernabe</sch:lastName><sch:maidenName>Rojas</sch:maidenName><sch:ocuppation>Administrador</sch:ocuppation><sch:contactType>Principal</sch:contactType><sch:contactRol>Facilitador</sch:contactRol><sch:phone>9299</sch:phone><sch:mobile>9484</sch:mobile><sch:officeTime>4pm-9pm</sch:officeTime><sch:mobileTime>4am-4pm</sch:mobileTime><sch:redPhone>53354</sch:redPhone><sch:timeScaling>09 horas</sch:timeScaling><sch:Comments>Ninguno</sch:Comments><sch:email>sb\@alestra.com.mx</sch:email></sch:contactInfo><sch:serviceAccountInfo><sch:serviceAccountId>8d3d30a5</sch:serviceAccountId><sch:serviceAccountNumber>3786</sch:serviceAccountNumber><sch:serviceAccount/><sch:customerType>Platino premier</sch:customerType><sch:customerCategory>Premier Plus</sch:customerCategory><sch:city>Durango</sch:city><sch:street>Esmeralda</sch:street><sch:number>302257</sch:number><sch:state>Angostura</sch:state><sch:country>Dinamarca</sch:country><sch:zipCode>995</sch:zipCode><sch:sensitiveCustomer>true</sch:sensitiveCustomer><sch:importantSite>true</sch:importantSite><sch:eCustomer>true</sch:eCustomer><sch:razonSocial>COSTOS EMPRESARIALES</sch:razonSocial><sch:serviceAccountGroup>DESARROLLO</sch:serviceAccountGroup></sch:serviceAccountInfo><sch:ServiceInstance><sch:serviceKey>1-10I2GS0</sch:serviceKey><sch:serviceInstance>DENL-305394</sch:serviceInstance><sch:instanceType>Enlace</sch:instanceType><sch:businessPlan>Bien</sch:businessPlan><sch:activationDate>2012-04-18T18:46:12Z</sch:activationDate><sch:serviceStatus>Activado</sch:serviceStatus><sch:offer>Extra</sch:offer><sch:managedService>true</sch:managedService></sch:ServiceInstance><sch:Equipment><sch:equipment>Base 594929</sch:equipment><sch:Port>64</sch:Port><sch:supplierId>ID-3a6b0dd0</sch:supplierId><sch:workDetail>9004</sch:workDetail></sch:Equipment></sch:IncidentInput></soapenv:Body></soapenv:Envelope>";
  8.  
  9. my $userAgent = LWP::UserAgent->new();
  10. my $request = HTTP::Request->new(POST => 'http://tibuat01:11266/Services/IncidentService.serviceagent?wsdl');
  11. $request->header(SOAPAction => '"http://tibuat01:11266/Services/IncidentService.serviceagent"');
  12. $request->content($message);
  13. $request->content_type("text/xml; charset=utf-8");
  14. my $response = $userAgent->request($request);
  15.  
  16. my %resultado = %{$response};
  17.  
  18. while (( $campo, $valor) = each(%resultado )){
  19.        print "CAMPO : $campo - $valor\n";
  20. }
  21. ###################################### script 2
Coloreado en 0.001 segundos, usando GeSHi 1.0.8.4


Y este no me marca error, pero no crea el reporte en el servidor web final

Sintáxis: [ Descargar ] [ Ocultar ]
Using text Syntax Highlighting
###################################### este es el resultado del secript 2
root@sao-app-db-01:/var/www/cgi-bin/soap# ./soap.pl
CAMPO : _content - <?xml version="1.0" encoding="UTF-8"?>
<!--Created by TIBCO WSDL-->
<wsdl:definitions xmlns:ns2="http://www.tibco.com/schemas/Inventory_root/SharedResources/Schema.xsd" xmlns:ns1="http://www.tibco.com/schemas/Inventory_root_root/SharedResources/Schema.xsd" xmlns:ns3="amdXml" xmlns:tns="http://xmlns.example.com/1335219893681" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns0="http://www.tibco.com/schemas/Inventory_root/SharedResources/Schema.xsd2" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="Untitled" targetNamespace="http://xmlns.example.com/1335219893681">
    <wsdl:types>
.......... amiti aqui la salida, por que es muy grande, pero al final aparece
</wsdl:definitions>
CAMPO : _protocol - HTTP/1.1
CAMPO : _headers - HTTP::Headers=HASH(0x1a6af18)
CAMPO : _rc - 200
CAMPO : _msg - OK
CAMPO : _request - HTTP::Request=HASH(0x182e880)
###################################### este es el resultado del secript 2
Coloreado en 0.000 segundos, usando GeSHi 1.0.8.4


¿Por qué con el primer script marca error y con el segundo no marca error pero no crea el reporte? Es como si no enviara la informacion.

Gracias por tu ayuda.

Saludos
Marco
torrm17
Perlero nuevo
Perlero nuevo
 
Mensajes: 2
Registrado: 2013-01-14 20:32 @897

Publicidad

Re: Fallo al usar SOAP en Perl

Notapor explorer » 2013-01-16 13:08 @589

Bienvenido a los foros de Perl en Español, Marco.

El mensaje de error es:

<faultstring xmlns="">[Ljava.lang.String; cannot be cast to java.lang.String</faultstring>

Lo que me llama la atención es el '[L' que hay al principio, así que, o bien el WSDL está mal, o hay alguna cadena de texto que se envía mal, en la petición.

Con respecto al segundo caso, sí que da la sensación de que no se ha enviado nada, porque debería aparecer alguna respuesta.

Mejor que

my %resultado = %{$response};

usa

print $response->_as_string();

o

print $response->content();

o

print $response->decoded_content();

Tienes más detalles en lwpcook, HTTP::Request y HTTP::Response.
JF^D Perl programming & Raku programming. Grupo en Telegram: https://t.me/Perl_ES
Avatar de Usuario
explorer
Administrador
Administrador
 
Mensajes: 14477
Registrado: 2005-07-24 18:12 @800
Ubicación: Valladolid, España

Re: Fallo al usar SOAP en Perl

Notapor torrm17 » 2013-01-16 18:47 @824

Muy amable en contestar. Seguí tu recomendación y agregué print $response->content(); y en la línea donde está la liga con ?wsdl le quité esta parte, ejecuté el script y ya me envío información distinta.

Me comentaron que debo de utilizar generateIncident para que se pueda crear el reporte, pero no sé cómo utilizar esta, no sé cómo llamarle, si función, recurso o qué sera.

¿Dónde debería agregar generateIncident?

Sintáxis: [ Descargar ] [ Ocultar ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <serviceResource xmlns:ns2="http://xmlns.tibco.com/encodings/mime" xmlns:ns1="http://www.tibco.com/schemas/Inventory_root/SharedResources/Schema.xsd2" xmlns:ns="http://xmlns.tibco.com/soap/context" xmlns:ns3="http://www.tibco.com/schemas/Inventory_root_root/SharedResources/Schema.xsd" xmlns:wsdl="http://www.alestra.com/tibco/AutomaticIncidentService">
  3.     <ns0:import xmlns:ns0="http://schemas.xmlsoap.org/wsdl/" namespace="http://www.alestra.com/tibco/AutomaticIncidentService" location="/SharedResources/AutomaticIncidentService.wsdl"/>
  4.     <config>
  5.         <wsdl namespace="http://xmlns.example.com/1335219893681" embedWsdlComponents="true" embedSchemaComponents="true" embedJndiProperties="false"/>
  6.         <class>com.tibco.bw.service.serviceAgent.ServiceServiceAgent</class>
  7.         <implType>bw</implType>
  8.         <groups>
  9.             <row isDefault="true" groupName="Default"/>
  10.         </groups>
  11.         <serviceChange>Tue Nov 27 10:21:13 CST 2012</serviceChange>
  12.         <name>IncidentService</name>
  13.         <resourceType>service.definition</resourceType>
  14.         <interfaceImpl>
  15.             <tab>
  16.                 <tabName>Incidents</tabName>
  17.                 <tabType>bw</tabType>
  18.                 <config>
  19.                     <wsdlDetail location="/SharedResources/AutomaticIncidentService.wsdl" portType="Incidents" ns="http://www.alestra.com/tibco/AutomaticIncidentService"/>
  20.                     <detail>
  21.                         <tab>
  22.                             <tabName>service.definition.impl.tab.label</tabName>
  23.                             <tabType>impl</tabType>
  24.                             <config>
  25.                                 <operations>
  26.                                     <row opName="generateIncident" opImpl="/ProcessDefinitions/StarterProcesses/RMYAutomaticIncident.process"/>
  27.                                     <row opName="getInfoAmdocs" opImpl="/ProcessDefinitions/StarterProcesses/AMDConsultInfo.process"/>
  28.                                 </operations>
  29.                             </config>
  30.                         </tab>
  31.                         <tab>
  32.                             <tabName>service.definition.ep.tab.label</tabName>
  33.                             <tabType>ep</tabType>
  34.                             <config>
  35.                                 <epBindings>
  36.                                     <row epName="IncidentsEndpoint1" epType="soap">
  37.                                         <config>
  38.                                             <epDetail>
  39.                                                 <tab>
  40.                                                     <tabName>soap.service.transport.ui.transport.tab.label</tabName>
  41.                                                     <tabType>transport</tabType>
  42.                                                     <config>
  43.                                                         <sharedChannel>/SharedConfigurations/TIBHttpConnection.sharedhttp</sharedChannel>
  44.                                                         <transport>
  45.                                                             <config>
  46.                                                                 <useBasicAuthentication>false</useBasicAuthentication>
  47.                                                                 <httpURI>/Services/IncidentService.serviceagent/IncidentsEndpoint1</httpURI>
  48.                                                             </config>
  49.                                                         </transport>
  50.                                                     </config>
  51.                                                 </tab>
  52.                                                 <tab>
  53.                                                     <tabName>soap.service.transport.ui.details.tab.label</tabName>
  54.                                                     <tabType>details</tabType>
  55.                                                     <config>
  56.                                                         <operationStyle>document</operationStyle>
  57.                                                         <soapVersion>SOAP 1.1</soapVersion>
  58.                                                         <soap>
  59.                                                             <operation name="generateIncident">
  60.                                                                 <general>
  61.                                                                     <config>
  62.                                                                         <soapAction>/Services/IncidentService.serviceagent/IncidentsEndpoint1/generateIncident</soapAction>
  63.                                                                         <operationStyle>document</operationStyle>
  64.                                                                         <soapUse>literal</soapUse>
  65.                                                                         <inputNamespace/>
  66.                                                                         <outputNamespace/>
  67.                                                                         <faultNamespace/>
  68.                                                                         <portAddressPrefix/>
  69.                                                                     </config>
  70.                                                                 </general>
  71.                                                                 <advanced>
  72.                                                                     <config>
  73.                                                                         <opDetail>
  74.                                                                             <tab>
  75.                                                                                 <tabName>soap.service.transport.ui.inputAttachments.tab.label</tabName>
  76.                                                                                 <tabType>inputAttachments</tabType>
  77.                                                                                 <config>
  78.                                                                                     <inputAttachmentBindings/>
  79.                                                                                     <writeToFile>false</writeToFile>
  80.                                                                                     <inputPolicy/>
  81.                                                                                 </config>
  82.                                                                             </tab>
  83.                                                                             <tab>
  84.                                                                                 <tabName>soap.service.transport.ui.inputHeaders.tab.label</tabName>
  85.                                                                                 <tabType>inputHeaders</tabType>
  86.                                                                                 <config>
  87.                                                                                     <inputHeadersMessage/>
  88.                                                                                 </config>
  89.                                                                             </tab>
  90.                                                                             <tab>
  91.                                                                                 <tabName>soap.service.transport.ui.outputAttachments.tab.label</tabName>
  92.                                                                                 <tabType>outputAttachments</tabType>
  93.                                                                                 <config>
  94.                                                                                     <soapAttachmentStyle>SwA</soapAttachmentStyle>
  95.                                                                                     <outputAttachmentBindings/>
  96.                                                                                 </config>
  97.                                                                             </tab>
  98.                                                                             <tab>
  99.                                                                                 <tabName>soap.service.transport.ui.outputHeaders.tab.label</tabName>
  100.                                                                                 <tabType>outputHeaders</tabType>
  101.                                                                                 <config>
  102.                                                                                     <outputHeadersMessage/>
  103.                                                                                 </config>
  104.                                                                             </tab>
  105.                                                                             <tab>
  106.                                                                                 <tabName>soap.service.transport.ui.faultHeaders.tab.label</tabName>
  107.                                                                                 <tabType>faultHeaders</tabType>
  108.                                                                                 <config>
  109.                                                                                     <soapFaults>
  110.                                                                                         <faultMessage name="fault1">
  111.                                                                                             <general>
  112.                                                                                                 <config>
  113.                                                                                                     <faultHeadersMessage/>
  114.                                                                                                 </config>
  115.                                                                                             </general>
  116.                                                                                         </faultMessage>
  117.                                                                                     </soapFaults>
  118.                                                                                 </config>
  119.                                                                             </tab>
  120.                                                                             <tab>
  121.                                                                                 <tabName>soap.service.transport.ui.inputContext.tab.label</tabName>
  122.                                                                                 <tabType>inputContext</tabType>
  123.                                                                                 <config>
  124.                                                                                     <context>
  125.                                                                                         <ref>/SharedConfigurations/Context Resource.contextResource</ref>
  126.                                                                                         <exposeSecurityContext>true</exposeSecurityContext>
  127.                                                                                         <bindings>
  128.                                                                                             <RemoteHost>
  129.                                                                                                 <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="$inputMessage/inputMessage/ns:Context/ns:RemoteAddress"/>
  130.                                                                                             </RemoteHost>
  131.                                                                                         </bindings>
  132.                                                                                     </context>
  133.                                                                                 </config>
  134.                                                                             </tab>
  135.                                                                             <tab>
  136.                                                                                 <tabName>soap.service.transport.ui.outputContext.tab.label</tabName>
  137.                                                                                 <tabType>outputContext</tabType>
  138.                                                                                 <config>
  139.                                                                                     <context>
  140.                                                                                         <ref/>
  141.                                                                                     </context>
  142.                                                                                 </config>
  143.                                                                             </tab>
  144.                                                                             <tab>
  145.                                                                                 <tabName>soap.service.transport.ui.faultContext.tab.label</tabName>
  146.                                                                                 <tabType>faultContext</tabType>
  147.                                                                                 <config>
  148.                                                                                     <context>
  149.                                                                                         <ref/>
  150.                                                                                     </context>
  151.                                                                                 </config>
  152.                                                                             </tab>
  153.                                                                         </opDetail>
  154.                                                                     </config>
  155.                                                                 </advanced>
  156.                                                             </operation>
  157.                                                             <operation name="getInfoAmdocs">
  158.                                                                 <general>
  159.                                                                     <config>
  160.                                                                         <soapAction>/Services/IncidentService.serviceagent//getInfoAmdocs</soapAction>
  161.                                                                         <operationStyle/>
  162.                                                                         <soapUse>literal</soapUse>
  163.                                                                         <inputNamespace/>
  164.                                                                         <outputNamespace/>
  165.                                                                         <faultNamespace/>
  166.                                                                         <portAddressPrefix/>
  167.                                                                     </config>
  168.                                                                 </general>
  169.                                                                 <advanced>
  170.                                                                     <config>
  171.                                                                         <opDetail>
  172.                                                                             <tab>
  173.                                                                                 <tabName>soap.service.transport.ui.inputAttachments.tab.label</tabName>
  174.                                                                                 <tabType>inputAttachments</tabType>
  175.                                                                                 <config>
  176.                                                                                     <inputAttachmentBindings/>
  177.                                                                                     <writeToFile>false</writeToFile>
  178.                                                                                     <inputPolicy/>
  179.                                                                                 </config>
  180.                                                                             </tab>
  181.                                                                             <tab>
  182.                                                                                 <tabName>soap.service.transport.ui.inputHeaders.tab.label</tabName>
  183.                                                                                 <tabType>inputHeaders</tabType>
  184.                                                                                 <config>
  185.                                                                                     <inputHeadersMessage/>
  186.                                                                                 </config>
  187.                                                                             </tab>
  188.                                                                             <tab>
  189.                                                                                 <tabName>soap.service.transport.ui.outputAttachments.tab.label</tabName>
  190.                                                                                 <tabType>outputAttachments</tabType>
  191.                                                                                 <config>
  192.                                                                                     <soapAttachmentStyle>SwA</soapAttachmentStyle>
  193.                                                                                     <outputAttachmentBindings/>
  194.                                                                                 </config>
  195.                                                                             </tab>
  196.                                                                             <tab>
  197.                                                                                 <tabName>soap.service.transport.ui.outputHeaders.tab.label</tabName>
  198.                                                                                 <tabType>outputHeaders</tabType>
  199.                                                                                 <config>
  200.                                                                                     <outputHeadersMessage/>
  201.                                                                                 </config>
  202.                                                                             </tab>
  203.                                                                             <tab>
  204.                                                                                 <tabName>soap.service.transport.ui.faultHeaders.tab.label</tabName>
  205.                                                                                 <tabType>faultHeaders</tabType>
  206.                                                                                 <config>
  207.                                                                                     <soapFaults>
  208.                                                                                         <faultMessage name="fault1">
  209.                                                                                             <general>
  210.                                                                                                 <config>
  211.                                                                                                     <faultHeadersMessage/>
  212.                                                                                                 </config>
  213.                                                                                             </general>
  214.                                                                                         </faultMessage>
  215.                                                                                     </soapFaults>
  216.                                                                                 </config>
  217.                                                                             </tab>
  218.                                                                             <tab>
  219.                                                                                 <tabName>soap.service.transport.ui.inputContext.tab.label</tabName>
  220.                                                                                 <tabType>inputContext</tabType>
  221.                                                                                 <config>
  222.                                                                                     <context>
  223.                                                                                         <ref>/SharedConfigurations/Context Resource.contextResource</ref>
  224.                                                                                         <exposeSecurityContext>true</exposeSecurityContext>
  225.                                                                                         <bindings>
  226.                                                                                             <RemoteHost>
  227.                                                                                                 <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="$inputMessage/inputMessage/ns:Context/ns:RemoteAddress"/>
  228.                                                                                             </RemoteHost>
  229.                                                                                         </bindings>
  230.                                                                                     </context>
  231.                                                                                 </config>
  232.                                                                             </tab>
  233.                                                                             <tab>
  234.                                                                                 <tabName>soap.service.transport.ui.outputContext.tab.label</tabName>
  235.                                                                                 <tabType>outputContext</tabType>
  236.                                                                                 <config>
  237.                                                                                     <context>
  238.                                                                                         <ref/>
  239.                                                                                     </context>
  240.                                                                                 </config>
  241.                                                                             </tab>
  242.                                                                             <tab>
  243.                                                                                 <tabName>soap.service.transport.ui.faultContext.tab.label</tabName>
  244.                                                                                 <tabType>faultContext</tabType>
  245.                                                                                 <config>
  246.                                                                                     <context>
  247.                                                                                         <ref/>
  248.                                                                                     </context>
  249.                                                                                 </config>
  250.                                                                             </tab>
  251.                                                                         </opDetail>
  252.                                                                     </config>
  253.                                                                 </advanced>
  254.                                                             </operation>
  255.                                                         </soap>
  256.                                                     </config>
  257.                                                 </tab>
  258.                                             </epDetail>
  259.                                         </config>
  260.                                     </row>
  261.                                 </epBindings>
  262.                             </config>
  263.                         </tab>
  264.                     </detail>
  265.                 </config>
  266.             </tab>
  267.         </interfaceImpl>
  268.     </config>
Coloreado en 0.006 segundos, usando GeSHi 1.0.8.4



Gracias

Saludos
Marco Torres
Última edición por explorer el 2013-01-16 21:31 @938, editado 1 vez en total
Razón: Poner marcas XML al código XML...
torrm17
Perlero nuevo
Perlero nuevo
 
Mensajes: 2
Registrado: 2013-01-14 20:32 @897

Re: Fallo al usar SOAP en Perl

Notapor explorer » 2013-01-16 22:04 @961

Yo no soy ningún experto en SOAP en Perl, pero por estos foros hay algunos hilos en los cuales puedes ver ejemplos de llamadas a servicios, con programas escritos con SOAP::Lite.

Usa el sistema de búsqueda para encontrarlos.

Por ejemplo:


Me temo que vas a tener que poner de nuevo lo del '?wsdl', porque seguramente eso hará que el SOAP::Lite se baje el archivo de definiciones de servicios WSDL desde el servidor, y allí, conocer el nombre de los servicios, y de allí, saber que puede ejecutar un método llamado 'generateIncident'.

Vamos, algo parecido a lo que ya tienes escrito en el primer programa que pusiste en el primer mensaje de este hilo.

De todas maneras, tu tienes metido todo el informe en una única y monstruosa variable, cuando el resto de ejemplos con SOAP::Lite reducen el paso de parámetros con sendas llamadas a SOAP::Data (mira último mensaje de la primera página de Cómo leer un SOAP) No sé, a lo mejor es más cómodo como lo estás haciendo tú. El caso es que el servidor responda :)
JF^D Perl programming & Raku programming. Grupo en Telegram: https://t.me/Perl_ES
Avatar de Usuario
explorer
Administrador
Administrador
 
Mensajes: 14477
Registrado: 2005-07-24 18:12 @800
Ubicación: Valladolid, España


Volver a Intermedio

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 4 invitados

cron