Mie Jul 02, 2008 6:39 am
|
 |
chuscazo
Perlero Nuevo

|
Registrado: 25 Jun 2008
Mensajes: 7
|
|
| Web Service que recibe un xml |
|
|
Hola a todos,
Tengo que hacer uso de un servicio web que solo recibe un dato; este dato está definido en el WSDL como string y tiene formato xml.
El problema es que a pesar de haber repasado el guión xml a pasar y los datos con la persona que lleva el server siempre me retorna el mismo error.
Este es más o menos el error que me sale con el Data::Dumper y CGI::Carp qw(carpout):
| Código: |
er</faultcode><faultstring>Exception during processing: javax.xml.soap.SOAPException: Found SOAPElement [ ..... ]
But was not able to find a Part that is registered with this Message which corresponds to this SOAPElement. The name of the element should be one of these[string]
at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:47
8)
at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHa
ndler.java:93)
at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainI
mpl.java:143)
at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.ja
va:535)
at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204)
at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:176)
at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:96)
at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManag
er.java:100)
at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke
(WebServiceServlet.java:297)
at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.jav
a:485)
at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServic
eServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6718)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3764)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178) |
El caso es que en el string que el debug me muestra, los tag '<' están ya convertidos a <.
| Código: |
SOAP::Transport::HTTP::Client::send_receive: POST https://mi_url?wsdl
Accept: text/xml
Accept: multipart/*
Content-Length: 917
Content-Type: text/xml; charset=utf-8
SOAPAction: "https://mi_url/ws#mi_metodo"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body><namesp1:miMetodo xmlns:namesp1="https://Mi_url/ws">
<c-gensym3 xsi:type="xsd:string">
<message id='prueba OTP' ts='0'>
<head>
<type ref='sms'> |
¿Creéis que puede ser por esa conversión?
¿Sabéis por qué y cómo solucionarlo?
Muchas gracias aunque sea por leer e intentar comprender esta duda. Saludos. |
|
|
|

Vie Jul 04, 2008 1:23 am
|
 |
chuscazo
Perlero Nuevo

|
Registrado: 25 Jun 2008
Mensajes: 7
|
|
|
|
|
Parece que está relacionado con la cabecera gensym3 que no sé de dónde aparece y que serializa mi texto.
Creo que lo tengo que hacer es usar el SOAP::Data. Voy a probar, pero el xml es muy largo para construirlo. ¿Me podéis pasar algún ejemplo de uso complicado de SOAP::Data? |
|

Vie Jul 04, 2008 2:04 am
|
 |
explorer
Moderador

|
Registrado: 24 Jul 2005
Mensajes: 4018
Ubicación: Valladolid, España
|
|
|
|
|
| Código: |
From tom at eborcom.com Tue Jun 5 03:15:08 2007
From: tom at eborcom.com (Tom Hukins)
Date: Tue, 5 Jun 2007 11:15:08 +0100
Subject: Problem with SOAP::Lite and Escaping Characters
Message-ID: <20070605101508.GA35903@eborcom.com>
I'm fairly new to SOAP and have encountered a problem with characters
that need escaping in XML.
I've tracked down the problem to this code:
foreach my $key (keys %in) {
push @elems, SOAP::Data->name($key => $in{$key})
->type($type{$key});
}
%in contains key/value pairs that I want to serialise in the request
and %type contains a set of mappings for data types associated with
each key.
Everything works wonderfully until I pass in something with a value
containing an '&'. SOAP::Lite doesn't escape this, and it seems not
to escape other special characters such as '<'. If I replace these
with escaped versions, such as '&' and '<', everything works.
I could manually process the keys in %in, but I wondered if I can get
SOAP::Lite to do this for me. Or have I missed a better approach?
Tom
From tom at eborcom.com Tue Jun 5 04:17:35 2007
From: tom at eborcom.com (Tom Hukins)
Date: Tue, 5 Jun 2007 12:17:35 +0100
Subject: Problem with SOAP::Lite and Escaping Characters
In-Reply-To: <20070605101508.GA35903@eborcom.com>
References: <20070605101508.GA35903@eborcom.com>
Message-ID: <20070605111735.GA37744@eborcom.com>
So it's bad form to reply to my own question, but I figured out my
mistake:
On Tue, Jun 05, 2007 at 11:15:08AM +0100, Tom Hukins wrote:
> push @elems, SOAP::Data->name($key => $in{$key})
> ->type($type{$key});
Replacing
$in{$key}
with
SOAP::Data->value($in{$key})
does the cleverness I was after.
I blame the caffeine.
Tom |
|
|

Powered by phpBB © 2001, 2005 phpBB Group
|