You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by angeloimm <an...@libero.it> on 2005/04/21 10:15:32 UTC

faultString: No such operation

Hi all; i have a session bean as a web service.  This is the wsdl file:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ejbs.websrv.napsi.eng.it" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ejbs.websrv.napsi.eng.it" xmlns:intf="http://ejbs.websrv.napsi.eng.it" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 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.2beta3
Built on Aug 01, 2004 (05:59:22 PDT)-->

   <wsdl:message name="byFamilyCodeResponse">

      <wsdl:part name="byFamilyCodeReturn" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="toponomasticResponse">

      <wsdl:part name="toponomasticReturn" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="byFiscalCodeResponse">

      <wsdl:part name="byFiscalCodeReturn" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="updateRequest">

      <wsdl:part name="input" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="byFamilyCodeRequest">

      <wsdl:part name="input" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="toponomasticRequest">

      <wsdl:part name="input" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="byUserDataRequest">

      <wsdl:part name="input" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="byFiscalCodeRequest">

      <wsdl:part name="doc" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="byUserDataResponse">

      <wsdl:part name="byUserDataReturn" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:message name="updateResponse">

      <wsdl:part name="updateReturn" type="apachesoap:Document"/>

   </wsdl:message>

   <wsdl:portType name="Searcher">

      <wsdl:operation name="update" parameterOrder="input">

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

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

      </wsdl:operation>

      <wsdl:operation name="byFiscalCode" parameterOrder="doc">

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

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

      </wsdl:operation>

      <wsdl:operation name="byUserData" parameterOrder="input">

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

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

      </wsdl:operation>

      <wsdl:operation name="byFamilyCode" parameterOrder="input">

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

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

      </wsdl:operation>

      <wsdl:operation name="toponomastic" parameterOrder="input">

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

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

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="SearcherSoapBinding" type="impl:Searcher">

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

      <wsdl:operation name="update">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="updateRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="updateResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="byFiscalCode">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="byFiscalCodeRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="byFiscalCodeResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="byUserData">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="byUserDataRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="byUserDataResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="byFamilyCode">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="byFamilyCodeRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="byFamilyCodeResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="toponomastic">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="toponomasticRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="toponomasticResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="SearcherService">

      <wsdl:port binding="impl:SearcherSoapBinding" name="Searcher">

         <wsdlsoap:address location="http://localhost:8080/ServicePublisher/services/Searcher"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

I have this client:

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPBodyElement;
import org.apache.axis.message.SOAPBody;
import org.apache.axis.utils.XMLUtils;
import javax.xml.rpc.ServiceException;

import java.util.Vector;
import org.w3c.dom.Document;
import javax.xml.namespace.QName;

import org.apache.log4j.Logger;
import java.net.URL;
import java.net.MalformedURLException;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;


/**
 * <p>Title: Prototipo Piattaforma PMM piattaforma per la gestione di Web
 * Services</p>
 *
 * <p>Description: Prototipo semplice per la costruzione della piattaforma PMM
 * utilizzata per interagire con dei web services.</p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: Engineering Ingegneria Informatica</p>
 *
 * @author Angelo Immediata
 * @version 1.0
 */
public class SimpleAxisClient {

    /**
     * Il logger
     */
    private static final Logger LOG = Logger.getLogger(SimpleAxisClient.class.
            getName());

    /**
     * Preparo il l'oggetto Call da utilizzare
     * @param endpoint String -l'endpoint da utilizzare
     * @param operation String -l'operazione da invocare
     * @return Call -il Call generato.
     * @throws ServiceException -Se ci sono problemi col servizio
     */
    private Call getCall(String endpoint, String operation) throws
            ServiceException {

        if (LOG.isDebugEnabled()) {

            LOG.debug("Creating call.....");
        }
        Call result = (Call) (new Service()).createCall();
        try {
            result.setTargetEndpointAddress(new URL(endpoint));

        } catch (MalformedURLException ex) {

            LOG.error(ex);
        }

        result.setOperation(new QName(endpoint, operation), operation);
        if (LOG.isDebugEnabled()) {

            LOG.debug("Done!!");
        }
        return result;
    }

    /**
     * Invoco il web service passandogli il Document generato dalla classe it.eng.prototype.xml.Parser
     * @param doc Document -il Document generato.
     * @param endpoint String -l'endpoint del servizio.
     * @param operation String -l'operazione da invocare.
     * @return Document -il document in uscita al webService
     * @throws Exception
     */
    public Document getDocument(Document doc, String endpoint,
                                String operation) throws Exception {
        Call call = getCall(endpoint, operation);
        Vector result = (Vector) call.invoke(new Object[] {doc});
        //Vector result = (Vector) call.invoke(new SOAPBodyElement[] { new SOAPBodyElement( doc.getDocumentElement() )});
        SOAPBodyElement sbe = (SOAPBodyElement) result.get(0);

        if (LOG.isDebugEnabled()) {

            LOG.debug("Body ricevuto: " +
                      XMLUtils.DocumentToString(sbe.getAsDocument()));
        }
        return sbe.getAsDocument();
    }

    public static void main(String args[]) throws Exception {
        SimpleAxisClient client = new SimpleAxisClient();
        Call miaCall = client.getCall(
                "http://localhost:8082/ServicePublisher/services/Searcher","byFiscalCode");
        //it.eng.napsi.util.XMLUtil.stringToDocument(  )
        DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance();
        fac.setValidating(false);
        DocumentBuilder builder = fac.newDocumentBuilder(); // DocumentBuilderFactory.newInstance().newDocumentBuilder();
        
        Document doc = builder.parse(new java.io.ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8' standalone='yes'?><ricercaIndividuo><codiceFiscale>MMDNGL74C22H703K</codiceFiscale></ricercaIndividuo>".getBytes()));

                /*
                 Document doc = org.apache.axis.utils.XMLUtils.newDocument();
                 org.w3c.dom.Element ricercaInd = doc.createElementNS( "pippo", "byFiscalCode" );
                 org.w3c.dom.Element codFisc = doc.createElementNS( "pippo", "codiceFiscale" );

                 //codFisc.setNodeValue( "MMDNGL74C22H703K" );
                 ricercaInd.appendChild( codFisc );
                 codFisc.setNodeValue( "MMDNGL74C22H703K" );
                 doc.appendChild( ricercaInd );
                 System.out.println( XMLUtils.DocumentToString( doc ) );
                 /*
                 org.w3c.dom.Element elemento = org.apache.axis.utils.XMLUtils.StringToElement( "pippo", "codiceFiscale", "MMDNGL74C22H703K" );
                 org.w3c.dom.Element ric = org.apache.axis.utils.XMLUtils.StringToElement( "pippo", "ricercaIndividuo", "" );

                 doc.importNode(ric, true);
                 */

        //Document doc = XMLUtils.newDocument(new java.io.ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8' standalone='yes'?><ricercaIndividuo><codiceFiscale>MMDNGL74C22H703K</codiceFiscale></ricercaIndividuo>".getBytes()));
        org.apache.axis.utils.XMLUtils.StringToElement( "a", "ricercaIndividuo", "<codiceFiscale>MMDNGL74C22H703K</codiceFiscale>" );
        System.out.println("doc.getDocumentElement(): " +
                           doc.getDocumentElement().getNodeName());
        //System.out.println(miaCall.invoke(new SOAPBodyElement[] {new SOAPBodyElement(new java.io.ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8' standalone='yes'?><ricercaIndividuo><codiceFiscale>MMDNGL74C22H703K</codiceFiscale></ricercaIndividuo>".getBytes()))}));
        System.out.println(miaCall.invoke(new SOAPBodyElement[] {new SOAPBodyElement(org.apache.axis.utils.XMLUtils.StringToElement( "a", "ricercaIndividuo", "<codiceFiscale>MMDNGL74C22H703K</codiceFiscale>" ))}));

    }
}

Well when i try this client i have this error: 
AxisFault
 faultCode: {http://xml.apache.org/axis/}Client
 faultSubcode: 
 faultString: No such operation 'ricercaIndividuo'
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}hostname:PORT-IMMEDIATA

No such operation 'ricercaIndividuo'
	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1083)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:226)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2719)
	at org.apache.axis.client.Call.invoke(Call.java:2702)
	at org.apache.axis.client.Call.invoke(Call.java:1738)
	at it.eng.test.client.util.SimpleAxisClient.main(SimpleAxisClient.java:130)
Exception in thread "main"

Can anybody tell me why?
Thanks to all.



____________________________________________________________
Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. 
Scegli Libero Adsl Flat senza limiti su http://www.libero.it



Re: faultString: No such operation

Posted by Anne Thomas Manes <at...@gmail.com>.
Document/encoded is not a valid combination of style and use. You must
switch to either RPC/encoded or document/literal.

When using document style, your message parts must reference elements
rather than types. And ssuming that you know the format of your input
and output messages, you ought to define them in a <types> section --
even if your service prefers to process the messages as a DOM.

Here's a corrected version of your WSDL -- as document/literal. 

Anne

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ejbs.websrv.napsi.eng.it" 
   xmlns:impl="http://ejbs.websrv.napsi.eng.it" 
   xmlns:intf="http://ejbs.websrv.napsi.eng.it" 
   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.2beta3
Built on Aug 01, 2004 (05:59:22 PDT)-->

  <wsdl:types>
    <xsd:schema targetNamespace="http://ejbs.websrv.napsi.eng.it">
      <!-- I've currently defined the elements as type="xsd:anyType", 
           but you should define their actual structure if you know it -->
      <xsd:element name="update>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="input" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="updateResponse>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="updateReturn" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="byFiscalCode>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="input" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="byFiscalCodeResponse>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="byFiscalCodeReturn" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="byUserData>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="input" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="byUserDataResponse>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="byUserDataReturn" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>      
      </xsd:element>   
      <xsd:element name="byFamilyCode>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="input" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="byFamilyCodeResponse>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="byFamilyCodeReturn" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="toponomastic>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="input" type="xsd:anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="toponmasticResponse>
        <xsd:complexType>
           <xsd:sequence>
              <xsd:element name="toponomasticReturn" type="anyType"/>
           </xsd:sequence>
        </xsd:complexType>
      </xsd:element>

  <wsdl:message name="updateRequest">
     <wsdl:part name="body" element="impl:update"/>
  </wsdl:message>
  <wsdl:message name="updateResponse">
     <wsdl:part name="body" element="impl:updateResponse"/>
  </wsdl:message>

  <wsdl:message name="byFiscalCodeRequest">
     <wsdl:part name="body" element="impl:byFiscalCode"/>
  </wsdl:message>
  <wsdl:message name="byFamilyCodeResponse">
     <wsdl:part name="body" element="impl:byFiscalCodeResponse"/>
  </wsdl:message>

  <wsdl:message name="byUserDataRequest">
     <wsdl:part name="body" element="impl:byUserData"/>
  </wsdl:message>
  <wsdl:message name="byUserDataResponse">
     <wsdl:part name="body" element="impl:byUserDataResponse"/>
  </wsdl:message>

  <wsdl:message name="byFamilyCodeRequest">
     <wsdl:part name="body" element="impl:byFamilyCode"/>
  </wsdl:message>
  <wsdl:message name="byFamilyCodeResponse">
     <wsdl:part name="body" element="impl:byFamilyCodeResponse"/>
  </wsdl:message>

  <wsdl:message name="toponomasticRequest">
     <wsdl:part name="body" element="impl:toponomastic"/>
  </wsdl:message>
  <wsdl:message name="toponomasticResponse">
     <wsdl:part name="body" element="impl:"toponomasticResponse"/>
  </wsdl:message>
 
  <wsdl:portType name="Searcher">

     <wsdl:operation name="update">
        <wsdl:input message="impl:updateRequest" name="updateRequest"/>
        <wsdl:output message="impl:updateResponse" name="updateResponse"/>
     </wsdl:operation>

     <wsdl:operation name="byFiscalCode">
        <wsdl:input message="impl:byFiscalCodeRequest"
name="byFiscalCodeRequest"/>
        <wsdl:output message="impl:byFiscalCodeResponse"
name="byFiscalCodeResponse"/>
     </wsdl:operation>

     <wsdl:operation name="byUserData">
        <wsdl:input message="impl:byUserDataRequest" name="byUserDataRequest"/>
        <wsdl:output message="impl:byUserDataResponse"
name="byUserDataResponse"/>
     </wsdl:operation>

     <wsdl:operation name="byFamilyCode">
        <wsdl:input message="impl:byFamilyCodeRequest"
name="byFamilyCodeRequest"/>
        <wsdl:output message="impl:byFamilyCodeResponse"
name="byFamilyCodeResponse"/>
     </wsdl:operation>

     <wsdl:operation name="toponomastic">
        <wsdl:input message="impl:toponomasticRequest"
name="toponomasticRequest"/>
        <wsdl:output message="impl:toponomasticResponse"
name="toponomasticResponse"/>
     </wsdl:operation>

  </wsdl:portType>

  <wsdl:binding name="SearcherSoapBinding" type="impl:Searcher">
     <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

     <wsdl:operation name="update">
        <wsdlsoap:operation soapAction=""/>
        <wsdl:input name="updateRequest">
           <wsdlsoap:body use="literal"/>
        </wsdl:input>
        <wsdl:output name="updateResponse">
           <wsdlsoap:body use="literal"/>
        </wsdl:output>
     </wsdl:operation>

     <wsdl:operation name="byFiscalCode">
        <wsdlsoap:operation soapAction=""/>
        <wsdl:input name="byFiscalCodeRequest">
           <wsdlsoap:body use="literal"/>
        </wsdl:input>
        <wsdl:output name="byFiscalCodeResponse">
           <wsdlsoap:body use="literal"/>
        </wsdl:output>
     </wsdl:operation>

     <wsdl:operation name="byUserData">
        <wsdlsoap:operation soapAction=""/>
        <wsdl:input name="byUserDataRequest">
           <wsdlsoap:body use="literal"/>
        </wsdl:input>

        <wsdl:output name="byUserDataResponse">
           <wsdlsoap:body use="literal"/>
        </wsdl:output>
     </wsdl:operation>

     <wsdl:operation name="byFamilyCode">
        <wsdlsoap:operation soapAction=""/>
        <wsdl:input name="byFamilyCodeRequest">
           <wsdlsoap:body use="literal"/>
        </wsdl:input>
        <wsdl:output name="byFamilyCodeResponse">
           <wsdlsoap:body use="literal"/>
        </wsdl:output>
     </wsdl:operation>

     <wsdl:operation name="toponomastic">
        <wsdlsoap:operation soapAction=""/>
        <wsdl:input name="toponomasticRequest">
           <wsdlsoap:body use="literal"/>
        </wsdl:input>
        <wsdl:output name="toponomasticResponse">
           <wsdlsoap:body use="literal"/>
        </wsdl:output>
     </wsdl:operation>

  </wsdl:binding>

  <wsdl:service name="SearcherService">
     <wsdl:port binding="impl:SearcherSoapBinding" name="Searcher">
        <wsdlsoap:address
location="http://localhost:8080/ServicePublisher/services/Searcher"/>
     </wsdl:port>
  </wsdl:service>

</wsdl:definitions>


On 4/21/05, angeloimm <an...@libero.it> wrote:
> Hi all; i have a session bean as a web service.  This is the wsdl file:
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://ejbs.websrv.napsi.eng.it" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ejbs.websrv.napsi.eng.it" xmlns:intf="http://ejbs.websrv.napsi.eng.it" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 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.2beta3
> Built on Aug 01, 2004 (05:59:22 PDT)-->
> 
>    <wsdl:message name="byFamilyCodeResponse">
> 
>       <wsdl:part name="byFamilyCodeReturn" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="toponomasticResponse">
> 
>       <wsdl:part name="toponomasticReturn" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="byFiscalCodeResponse">
> 
>       <wsdl:part name="byFiscalCodeReturn" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="updateRequest">
> 
>       <wsdl:part name="input" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="byFamilyCodeRequest">
> 
>       <wsdl:part name="input" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="toponomasticRequest">
> 
>       <wsdl:part name="input" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="byUserDataRequest">
> 
>       <wsdl:part name="input" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="byFiscalCodeRequest">
> 
>       <wsdl:part name="doc" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="byUserDataResponse">
> 
>       <wsdl:part name="byUserDataReturn" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="updateResponse">
> 
>       <wsdl:part name="updateReturn" type="apachesoap:Document"/>
> 
>    </wsdl:message>
> 
>    <wsdl:portType name="Searcher">
> 
>       <wsdl:operation name="update" parameterOrder="input">
> 
>          <wsdl:input message="impl:updateRequest" name="updateRequest"/>
> 
>          <wsdl:output message="impl:updateResponse" name="updateResponse"/>
> 
>       </wsdl:operation>
> 
>       <wsdl:operation name="byFiscalCode" parameterOrder="doc">
> 
>          <wsdl:input message="impl:byFiscalCodeRequest" name="byFiscalCodeRequest"/>
> 
>          <wsdl:output message="impl:byFiscalCodeResponse" name="byFiscalCodeResponse"/>
> 
>       </wsdl:operation>
> 
>       <wsdl:operation name="byUserData" parameterOrder="input">
> 
>          <wsdl:input message="impl:byUserDataRequest" name="byUserDataRequest"/>
> 
>          <wsdl:output message="impl:byUserDataResponse" name="byUserDataResponse"/>
> 
>       </wsdl:operation>
> 
>       <wsdl:operation name="byFamilyCode" parameterOrder="input">
> 
>          <wsdl:input message="impl:byFamilyCodeRequest" name="byFamilyCodeRequest"/>
> 
>          <wsdl:output message="impl:byFamilyCodeResponse" name="byFamilyCodeResponse"/>
> 
>       </wsdl:operation>
> 
>       <wsdl:operation name="toponomastic" parameterOrder="input">
> 
>          <wsdl:input message="impl:toponomasticRequest" name="toponomasticRequest"/>
> 
>          <wsdl:output message="impl:toponomasticResponse" name="toponomasticResponse"/>
> 
>       </wsdl:operation>
> 
>    </wsdl:portType>
> 
>    <wsdl:binding name="SearcherSoapBinding" type="impl:Searcher">
> 
>       <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
> 
>       <wsdl:operation name="update">
> 
>          <wsdlsoap:operation soapAction=""/>
> 
>          <wsdl:input name="updateRequest">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:input>
> 
>          <wsdl:output name="updateResponse">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:output>
> 
>       </wsdl:operation>
> 
>       <wsdl:operation name="byFiscalCode">
> 
>          <wsdlsoap:operation soapAction=""/>
> 
>          <wsdl:input name="byFiscalCodeRequest">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:input>
> 
>          <wsdl:output name="byFiscalCodeResponse">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:output>
> 
>       </wsdl:operation>
> 
>       <wsdl:operation name="byUserData">
> 
>          <wsdlsoap:operation soapAction=""/>
> 
>          <wsdl:input name="byUserDataRequest">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:input>
> 
>          <wsdl:output name="byUserDataResponse">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:output>
> 
>       </wsdl:operation>
> 
>       <wsdl:operation name="byFamilyCode">
> 
>          <wsdlsoap:operation soapAction=""/>
> 
>          <wsdl:input name="byFamilyCodeRequest">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:input>
> 
>          <wsdl:output name="byFamilyCodeResponse">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:output>
> 
>       </wsdl:operation>
> 
>       <wsdl:operation name="toponomastic">
> 
>          <wsdlsoap:operation soapAction=""/>
> 
>          <wsdl:input name="toponomasticRequest">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:input>
> 
>          <wsdl:output name="toponomasticResponse">
> 
>             <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
> 
>          </wsdl:output>
> 
>       </wsdl:operation>
> 
>    </wsdl:binding>
> 
>    <wsdl:service name="SearcherService">
> 
>       <wsdl:port binding="impl:SearcherSoapBinding" name="Searcher">
> 
>          <wsdlsoap:address location="http://localhost:8080/ServicePublisher/services/Searcher"/>
> 
>       </wsdl:port>
> 
>    </wsdl:service>
> 
> </wsdl:definitions>
> 
> I have this client:
> 
> import org.apache.axis.client.Call;
> import org.apache.axis.client.Service;
> import org.apache.axis.message.SOAPBodyElement;
> import org.apache.axis.message.SOAPBody;
> import org.apache.axis.utils.XMLUtils;
> import javax.xml.rpc.ServiceException;
> 
> import java.util.Vector;
> import org.w3c.dom.Document;
> import javax.xml.namespace.QName;
> 
> import org.apache.log4j.Logger;
> import java.net.URL;
> import java.net.MalformedURLException;
> import javax.xml.parsers.DocumentBuilderFactory;
> import javax.xml.parsers.DocumentBuilder;
> 
> /**
>  * <p>Title: Prototipo Piattaforma PMM piattaforma per la gestione di Web
>  * Services</p>
>  *
>  * <p>Description: Prototipo semplice per la costruzione della piattaforma PMM
>  * utilizzata per interagire con dei web services.</p>
>  *
>  * <p>Copyright: Copyright (c) 2005</p>
>  *
>  * <p>Company: Engineering Ingegneria Informatica</p>
>  *
>  * @author Angelo Immediata
>  * @version 1.0
>  */
> public class SimpleAxisClient {
> 
>     /**
>      * Il logger
>      */
>     private static final Logger LOG = Logger.getLogger(SimpleAxisClient.class.
>             getName());
> 
>     /**
>      * Preparo il l'oggetto Call da utilizzare
>      * @param endpoint String -l'endpoint da utilizzare
>      * @param operation String -l'operazione da invocare
>      * @return Call -il Call generato.
>      * @throws ServiceException -Se ci sono problemi col servizio
>      */
>     private Call getCall(String endpoint, String operation) throws
>             ServiceException {
> 
>         if (LOG.isDebugEnabled()) {
> 
>             LOG.debug("Creating call.....");
>         }
>         Call result = (Call) (new Service()).createCall();
>         try {
>             result.setTargetEndpointAddress(new URL(endpoint));
> 
>         } catch (MalformedURLException ex) {
> 
>             LOG.error(ex);
>         }
> 
>         result.setOperation(new QName(endpoint, operation), operation);
>         if (LOG.isDebugEnabled()) {
> 
>             LOG.debug("Done!!");
>         }
>         return result;
>     }
> 
>     /**
>      * Invoco il web service passandogli il Document generato dalla classe it.eng.prototype.xml.Parser
>      * @param doc Document -il Document generato.
>      * @param endpoint String -l'endpoint del servizio.
>      * @param operation String -l'operazione da invocare.
>      * @return Document -il document in uscita al webService
>      * @throws Exception
>      */
>     public Document getDocument(Document doc, String endpoint,
>                                 String operation) throws Exception {
>         Call call = getCall(endpoint, operation);
>         Vector result = (Vector) call.invoke(new Object[] {doc});
>         //Vector result = (Vector) call.invoke(new SOAPBodyElement[] { new SOAPBodyElement( doc.getDocumentElement() )});
>         SOAPBodyElement sbe = (SOAPBodyElement) result.get(0);
> 
>         if (LOG.isDebugEnabled()) {
> 
>             LOG.debug("Body ricevuto: " +
>                       XMLUtils.DocumentToString(sbe.getAsDocument()));
>         }
>         return sbe.getAsDocument();
>     }
> 
>     public static void main(String args[]) throws Exception {
>         SimpleAxisClient client = new SimpleAxisClient();
>         Call miaCall = client.getCall(
>                 "http://localhost:8082/ServicePublisher/services/Searcher","byFiscalCode");
>         //it.eng.napsi.util.XMLUtil.stringToDocument(  )
>         DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance();
>         fac.setValidating(false);
>         DocumentBuilder builder = fac.newDocumentBuilder(); // DocumentBuilderFactory.newInstance().newDocumentBuilder();
> 
>         Document doc = builder.parse(new java.io.ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8' standalone='yes'?><ricercaIndividuo><codiceFiscale>MMDNGL74C22H703K</codiceFiscale></ricercaIndividuo>".getBytes()));
> 
>                 /*
>                  Document doc = org.apache.axis.utils.XMLUtils.newDocument();
>                  org.w3c.dom.Element ricercaInd = doc.createElementNS( "pippo", "byFiscalCode" );
>                  org.w3c.dom.Element codFisc = doc.createElementNS( "pippo", "codiceFiscale" );
> 
>                  //codFisc.setNodeValue( "MMDNGL74C22H703K" );
>                  ricercaInd.appendChild( codFisc );
>                  codFisc.setNodeValue( "MMDNGL74C22H703K" );
>                  doc.appendChild( ricercaInd );
>                  System.out.println( XMLUtils.DocumentToString( doc ) );
>                  /*
>                  org.w3c.dom.Element elemento = org.apache.axis.utils.XMLUtils.StringToElement( "pippo", "codiceFiscale", "MMDNGL74C22H703K" );
>                  org.w3c.dom.Element ric = org.apache.axis.utils.XMLUtils.StringToElement( "pippo", "ricercaIndividuo", "" );
> 
>                  doc.importNode(ric, true);
>                  */
> 
>         //Document doc = XMLUtils.newDocument(new java.io.ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8' standalone='yes'?><ricercaIndividuo><codiceFiscale>MMDNGL74C22H703K</codiceFiscale></ricercaIndividuo>".getBytes()));
>         org.apache.axis.utils.XMLUtils.StringToElement( "a", "ricercaIndividuo", "<codiceFiscale>MMDNGL74C22H703K</codiceFiscale>" );
>         System.out.println("doc.getDocumentElement(): " +
>                            doc.getDocumentElement().getNodeName());
>         //System.out.println(miaCall.invoke(new SOAPBodyElement[] {new SOAPBodyElement(new java.io.ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8' standalone='yes'?><ricercaIndividuo><codiceFiscale>MMDNGL74C22H703K</codiceFiscale></ricercaIndividuo>".getBytes()))}));
>         System.out.println(miaCall.invoke(new SOAPBodyElement[] {new SOAPBodyElement(org.apache.axis.utils.XMLUtils.StringToElement( "a", "ricercaIndividuo", "<codiceFiscale>MMDNGL74C22H703K</codiceFiscale>" ))}));
> 
>     }
> }
> 
> Well when i try this client i have this error:
> AxisFault
>  faultCode: {http://xml.apache.org/axis/}Client
>  faultSubcode:
>  faultString: No such operation 'ricercaIndividuo'
>  faultActor:
>  faultNode:
>  faultDetail:
>         {http://xml.apache.org/axis/}hostname:PORT-IMMEDIATA
> 
> No such operation 'ricercaIndividuo'
>         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
>         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
>         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1083)
>         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:226)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
>         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2719)
>         at org.apache.axis.client.Call.invoke(Call.java:2702)
>         at org.apache.axis.client.Call.invoke(Call.java:1738)
>         at it.eng.test.client.util.SimpleAxisClient.main(SimpleAxisClient.java:130)
> Exception in thread "main"
> 
> Can anybody tell me why?
> Thanks to all.
> 
> ____________________________________________________________
> Navighi a 4 MEGA e i primi 3 mesi sono GRATIS.
> Scegli Libero Adsl Flat senza limiti su http://www.libero.it
> 
>