I started working again on a project I started a few years ago (code available here: http://code.google.com/p/mipnp/). It\'s a UPnP mediaserver that can stream media to an x
I had the same problem, found the solution in http://forum.openkm.com/viewtopic.php?f=6&t=12494
The Web service was created in java using simple @WebService and @WebParam annotations.
It seems to be a problem in Apache CXF library from 2.5.1 to 2.6.14. The second solution of Daniel Kulp is the easy way.
In ksoap2 (ksoap2-android-assembly-3.5.0-jar-with-dependencies.jar) library for Android you can use this way:
HttpTransportSE transporte = new HttpTransportSE("http://10.0.2.2:8080/server-ws/actionServerWS?wsdl");
transporte.call("", envelope);
Hope this
I have the same problem long time agos, I tried to add
@EndpointProperty(key="soap.no.validate.parts", value="true")
but that doesn't help, in my case I don't own the web service that i was consuming and the response of that web service doesn't follow the rules of the WSDL, so i ended changing the response with and interceptor like this one:
/*Interceptor class */
public class MyInterceptor extends AbstractPhaseInterceptor {
private static final Logger logger = Logger.getLogger(MyInterceptor.class);
public MyInterceptor() {
super(Phase.RECEIVE);
}
@Override
public void handleMessage(Message message) throws Fault {
logger.info("TCP-InterceptandoMensaje");
message.put(Message.ENCODING, "UTF-8");
InputStream is = message.getContent(InputStream.class);
if(is!=null){
CachedOutputStream bos = new CachedOutputStream();
try{
IOUtils.copy(is, bos);
String soapMessage = new String(bos.getBytes());
logger.info("-------------------------------------------");
logger.info("TCP-SoapMsgRecibido[" + soapMessage +"]");
logger.info("-------------------------------------------");
bos.flush();
message.setContent(InputStream.class, is);
is.close();
InputStream inputStream = new ByteArrayInputStream(removeBody(soapMessage).getBytes());
message.setContent(InputStream.class, inputStream);
bos.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
private String removeBody(String msg) {
StringBuffer soapMsg = new StringBuffer();
if (msg.contains("Reason")) {
if (msg.contains("TarjetaCreditoConsultaDetalle_Req")) {
soapMsg.append(msg.substring(0, msg.indexOf("<NS1:Body>")));
soapMsg.append("<NS1:Body>");
soapMsg.append("<NS2:TarjetaCreditoConsultaDetalle_Resp xmlns:NS2=\"http://www.bi.com.gt/esb/services/TarjetaCredito\">");
soapMsg.append("<InfoTrx>");
soapMsg.append("<IdTrx>000000000000000000000000</IdTrx>");
soapMsg.append("<Canal>000</Canal>");
soapMsg.append("<PaisOperacion>000</PaisOperacion>");
soapMsg.append("<BancoOperacion>0</BancoOperacion>");
soapMsg.append("<PaisDestino>000</PaisDestino>");
soapMsg.append("<BancoDestino>0</BancoDestino>");
soapMsg.append("<FechaTrx>00000000</FechaTrx>");
soapMsg.append("<HoraTrx>000000</HoraTrx>");
soapMsg.append("<IdCliente/>");
soapMsg.append("<CodOpWeb/>");
soapMsg.append("<CodEmpresa/>");
soapMsg.append("<TotPags>000</TotPags>");
soapMsg.append("<CodRetorno>000</CodRetorno>");
soapMsg.append("</InfoTrx>");
soapMsg.append("<Datos>");
soapMsg.append("<Producto>0</Producto>");
soapMsg.append("<NumProducto>0000000000000000</NumProducto>");
soapMsg.append("<NombreCuenta> </NombreCuenta>");
soapMsg.append("<Moneda>USD</Moneda>");
soapMsg.append("<Estado>00000000</Estado>");
soapMsg.append("<SaldoLocal>0.00</SaldoLocal>");
soapMsg.append("<SaldoDispLocal>0.00</SaldoDispLocal>");
soapMsg.append("<SaldoInter>0.00</SaldoInter>");
soapMsg.append("<SaldoDispInter>0.00</SaldoDispInter>");
soapMsg.append("<DirCorrespond> </DirCorrespond>");
soapMsg.append("<FechaCorte>00000000</FechaCorte>");
soapMsg.append("<FechaProxPago>00000000</FechaProxPago>");
soapMsg.append("<SobreGiroAutLocal>0.00</SobreGiroAutLocal>");
soapMsg.append("<SobreGiroAutInter>0.00</SobreGiroAutInter>");
soapMsg.append("<FecUltCambioEstado>00000000</FecUltCambioEstado>");
soapMsg.append("<FecUltMov>00000000</FecUltMov>");
soapMsg.append("<FecUltAbono>00000000</FecUltAbono>");
soapMsg.append("<PagoMinLocal>0.00</PagoMinLocal>");
soapMsg.append("<PagoContLocal>0.00</PagoContLocal>");
soapMsg.append("<PagoMinInter>0.00</PagoMinInter>");
soapMsg.append("<PagoContInter>0.00</PagoContInter>");
soapMsg.append("<LimiteAutLocal>0.00</LimiteAutLocal>");
soapMsg.append("<LimiteAutInter>0.00</LimiteAutInter>");
soapMsg.append("<Seguros>");
soapMsg.append("<SegTCSalva>1</SegTCSalva>");
soapMsg.append("<SegCobInt/>");
soapMsg.append("<SegVida/>");
soapMsg.append("<SegFourSeason/>");
soapMsg.append("</Seguros>");
soapMsg.append("<MontoTrxLocalDeb>0.00</MontoTrxLocalDeb>");
soapMsg.append("<MontoTrxLocalCred>0.00</MontoTrxLocalCred>");
soapMsg.append("<SaldoMaxVenc>0.00</SaldoMaxVenc>");
soapMsg.append("<MontoExtrafAutLocal>0.00</MontoExtrafAutLocal>");
soapMsg.append("<MontoExtrafAutInter>0.00</MontoExtrafAutInter>");
soapMsg.append("<MontoTrxInterDeb>0.00</MontoTrxInterDeb>");
soapMsg.append("<MontoTrxInterCred>0.00</MontoTrxInterCred>");
soapMsg.append("</Datos>");
soapMsg.append("</NS2:TarjetaCreditoConsultaDetalle_Resp>");
soapMsg.append("</NS1:Body>");
soapMsg.append("</NS1:Envelope>");
} else
soapMsg.append(msg);
} else
soapMsg.append(msg);
logger.info("EditedSoapMsg["+soapMsg+"]");
return soapMsg.toString();
}`
My spring-config looks like:
<bean id="tcPaymentServiceInterceptor" class="com.foo.bar.ws.interceptors.TcPaymentServiceInterceptor"/>
<bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus">
<property name="inInterceptors">
<list>
<ref bean="tcPaymentServiceInterceptor"/>
</list>
</property>
</bean>
I hope this help someone with the same problem.
THe issue is that the wsdl has:
<soap:operation soapAction="" style="document"/>
but the request is sending:
SOAPACTION: "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1#IsAuthorized"
There are a couple options:
1) You could update the WSDL to include that string as the soapAction and regenerate all the code and such.
2) You could write a CXF interceptor that removes the soapAction from the request headers (or sets it to "" like the wsdl states)