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 Thomas <tb...@entelience.com> on 2005/04/15 14:22:41 UTC

Can't create a client to access my Webservices

Hy, I can't manage my simple client to invoke webservices.
With this code :
Service service = new Service(new BasicClientConfig());
Call call = new Call(service);
call.setTargetEndpointAddress(new  
java.net.URL("http://localhost:1234/esis/services/EsisVersion"));
call.setOperationName("getEsisVersion");
call.setOperationStyle("rpc");
call.setReturnType(XMLType.XSD_STRING);
String ret = null;
MessageContext mc = null;
Message ms = null;
SOAPPart sp = null;
ret = (String) call.invoke( new Object[] {} );



  I get this error :

[java]  faultCode:  
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
[java]  faultSubcode:
[java]  faultString: org.xml.sax.SAXException: Bad envelope tag:  HTML
[java]  faultActor:
[java]  faultNode:
[java]  faultDetail:

and the trace :
  [java]     {http://xml.apache.org/axis/}stackTrace:  
org.xml.sax.SAXException: Bad envelope tag:  HTML
      [java]     at  
org.apache.axis.message.EnvelopeBuilder.startElement(Unknown Source)
      [java]     at  
org.apache.axis.encoding.DeserializationContextImpl.startElement(Unknown 
  Source)
      [java]     at  
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown  
Source)
      [java]     at  
org.cyberneko.html.filters.DefaultFilter.startElement(Unknown Source)
      [java]     at  
org.cyberneko.html.filters.NamespaceBinder.startElement(Unknown Source)
      [java]     at  
org.cyberneko.html.HTMLTagBalancer.callStartElement(Unknown Source)
      [java]     at  
org.cyberneko.html.HTMLTagBalancer.startElement(Unknown Source)
      [java]     at  
org.cyberneko.html.HTMLTagBalancer.startElement(Unknown Source)
      [java]     at  
org.cyberneko.html.HTMLTagBalancer.startElement(Unknown Source)
      [java]     at  
org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(Unknown  
Source)
      [java]     at  
org.cyberneko.html.HTMLScanner$ContentScanner.scan(Unknown Source)
      [java]     at org.cyberneko.html.HTMLScanner.scanDocument(Unknown  
Source)
      [java]     at org.cyberneko.html.HTMLConfiguration.parse(Unknown  
Source)
      [java]     at org.cyberneko.html.HTMLConfiguration.parse(Unknown  
Source)
      [java]     at org.apache.xerces.parsers.XMLParser.parse(Unknown  
Source)
      [java]     at  
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      [java]     at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
      [java]     at  
org.apache.axis.encoding.DeserializationContextImpl.parse(Unknown  
Source)
      [java]     at org.apache.axis.SOAPPart.getAsSOAPEnvelope(Unknown  
Source)
byte 2274     [java] Java Result: 1
      [java]     at org.apache.axis.Message.getSOAPEnvelope(Unknown  
Source)
      [java]     at org.apache.axis.client.Call.invokeEngine(Unknown  
Source)
      [java]     at org.apache.axis.client.Call.invoke(Unknown Source)
      [java]     at org.apache.axis.client.Call.invoke(Unknown Source)
      [java]     at org.apache.axis.client.Call.invoke(Unknown Source)
      [java]     at org.apache.axis.client.Call.invoke(Unknown Source)
      [java]     at  
fr.entelligence.test.test06soap.test01Asset.test01_getListTypes(test01As 
set.java:74)

The XML messages viewed by TCP Monitor are :
Request :
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope  
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
   <getEsisVersion  
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  </soapenv:Body>
</soapenv:Envelope>

Response :
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope  
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
   <ns1:sessionID soapenv:mustUnderstand="0" xsi:type="xsd:long"  
xmlns:ns1="http://xml.apache.org/axis/session">9136882735929956883</ 
ns1:sessionID>
  </soapenv:Header>
  <soapenv:Body>
   <getEsisVersionResponse  
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <getEsisVersionReturn  
xsi:type="xsd:string">ESIS_0.2-200504141631-1941-thomas-ESIS_main</ 
getEsisVersionReturn>
   </getEsisVersionResponse>
  </soapenv:Body>
</soapenv:Envelope>

Since my XML seems to be valid (it is, because it's accessed from Flash  
and Perl clients), I tried to update my Librairies to the newest one,  
but it didn't change.

My system : Apache Xerces XML Parser 2.6.2, Axis 1.1, Tomcat 5.0.28,  
MacOSX 10.3.8, Java JDK 1.4.2


Thank you for your help