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 Heiko Perkuhn <hp...@gmx.de> on 2007/02/02 09:27:06 UTC

Axis gsoap interoperability

Hi,

I'm trying to call a gsoap webservice with an axis client (Axis 1.4). But when the stub method is called, I get a "Validation constraint violation: data type mismatch xsd:byte in element <data>" error from Axis when the following stub method is called:

public java.lang.String CalledMethod(byte[] data) throws java.rmi.RemoteException; 

In the corresponding .h file the datatype in question was defined as follows: 

struct SOAP_ENC__base64Binary { 
    unsigned char *__ptr; 
    int __size; 
};

(the standard way...)

... and the function header (in the .h) looks like this: 
int CalledMethod(struct SOAP_ENC__base64Binary data); 

The stub method was created with "java -cp < .jar libs> -p <output directory> sde.wsdl.

The sde.wsdl was created using "soapcpp2 -x -I/<path-to-gsoap>/gsoap-2.7/soapcpp2/import sde.h" and looks like this:


<?xml version="1.0" encoding="UTF-8"?>
<definitions name="sde"
 targetNamespace="urn:sd_hipd"
 xmlns:tns="urn:sd_hipd"
 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"
 xmlns:sde="urn:sd_hipd"
 xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
 xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
 xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
 xmlns="http://schemas.xmlsoap.org/wsdl/">

<types>

 <schema targetNamespace="urn:sd_hipd"
  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"
  xmlns:sde="urn:sd_hipd"
  xmlns="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="unqualified"
  attributeFormDefault="unqualified">
  <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
  .
  .
  .
  <!-- operation request element -->
  <element name="blob" type="SOAP-ENC:base64Binary"/>
  .
  .
  .
</types>
  .
  .
  .
<message name="CalledMethodRequest">
 <part name="blob" element="sde:blob"/>
</message>
  .
  .
  .
<portType name="sde_cmd_executor">
 <operation name="CalledMethod">
  <documentation>Service definition of function sde__CalledMethod</documentation>
  <input message="tns:CalledMethodRequest"/>
  <output message="tns:CalledMethodResponse"/>
 </operation>
</portType>
</definitions>

Maybe I just lack experience. Is there another way to create the wsdl (e.g. does it make a difference if document/literal is used and how can I do that)? Or, how should it look like so that axis doesn't give me this error...?

Heiko
-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail?ac=OM.GX.GX003K11713T4783a

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


Re: Axis gsoap interoperability

Posted by Heiko Perkuhn <hp...@gmx.de>.
Yes, I used -e with soapcpp2 and then it worked fine...

Heiko



-------- Original-Nachricht --------
Datum: Fri, 2 Feb 2007 18:19:47 -0500
Von: "Anne Thomas Manes" <at...@gmail.com>
An: axis-user@ws.apache.org
CC: 
Betreff: Re: Axis gsoap interoperability

> Well, for one thing, you should not be using SOAP Encoding types with
> document style.
> 
> Anne
> 
> On 2/2/07, Heiko Perkuhn <hp...@gmx.de> wrote:
> > Hi,
> >
> > I'm trying to call a gsoap webservice with an axis client (Axis 1.4).
> But when the stub method is called, I get a "Validation constraint violation:
> data type mismatch xsd:byte in element <data>" error from Axis when the
> following stub method is called:
> >
> > public java.lang.String CalledMethod(byte[] data) throws
> java.rmi.RemoteException;
> >
> > In the corresponding .h file the datatype in question was defined as
> follows:
> >
> > struct SOAP_ENC__base64Binary {
> >     unsigned char *__ptr;
> >     int __size;
> > };
> >
> > (the standard way...)
> >
> > ... and the function header (in the .h) looks like this:
> > int CalledMethod(struct SOAP_ENC__base64Binary data);
> >
> > The stub method was created with "java -cp < .jar libs> -p <output
> directory> sde.wsdl.
> >
> > The sde.wsdl was created using "soapcpp2 -x
> -I/<path-to-gsoap>/gsoap-2.7/soapcpp2/import sde.h" and looks like this:
> >
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <definitions name="sde"
> >  targetNamespace="urn:sd_hipd"
> >  xmlns:tns="urn:sd_hipd"
> >  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"
> >  xmlns:sde="urn:sd_hipd"
> >  xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
> >  xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
> >  xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
> >  xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
> >  xmlns="http://schemas.xmlsoap.org/wsdl/">
> >
> > <types>
> >
> >  <schema targetNamespace="urn:sd_hipd"
> >   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"
> >   xmlns:sde="urn:sd_hipd"
> >   xmlns="http://www.w3.org/2001/XMLSchema"
> >   elementFormDefault="unqualified"
> >   attributeFormDefault="unqualified">
> >   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> >   .
> >   .
> >   .
> >   <!-- operation request element -->
> >   <element name="blob" type="SOAP-ENC:base64Binary"/>
> >   .
> >   .
> >   .
> > </types>
> >   .
> >   .
> >   .
> > <message name="CalledMethodRequest">
> >  <part name="blob" element="sde:blob"/>
> > </message>
> >   .
> >   .
> >   .
> > <portType name="sde_cmd_executor">
> >  <operation name="CalledMethod">
> >   <documentation>Service definition of function
> sde__CalledMethod</documentation>
> >   <input message="tns:CalledMethodRequest"/>
> >   <output message="tns:CalledMethodResponse"/>
> >  </operation>
> > </portType>
> > </definitions>
> >
> > Maybe I just lack experience. Is there another way to create the wsdl
> (e.g. does it make a difference if document/literal is used and how can I do
> that)? Or, how should it look like so that axis doesn't give me this
> error...?
> >
> > Heiko
> > --
> > "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> > Jetzt GMX TopMail testen:
> http://www.gmx.net/de/go/topmail?ac=OM.GX.GX003K11713T4783a
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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


Re: Axis gsoap interoperability

Posted by Anne Thomas Manes <at...@gmail.com>.
Well, for one thing, you should not be using SOAP Encoding types with
document style.

Anne

On 2/2/07, Heiko Perkuhn <hp...@gmx.de> wrote:
> Hi,
>
> I'm trying to call a gsoap webservice with an axis client (Axis 1.4). But when the stub method is called, I get a "Validation constraint violation: data type mismatch xsd:byte in element <data>" error from Axis when the following stub method is called:
>
> public java.lang.String CalledMethod(byte[] data) throws java.rmi.RemoteException;
>
> In the corresponding .h file the datatype in question was defined as follows:
>
> struct SOAP_ENC__base64Binary {
>     unsigned char *__ptr;
>     int __size;
> };
>
> (the standard way...)
>
> ... and the function header (in the .h) looks like this:
> int CalledMethod(struct SOAP_ENC__base64Binary data);
>
> The stub method was created with "java -cp < .jar libs> -p <output directory> sde.wsdl.
>
> The sde.wsdl was created using "soapcpp2 -x -I/<path-to-gsoap>/gsoap-2.7/soapcpp2/import sde.h" and looks like this:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <definitions name="sde"
>  targetNamespace="urn:sd_hipd"
>  xmlns:tns="urn:sd_hipd"
>  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"
>  xmlns:sde="urn:sd_hipd"
>  xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
>  xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
>  xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
>  xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
>  xmlns="http://schemas.xmlsoap.org/wsdl/">
>
> <types>
>
>  <schema targetNamespace="urn:sd_hipd"
>   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"
>   xmlns:sde="urn:sd_hipd"
>   xmlns="http://www.w3.org/2001/XMLSchema"
>   elementFormDefault="unqualified"
>   attributeFormDefault="unqualified">
>   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>   .
>   .
>   .
>   <!-- operation request element -->
>   <element name="blob" type="SOAP-ENC:base64Binary"/>
>   .
>   .
>   .
> </types>
>   .
>   .
>   .
> <message name="CalledMethodRequest">
>  <part name="blob" element="sde:blob"/>
> </message>
>   .
>   .
>   .
> <portType name="sde_cmd_executor">
>  <operation name="CalledMethod">
>   <documentation>Service definition of function sde__CalledMethod</documentation>
>   <input message="tns:CalledMethodRequest"/>
>   <output message="tns:CalledMethodResponse"/>
>  </operation>
> </portType>
> </definitions>
>
> Maybe I just lack experience. Is there another way to create the wsdl (e.g. does it make a difference if document/literal is used and how can I do that)? Or, how should it look like so that axis doesn't give me this error...?
>
> Heiko
> --
> "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail?ac=OM.GX.GX003K11713T4783a
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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