Well, for one thing, you should not be using SOAP Encoding types with
document style.

Anne

On 2/2/07, Heiko Perkuhn <[EMAIL PROTECTED]> 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: [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