axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Nicolas Ortuño <manuel.nicol...@carm.es>
Subject Re: AxisFault: Did not understand "MustUnderstand" header(s)
Date Mon, 30 May 2005 15:17:02 GMT
Hello,

I'm try to configure client handler, but i have a problem.

I have web service. This is wsdl

 

------------WSDL-------------

<?xml version="1.0" encoding="UTF-8" ?>

- <wsdl:definitions
targetNamespace="http://127.0.0.1:8080/axis/services/SPrueba1"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://127.0.0.1:8080/axis/services/SPrueba1"
xmlns:intf="http://127.0.0.1:8080/axis/services/SPrueba1"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://147.84.114.29"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

- <!--

WSDL created by Apache Axis version: 1.2RC3 Built on Feb 28, 2005 (10:15:14
EST)

 

  -->

- <wsdl:types>

- <schema targetNamespace="http://147.84.114.29"
xmlns="http://www.w3.org/2001/XMLSchema">

  <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />

- <complexType name="Prueba1Bean">

- <sequence>

  <element name="nombre" nillable="true" type="soapenc:string" />

  </sequence>

  </complexType>

  </schema>

  </wsdl:types>

  <wsdl:message name="getPrueba1BeanRequest" />

- <wsdl:message name="getPrueba1BeanResponse">

  <wsdl:part name="getPrueba1BeanReturn" type="tns1:Prueba1Bean" />

  </wsdl:message>

- <wsdl:portType name="Prueba1">

- <wsdl:operation name="getPrueba1Bean">

  <wsdl:input message="impl:getPrueba1BeanRequest"
name="getPrueba1BeanRequest" />

  <wsdl:output message="impl:getPrueba1BeanResponse"
name="getPrueba1BeanResponse" />

  </wsdl:operation>

  </wsdl:portType>

- <wsdl:binding name="SPrueba1SoapBinding" type="impl:Prueba1">

  <wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />

- <wsdl:operation name="getPrueba1Bean">

  <wsdlsoap:operation soapAction="" />

- <wsdl:input name="getPrueba1BeanRequest">

  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://ws.ctyc.carm.es" use="encoded" />

  </wsdl:input>

- <wsdl:output name="getPrueba1BeanResponse">

  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://127.0.0.1:8080/axis/services/SPrueba1" use="encoded" />

  </wsdl:output>

  </wsdl:operation>

  </wsdl:binding>

- <wsdl:service name="Prueba1Service">

- <wsdl:port binding="impl:SPrueba1SoapBinding" name="SPrueba1">

  <wsdlsoap:address location="http://127.0.0.1:8080/axis/services/SPrueba1"
/>

  </wsdl:port>

  </wsdl:service>

  </wsdl:definitions>

------------/WSDL-----------

 

I have a client:

 

-------------------M1.java-----------

package es.carm.ctyc.wc.CPrueba1;

import java.net.URL;

import javax.xml.namespace.QName;

import javax.xml.rpc.Service;

import javax.xml.rpc.ServiceFactory;

import javax.xml.rpc.handler.*;

 

import org.apache.axis.client.Call;

 

import java.util.*;

 

 

public class M1 {

      public static void main(String[] args) {

            try{

                  Prueba1ServiceLocator locator=new Prueba1ServiceLocator();

                  Prueba1 prueba1;

                  prueba1=locator.getSPrueba1();

                  System.out.println(prueba1.getPrueba1Bean().getNombre());

            }

            catch(Exception e){

                  e.printStackTrace();

            }

      }

}

------------------/M1.java------------------

 

 

I have a handler:

 

---------------SimpleHandler.java---------------

package es.carm.ctyc.wc.CPrueba1;

import javax.xml.rpc.handler.*;

 

import javax.xml.namespace.QName;

import javax.xml.rpc.handler.soap.SOAPMessageContext;

import javax.xml.rpc.JAXRPCException;

import javax.xml.rpc.NamespaceConstants; import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPBody; import org.w3c.dom.*;

 

import javax.xml.transform.TransformerFactory;

import javax.xml.transform.Transformer;

import javax.xml.transform.Source;

 

import javax.xml.transform.stream.StreamResult;

 

public class SimpleHandler extends GenericHandler {

      

  HandlerInfo hi;

      

  public void init(HandlerInfo info) {

    hi = info;

  }

 

  public QName[] getHeaders() {

    return hi.getHeaders();

  }

 

  public boolean handleResponse(MessageContext context) {

 

    System.out.println( "response");

 

    try {

 

      // get the soap header

      SOAPMessageContext smc = (SOAPMessageContext) context;

      SOAPMessage message = smc.getMessage();

 

    

      // Create transformer

      TransformerFactory tff = TransformerFactory.newInstance();

      Transformer tf = tff.newTransformer();

 

      // Get reply content

      Source sc = message.getSOAPPart().getContent();

 

      // Set output transformation

      StreamResult result = new StreamResult(System.out);

      tf.transform(sc, result);

      System.out.println();

        

    } catch (Exception e) {

      throw new JAXRPCException(e);

    }

    return true;

  }

 

  public boolean handleRequest(MessageContext context) {

            

    // return true to continue message processing

    return true;

  }

}

---------------/SimpleHandler.java---------------

 

And I have client-config.wsdd in the same directory that client M1.java

 

-------------------client-config.wsdd---------

<deployment name="PruebaHandler" xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

      <handler name="log"
type="java:es.carm.ctyc.wc.CPrueba1.SimpleHandler"/>

      <globalConfiguration>

            <requestFlow>

                  <handler type="log"/>

            </requestFlow>

            <responseFlow>

                  <handler type="log"/>

            </responseFlow>

      </globalConfiguration>

      <transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender"/>

      <transport name="local"
pivot="java:org.apache.axis.transport.local.LocalSender"/>

      <transport name="java"
pivot="java:org.apache.axis.transport.java.JavaSender"/>

</deployment>

-------------------/client-config.wsdd---------

 

The client work well, but Axis don't call to SimpleHandler.

Any idea.

 

Thanks for help.

 

 

 

 

-----Mensaje original-----

De: Anne Thomas Manes [mailto:atmanes@gmail.com] Enviado el: viernes, 27 de
mayo de 2005 15:13

Para: manuel.nicolas4@carm.es; axis-user

Asunto: Re: AxisFault: Did not understand "MustUnderstand" header(s)

 

You configure a client handler in the client-config.wsdd. 

 

Anne

 

On 5/27/05, Manuel Nicolas Ortuño <manuel.nicolas4@carm.es> wrote:

> I don't know how can i do it. In web service I can implement a 

> handler, I can say the handler to the web service in deploy.wsdd, but 

> this is a client and I don't have a .wsdd for the client. Resuming I 

> don't know how I can implement a handler for a client.

> 

> Thanks Anne.

> 

> -----Mensaje original-----

> De: Anne Thomas Manes [mailto:atmanes@gmail.com] Enviado el: viernes, 

> 27 de mayo de 2005 15:02

> Para: axis-user@ws.apache.org; manuel.nicolas4@carm.es

> Asunto: Re: AxisFault: Did not understand "MustUnderstand" header(s)

> 

> You need to configure a handler to process the SAP SOAP headers.

> 

> Anne

> 

> On 5/27/05, Manuel Nicolas Ortuño <manuel.nicolas4@carm.es> wrote:

> >

> >

> >

> > Hello,

> >

> >

> >

> > This is the client java code.

> >

> >

> >

> > package es.carm.ctyc.wc.CSigepal;

> >

> >

> >

> > import org.apache.axis.client.Call;

> >

> > import org.apache.axis.client.Service;

> >

> > import javax.xml.namespace.QName;

> >

> >

> >

> > import javax.xml.soap.MessageFactory;

> >

> > import javax.xml.soap.MimeHeaders;

> >

> > import javax.xml.soap.SOAPEnvelope;

> >

> > import javax.xml.soap.SOAPMessage;

> >

> > import javax.xml.soap.SOAPPart;

> >

> > import java.io.ByteArrayInputStream;

> >

> >

> >

> > public class m1 {

> >

> >             public static void main(String[] args) {

> >

> >                         try {

> >

> >                                    String endpoint =

> >

> "http://clustertxi.carm.es:50000/XISOAPAdapter/MessageServlet?channel=

> :SN_Ob 

> tenerEC:MandarFicheroSOAP&amp;version=3.0&amp;Sender.Service=SN_Obtene

> rEC&am p;Interface=http%3A%2F%2Fcarm.es%2Fws%2Fec%5EIM_ObtenerEC";

> >

> >                                    String xml="<SOAP-ENV:Envelope 

> > xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"

> > xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"

> > xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"

> >

> xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><SOAP-ENV:Body><m:IM_OB

> TENERE

> C

> >

> xmlns:m=\"http://carm.es/ws/ec\"><ID_EXP><EJER>2005</EJER><NUMEXP>0002

> 85</NU

> MEXP></ID_EXP><CEN_GES>190200</CEN_GES></m:IM_OBTENEREC></SOAP-ENV:Bod

> MEXP>y></SO

> AP-ENV:Envelope>";

> >

> >

> >

> >                                     MessageFactory mf = 

> > MessageFactory.newInstance();

> >

> >                                    SOAPMessage smsg =

> >

> >                                    mf.createMessage(new 

> > MimeHeaders(), new ByteArrayInputStream(xml.getBytes()));

> >

> >                                     SOAPPart sp = 

> > smsg.getSOAPPart();

> >

> >                                     SOAPEnvelope se = 

> > (SOAPEnvelope)sp.getEnvelope();

> >

> >

> >

> >                                    Service service = new Service();

> >

> >                                    Call call =

> > (org.apache.axis.client.Call) service.createCall();

> >

> >                                    call.setUsername("***");

> >

> >                                    call.setPassword("***");

> >

> >

> >

> >

> > call.setTargetEndpointAddress(new java.net.URL(endpoint));

> >

> >

> > call.setOperationName(new QName("","IM_OBTENEREC"));

> >

> >

> >

> >

> > org.apache.axis.message.SOAPEnvelope

> > soape=call.invoke((org.apache.axis.message.SOAPEnvelope)se);

> >

> >                         } catch (Exception e) {

> >

> >                                    e.printStackTrace();

> >

> >                         }

> >

> >             }

> >

> > }

> >

> >

> >

> >

> >

> > The response is

> >

> >

> >

> > <SOAP:Envelope

> > xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

> >

> >             <SOAP:Header>

> >

> >                         <sap:HopList 

> > xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">

> >

> >                                    <sap:Hop 

> > timeStamp="2005-05-27T07:48:16Z" wasRead="false">

> >

> >                                                <sap:Engine 

> > type="AE">af.txi.clustertxi</sap:Engine>

> >

> >                                                <sap:Adapter 

> > namespace="http://sap.com/xi/XI/System">XIRA</sap:Adapter>

> >

> >

> > <sap:MessageId>afb0d6a0-ce83-11d9-9464-00110aea5b0c</sap:MessageId>

> >

> >                                                <sap:Info/>

> >

> >                                    </sap:Hop>

> >

> >                                    <sap:Hop 

> > timeStamp="2005-05-27T07:48:17Z" wasRead="false">

> >

> >                                                <sap:Engine 

> > type="AE">af.txi.clustertxi</sap:Engine>

> >

> >                                                <sap:Adapter 

> > namespace="http://sap.com/xi/XI/System">XIRA</sap:Adapter>

> >

> >

> > <sap:MessageId>afb0d6a0-ce83-11d9-9464-00110aea5b0c</sap:MessageId>

> >

> >                                    </sap:Hop>

> >

> >                         </sap:HopList>

> >

> >                         <sap:ReliableMessaging 

> > xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">

> >

> >

> > <sap:QualityOfService>BestEffort</sap:QualityOfService>

> >

> >                         </sap:ReliableMessaging>

> >

> >                         <sap:Diagnostic 

> > xmlns:sap="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">

> >

> >

> > <sap:TraceLevel>Fatal</sap:TraceLevel>

> >

> >

> > <sap:Logging>Off</sap:Logging>

> >

> >                         </sap:Diagnostic>

> >

> >                         <sap:Main

> > xmlns:sap="http://sap.com/xi/XI/Message/30" versionMajor="3"

> > versionMinor="0" SOAP:mustUnderstand="1">

> >

> >

> > <sap:MessageClass>ApplicationResponse</sap:MessageClass>

> >

> >

> > <sap:ProcessingMode>synchronous</sap:ProcessingMode>

> >

> >

> > <sap:MessageId>afb0d6a0-ce83-11d9-9464-00110aea5b0c</sap:MessageId>

> >

> >

> >

> <sap:RefToMessageId>aecd7b80-ce83-11d9-b5e9-00110aea5b0c</sap:RefToMes

> sageId

> >

> >

> >

> > <sap:TimeSent>2005-05-27T07:48:16Z</sap:TimeSent>

> >

> >                                    <sap:Sender>

> >

> >                                                <sap:Party 

> > agency="http://sap.com/xi/XI" scheme="XIParty">CON</sap:Party>

> >

> >

> > <sap:Service>CON</sap:Service>

> >

> >                                    </sap:Sender>

> >

> >                                    <sap:Receiver>

> >

> >                                                <sap:Party 

> > agency="http://sap.com/xi/XI" scheme="XIParty"/>

> >

> >

> > <sap:Service>SN_ObtenerEC</sap:Service>

> >

> >                                    </sap:Receiver>

> >

> >                                    <sap:Interface 

> > namespace="http://carm.es/ws/ec">IM_ObtenerEC</sap:Interface>

> >

> >                         </sap:Main>

> >

> >             </SOAP:Header>

> >

> >             <SOAP:Body>

> >

> >                         <n:EX_OBTENEREC 

> > xmlns:n="http://carm.es/ws/ec">

> >

> >                                    <LISTA_EXP_CONTABLE>

> >

> >

> > <EXPEDIENTE_CONTABLE>

> >

> >

> > <CAB>

> >

> >

> >            <ID_CAB>

> >

> >

> >                       <CIRCUITO>CONTABLE</CIRCUITO>

> >

> >

> >                       <COD_TERRI>000000</COD_TERRI>

> >

> >

> >                       <EJER>2005</EJER>

> >

> >

> >                       <NUMEXP>000285</NUMEXP>

> >

> >

> >            </ID_CAB>

> >

> >

> >            <DESC_CAB>MANIFESTACIONES POPULARES DE CARACTER 

> > TU</DESC_CAB>

> >

> >

> >            <DOC_PRE>1100019706</DOC_PRE>

> >

> >

> >            <SOCIEDAD>CARM</SOCIEDAD>

> >

> >

> >            <FASE_DOC>R</FASE_DOC>

> >

> >

> >            <CLASE_DOC>RC</CLASE_DOC>

> >

> >

> >            <TIPO_EXP>RSR</TIPO_EXP>

> >

> >

> >            <INTERVENCION>

> >

> >

> >                       <INTERV/>

> >

> >

> >                       <TIPO_INTERV>N</TIPO_INTERV>

> >

> >

> >                       <FASE_INTERV>0000</FASE_INTERV>

> >

> >

> >            </INTERVENCION>

> >

> >

> >            <FECHA_CONT>00000000</FECHA_CONT>

> >

> >

> >            <FECHA_ALTA>20050113</FECHA_ALTA>

> >

> >

> >            <FECHA_REAL_ALTA>20050113</FECHA_REAL_ALTA>

> >

> >

> >            <ID_DOC_REF>

> >

> >

> >                       <CIRCUITO/>

> >

> >

> >                       <COD_TERRI/>

> >

> >

> >                       <EJER>0000</EJER>

> >

> >

> >                       <NUMEXP>000000</NUMEXP>

> >

> >

> >            </ID_DOC_REF>

> >

> >

> >            <DOC_PRE_REF/>

> >

> >

> > </CAB>

> >

> >

> > <LINEAS>

> >

> >

> >            <NUM_LIN>1</NUM_LIN>

> >

> >

> >            <LINEA_CONTABLE>

> >

> >

> >                       <POS_EXP>000001</POS_EXP>

> >

> >

> >                       <CEN_GES>190200</CEN_GES>

> >

> >

> >                       <POS_PRE>G/751A/48400</POS_PRE>

> >

> >

> >                       <ACREEDOR/>

> >

> >

> >                       <NIF/>

> >

> >

> >                       <IMPORTE>419994.00</IMPORTE>

> >

> >

> >                       <DISPONIBLE>0.00</DISPONIBLE>

> >

> >

> >                       <MONEDA>EUR</MONEDA>

> >

> >

> >                       <FECHA_PAGO>00000000</FECHA_PAGO>

> >

> >

> >                       <DOC_FI/>

> >

> >

> >                       <PROYECTO>30856</PROYECTO>

> >

> >

> >                       <ACTIVO_FIJO/>

> >

> >

> >                       <DESC_LIN/>

> >

> >

> >                       <POS_EXP_REF>000000</POS_EXP_REF>

> >

> >

> >            </LINEA_CONTABLE>

> >

> >

> > </LINEAS>

> >

> >

> > </EXPEDIENTE_CONTABLE>

> >

> >                                    </LISTA_EXP_CONTABLE>

> >

> >                                    <RESULTADO>

> >

> >

> > <TEXTO_ERROR>Expedientes Visualizados:000001</TEXTO_ERROR>

> >

> >

> > <CODIGO_ERROR>e000</CODIGO_ERROR>

> >

> >                                    </RESULTADO>

> >

> >                         </n:EX_OBTENEREC>

> >

> >             </SOAP:Body>

> >

> > </SOAP:Envelope>

> >

> >

> >

> > And the exception is:

> >

> >

> >

> > AxisFault

> >

> >  faultCode:

> > {http://schemas.xmlsoap.org/soap/envelope/}MustUnderstand

> >

> >  faultSubcode:

> >

> >  faultString: Did not understand &quot;MustUnderstand&quot; header(s):

> >

> >  faultActor:

> >

> >  faultNode:

> >

> >  faultDetail:

> >

> >       {http://xml.apache.org/axis/}stackTrace:

> >

> >       at

> >

> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderst

> andChe

> cker.java:96)

> >

> >       at

> > org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)

> >

> >       at

> > org.apache.axis.client.Call.invokeEngine(Call.java:2765)

> >

> >       at org.apache.axis.client.Call.invoke(Call.java:2748)

> >

> >       at org.apache.axis.client.Call.invoke(Call.java:1902)

> >

> >       at es.carm.ctyc.wc.CSigepal.m1.main(m1.java:50)

> >

> >

> >

> >       {http://xml.apache.org/axis/}hostname:r114pc269

> >

> >

> >

> > Did not understand "MustUnderstand" header(s):

> >

> >       at

> >

> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderst

> andChe

> cker.java:96)

> >

> >       at

> > org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)

> >

> >       at

> > org.apache.axis.client.Call.invokeEngine(Call.java:2765)

> >

> >       at org.apache.axis.client.Call.invoke(Call.java:2748)

> >

> >       at org.apache.axis.client.Call.invoke(Call.java:1902)

> >

> >       at es.carm.ctyc.wc.CSigepal.m1.main(m1.java:50)

> >

> >

> >

> >

> >

> > If I use wsdl2java to generate the java class from send and recive 

> > object, and implement a java client:

> >

> >

> >

> > public class prueba {

> >

> >

> >

> >       public static void main(String[] args) {

> >

> >

> >

> >             IM_ObtenerECBindingStub servicio = null;

> >

> >             IM_ObtenerECServiceLocator locator = new 

> > IM_ObtenerECServiceLocator();

> >

> >             _IM_OBTENEREC im = new _IM_OBTENEREC();

> >

> >             try {

> >

> >                   servicio = (IM_ObtenerECBindingStub) 

> > locator.getIM_ObtenerECPort();

> >

> >                   servicio.setUsername("***");

> >

> >                   servicio.setPassword("***");

> >

> >                   im=…

> >

> > _EX_OBTENEREC ex = servicio.IM_ObtenerEC(im);

> >

> >             } catch (Exception e) {

> >

> >                   e.printStackTrace();

> >

> >             }

> >

> > }

> >

> > }

> >

> >

> >

> > This code throw the same exception: Did not understand "MustUnderstand"

> > header(s):

> >

> > I read that if the exception throw in web service can solve 

> > implement a Handler, but in client I don't now how I can solve this
problem.

> >

> >

> >

> > Thanks.

> >

> >

> >

> >

> >

> >  ________________________________

> >

> >

> > De: Anand, Rajesh [mailto:Rajesh_Anand@ml.com]  Enviado el: jueves, 

> > 26 de mayo de 2005 15:12

> >  Para: axis-user@ws.apache.org; manuel.nicolas4@carm.es

> >  Asunto: RE: AxisFault: Did not understand "MustUnderstand" 

> > header(s)

> >

> >

> >

> >

> >

> >     Can you paste your full soap msg which goes out to the wire and 

> > your java pgm which builds this soap msg.

> >

> >

> >

> >

> >

> >     rgds,

> >

> > Rajesh Anand

> >  Email:Rajesh_anand@ml.com

> >

> >

> > -----Original Message-----

> >  From: Manuel Nicolas Ortuño [mailto:manuel.nicolas4@carm.es]

> >  Sent: 26 May 2005 14:07

> >  To: axis-user@ws.apache.org

> >  Subject: AxisFault: Did not understand "MustUnderstand" header(s)

> >

> > I have a client of web service that use axis api. When I call the 

> > service

> I

> > get the exception

> >

> >

> >

> > AxisFault

> >

> >  faultCode:

> > {http://schemas.xmlsoap.org/soap/envelope/}MustUnderstand

> >

> >  faultSubcode:

> >

> >  faultString: Did not understand &quot;MustUnderstand&quot; header(s):

> >

> >  faultActor:

> >

> >  faultNode:

> >

> >  faultDetail:

> >

> >       {http://xml.apache.org/axis/}stackTrace:

> >

> > ...

> >

> > [Message clipped]

> 

> 

 


Mime
View raw message