Got it to work

itwas a classpath issue !

It was trying to use celtix. I changed the CP to match the helloworld sample and now it declares the prefix. Didn't check exactly which jar caused this (although i could run some guesses) , but it is a a bit of a bizarre manifestation esp since I know nearly zero about celtix anyway.

of course, it had to get fixed just a few minutes after I sent the message ...

rania

Rania Khalaf wrote:

Hi everyone,

Is there a list of WSDL/schema limitations somewhere ? I am having the following problem just calling a Web service using Tuscany (similar to the hello world ws client sample). The created SOAP message is incorrect, mainly because the namespace prefix is left undefined. Any ideas welcome !

The WSDL is very simple: one portType with one operation: takes and returns a string. Binding is doc/lit.

I am copying the relevant files below. This is all using the M1 Distribution.

thanks!
Rania

ps: I even tried to generate an interface using the WSDL2JavaGenerator and use that one instead of just a hand crafted one because I thought maybe it does something with the package name .. but I still have the same problem. They look the same anyway pps: I also don't know why it's putting an <xml> in front of the soap envelope and what this '12a' is but it still just complains about the prefix.

********
SOAP MESSAGES
********
==== Request ====
POST /scaBPELSampleEcho/services/EchoService HTTP/1.1
SOAPAction: ""
Content-Type: text/xml; charset=utf-8
Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.5.0_05
Host: 127.0.0.1
Connection: keep-alive
Transfer-Encoding: chunked

12a
<?xml version="1.0" encoding="utf-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
     <SOAP-ENV:Body>
        <echo:echome>World</echo:echome>
     </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>0

==== Response ====
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=5D49F92340C18ACB88994AEEC83B1708; Path=/scaBPELSampleEcho
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Thu, 17 Aug 2006 22:01:19 GMT
Connection: close

c6
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
     <soapenv:Header />
     <soapenv:Body>
        <soapenv:Fault>
           <faultcode>soapenv:Client</faultcode>91
<faultstring>com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "echo"&#13; at [row,col {unknown-source}]: [1,243]</faultstring>

.... (etc.. )

********
sca.module
********

<module xmlns="http://www.osoa.org/xmlns/sca/0.9"; xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"; xmlns:bpel="http://www.osoa.org/xmlns/bpel/0.9"; name="bpel.samples.echoclient">
 <import.wsdl wsdlLocation="Echo.wsdl"/>
 <import.sdo wsdlLocation="Echo.wsdl"/>
     <externalService name="EchoService">
     <interface.java interface="echo.EchoService"/>
    <!-- <interface.wsdl interface="http://echo#echoPT"/>      -->
     <binding.ws port="http://echo#wsdl.endpoint(EchoService/EchoPort)"/>
   </externalService>     </module>

********
echo.wsdl
********

<definitions targetNamespace="http://echo";
xmlns:tns="http://echo"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            xmlns:ns1 ="http://echo";
            xmlns="http://schemas.xmlsoap.org/wsdl/";
            xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
            xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";>

 <types>
   <xsd:schema targetNamespace="http://echo";>
     <xsd:element name="echome" type="xsd:string"/>
   </xsd:schema>
 </types>

  <message name="StringMessageType">
     <part name="echoString" element="ns1:echome"/>
  </message>

  <portType name="echoPT">
     <operation name="echo">
        <input message="tns:StringMessageType" />
        <output message="tns:StringMessageType" />
     </operation>
  </portType>

  <binding name="EchoBinding" type="tns:echoPT">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
   <operation name="echo" >
     <soap:operation/>
     <input>
       <soap:body use="literal"/>
     </input>
     <output>
       <soap:body use="literal"/>
     </output>
   </operation>
 </binding>

 <service name="EchoService">
   <port name="EchoPort" binding="tns:EchoBinding">
<soap:address location="http://localhost:4040/scaBPELSampleEcho/services/EchoService"/>
   </port>
 </service>
</definitions>

******
CLIENT CODE (knocked off from helloworld)
******
public class EchoClient {

   public static final void main(String[] args) throws Exception {
             // Setup Tuscany monitoring to use java.util.logging
LogManager.getLogManager().readConfiguration(EchoClient.class.getResourceAsStream("/logging.properties"));
       Properties levels = new Properties();
MonitorFactory monitorFactory = new JavaLoggingMonitorFactory(levels, Level.FINEST, "MonitorMessages");

       // Create a Tuscany runtime for the sample module component
TuscanyRuntime tuscany = new TuscanyRuntime("EchoModuleComponent", "http://echo";, monitorFactory);

       // Start the Tuscany runtime and associate it with this thread
       tuscany.start();

       // Get the SCA module context.
       ModuleContext moduleContext = CurrentModuleContext.getContext();

       // Locate and Invoke the echo service
EchoService echoService = (EchoService)moduleContext.locateService("EchoService");
       String value = echoService.echo("World");
             System.out.println(value);
       System.out.flush();

       // Disassociate the runtime from this thread
       tuscany.stop();

       // Shut down the runtime
       tuscany.shutdown();
   }
}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to