You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Albert Rainer <al...@ec3.at> on 2008/04/01 17:37:15 UTC

namespace mismatch calling Axis2 service

Hi, I've followed the advice from Raymond in order to be able to call a remote Web service that is not under the control of tuscany.
I'm facing the problem that when I invoke the (Axis2) service, I get an exception that indicates a problem with the namespace.
Can anybody give me an hint what I'm doing wrong?
thanks very much in advance

Albert

SCHWERWIEGEND: Exception occurred while trying to invoke service method addiere
org.apache.axis2.AxisFault: namespace mismatch require http://move.at/xsd found
http://move.at
        at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic
(RPCMessageReceiver.java:103)
        at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(A
bstractInOutSyncMessageReceiver.java:39)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
uest(HTTPTransportUtils.java:279)
        at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1
16)  ...



The Implementation of the service looks like:

package at.move;
public class MathService {
        public double addiere(double a,double b){
                return a+b;
        }
        public int aufrunden(double a){
                return (int)Math.ceil(a);
        }
}
    
Deployed at http://localhost:8080/zong    

            
The WSDL is auto-generated by AXIS2. (For some reasons I do not know AXIS adds 'xsd' to the namespace)
(WSDL files from the tuscany samples do not show that /xsd suffix)
 
...    
<wsdl:types>
	<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://move.at/xsd">
		<xs:element name="addiere">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="a" nillable="true" type="xs:double"/>
				<xs:element name="b" nillable="true" type="xs:double"/>
			</xs:sequence>
		</xs:complexType>   
   ... 
   
In another web application I have (from the calculator example):

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
           targetNamespace="http://sample"
           xmlns:sample="http://sample"
           name="Calculator"> 
<component name="CalculatorServiceComponent">
		<implementation.java class="calculator.CalculatorServiceImpl"/>       
		<reference name="addService">         
            <binding.ws uri="http://localhost:8080/zong/services/MathService" />        
        </reference>
    </component>
    ...
    
    
 I have an Interface:
 
 package at.move;
 import org.osoa.sca.annotations.Remotable;

/**
 * The interface for the add service
 */
@Remotable
public interface RemoteMathService {

    double addiere(double n1, double n2);
    public int aufrunden(double a);

}

And a calculator implementation:

...
private RemoteMathService addService;

@Reference
public void setAddService(RemoteMathService addService) {
this.addService = addService;
}

public double add(double n1, double n2) {
     return addService.addiere(n1, n2);
}

The application is deployed at http://localhost:8080/sample-calculator-ws-webapp
----------------------------------------------------------------
Dr. Albert Rainer
EC3 - Electronic Commerce Competence Center
www.ec3.at
Donau-City Strasse 1
A-1220 Wien
Tel: +43 1 522 71 71 - 33
Fax: +43 1 522 71 71 - 71


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: namespace mismatch calling Axis2 service

Posted by Simon Nash <na...@apache.org>.
Comments linline.

   Simon

Albert Rainer wrote:
> Hi, I've followed the advice from Raymond in order to be able to call a remote Web service that is not under the control of tuscany.
> I'm facing the problem that when I invoke the (Axis2) service, I get an exception that indicates a problem with the namespace.
> Can anybody give me an hint what I'm doing wrong?
> thanks very much in advance
> 
> Albert
> 
> SCHWERWIEGEND: Exception occurred while trying to invoke service method addiere
> org.apache.axis2.AxisFault: namespace mismatch require http://move.at/xsd found
> http://move.at
>         at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic
> (RPCMessageReceiver.java:103)
>         at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(A
> bstractInOutSyncMessageReceiver.java:39)
>         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
>         at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
> uest(HTTPTransportUtils.java:279)
>         at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1
> 16)  ...
> 
> 
> 
> The Implementation of the service looks like:
> 
> package at.move;
> public class MathService {
>         public double addiere(double a,double b){
>                 return a+b;
>         }
>         public int aufrunden(double a){
>                 return (int)Math.ceil(a);
>         }
> }
>     
> Deployed at http://localhost:8080/zong    
> 
>             
> The WSDL is auto-generated by AXIS2. (For some reasons I do not know AXIS adds 'xsd' to the namespace)
> (WSDL files from the tuscany samples do not show that /xsd suffix)
>  
> ...    
> <wsdl:types>
> 	<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://move.at/xsd">
> 		<xs:element name="addiere">
> 		<xs:complexType>
> 			<xs:sequence>
> 				<xs:element name="a" nillable="true" type="xs:double"/>
> 				<xs:element name="b" nillable="true" type="xs:double"/>
> 			</xs:sequence>
> 		</xs:complexType>   
>    ... 
>    
> In another web application I have (from the calculator example):
> 
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>            targetNamespace="http://sample"
>            xmlns:sample="http://sample"
>            name="Calculator"> 
> <component name="CalculatorServiceComponent">
> 		<implementation.java class="calculator.CalculatorServiceImpl"/>       
> 		<reference name="addService">         
>             <binding.ws uri="http://localhost:8080/zong/services/MathService" />        
>         </reference>
>     </component>
>     ...
>  
 From your description, it sounds like the Tuscany side is using WSDL
that's auto-generated by Tuscany, and the Axis2 side is using WSDL
that's auto-generated by Axis2.

In general this is not advisable, as any difference between the
auto-generation algorithms will lead to interoperability errors,
as you are seeing.  For assured interoperability, it is safest
to either use explicitly generated WSDL on both sides, or to
use auto-generation on one side (I'll call it side A) and explicit
WSDL other the other side (I'll call it side B), where the explicit
WSDL was generated by side A's tools.  That way you know that both
A and B are running from the same WSDL definitions.

In this case it looks to me like you might be using Axis2 1.2
to host the MathService.  Axis2 1.2 adds this "/xsd" suffix to the
schema namespace, but Axis2 1.3 does not.  Tuscany uses Axis2 1.3,
so its auto-generated WSDL won't have this "/xsd" suffix.  You can
either upgrade the MathService to Axis2 1.3, or follow the best
practice for interoperability using explicit WSDL as described above.

   Simon
>     
>  I have an Interface:
>  
>  package at.move;
>  import org.osoa.sca.annotations.Remotable;
> 
> /**
>  * The interface for the add service
>  */
> @Remotable
> public interface RemoteMathService {
> 
>     double addiere(double n1, double n2);
>     public int aufrunden(double a);
> 
> }
> 
> And a calculator implementation:
> 
> ...
> private RemoteMathService addService;
> 
> @Reference
> public void setAddService(RemoteMathService addService) {
> this.addService = addService;
> }
> 
> public double add(double n1, double n2) {
>      return addService.addiere(n1, n2);
> }
> 
> The application is deployed at http://localhost:8080/sample-calculator-ws-webapp
> ----------------------------------------------------------------
> Dr. Albert Rainer
> EC3 - Electronic Commerce Competence Center
> www.ec3.at
> Donau-City Strasse 1
> A-1220 Wien
> Tel: +43 1 522 71 71 - 33
> Fax: +43 1 522 71 71 - 71
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org