ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zina Kalish <Z...@braintech.com>
Subject base64binary
Date Wed, 06 Mar 2002 01:33:49 GMT
Hello everybody!
I have a problem and hope somebody can help me.
I have .NET client and Java Apache Soap Web Service. One method has an input
parameter byte[] 
(public String setArrayByte(byte[] param) and another one - returns byte[]
(public byte[] getArrayByte(String param). When the client calls
getArrayByte() method it works fine my client gets byte[], but when
setArrayByte() is invoked I get an error:

 No Deserializer found to deserialize a
'http://www.w3.org/2001/XMLSchema:base64Binary' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.


My methods:
public String setArrayByte(byte[] byteArray) {
	
    String str1 = new String(byteArray);
    System.out.println("WebService TestArray: string for byte[]=" + str1);
    return str1;
}

public byte[] getArrayByte(String str) {

    System.out.println("WebService TestArray: received string =" + str);

    byte[] byteArray = str.getBytes();
    
    return byteArray;
}

I generated a client proxy using .NET wsdl.exe
Client proxy in C#:

 
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:testarray-service
", RequestNamespace="urn:testarray-service",
ResponseNamespace="urn:testarray-service")]
    [return: System.Xml.Serialization.SoapElementAttribute("meth3_outType")]
    public string
setArrayByte([System.Xml.Serialization.SoapElementAttribute(DataType="base64
Binary")] System.Byte[] meth3_inType1) {
        object[] results = this.Invoke("setArrayByte", new object[] {
                    meth3_inType1});
        return ((string)(results[0]));
    }

 
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:testarray-service
", RequestNamespace="urn:testarray-service",
ResponseNamespace="urn:testarray-service")]
    [return: System.Xml.Serialization.SoapElementAttribute("meth2_outType",
DataType="base64Binary")]
    public System.Byte[] getArrayByte(string meth2_inType1) {
        object[] results = this.Invoke("getArrayByte", new object[] {
                    meth2_inType1});
        return ((System.Byte[])(results[0]));
    }


WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="TestArray_Service"
  targetNamespace="http://www.testarrayservice.com/TestArray-interface"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:tns="http://www.testarrayservice.com/TestArray-interface"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">


<message
      name="InechoArrayByteRequest">
  <part name="meth1_inType1"
    type="xsd:base64Binary"/>
</message>

<message
      name="OutechoArrayByteResponse">
  <part name="meth1_outType"
    type="xsd:base64Binary"/>
</message>


<message
      name="IngetArrayByteRequest">
  <part name="meth2_inType1"
    type="xsd:string"/>
</message>

<message
      name="OutgetArrayByteResponse">
  <part name="meth2_outType"
    type="xsd:base64Binary"/>
</message>

<message
      name="InsetArrayByteRequest">
  <part name="meth3_inType1"
    type="xsd:base64Binary"/>
</message>

<message
      name="OutsetArrayByteResponse">
  <part name="meth3_outType"
    type="xsd:string"/>
</message>



<portType
      name="TestArray_Service">
  <operation
        name="echoArrayByte">
    <input
        message="tns:InechoArrayByteRequest"/>
    <output
    message="tns:OutechoArrayByteResponse"/>
  </operation>
  
   <operation
        name="getArrayByte">
    <input
        message="tns:IngetArrayByteRequest"/>
    <output
    message="tns:OutgetArrayByteResponse"/>
  </operation>
  
  <operation
        name="setArrayByte">
    <input
        message="tns:InsetArrayByteRequest"/>
    <output
    message="tns:OutsetArrayByteResponse"/>
  </operation>
  
</portType>



<binding
    name="TestArray_ServiceBinding"
      type="tns:TestArray_Service">
  <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation
        name="echoArrayByte">
    <soap:operation
          soapAction="urn:testarray-service"/>
    <input>
      <soap:body
          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          namespace="urn:testarray-service"
          use="encoded"/>
    </input>
    <output>
      <soap:body
          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          namespace="urn:testarray-service" use="encoded"/>
    </output>
  </operation>
  
  <operation
        name="setArrayByte">
    <soap:operation
          soapAction="urn:testarray-service"/>
    <input>
      <soap:body
          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          namespace="urn:testarray-service"
          use="encoded"/>
    </input>
    <output>
      <soap:body
          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          namespace="urn:testarray-service" use="encoded"/>
    </output>
  </operation>
  
  <operation
        name="getArrayByte">
    <soap:operation
          soapAction="urn:testarray-service"/>
    <input>
      <soap:body
          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          namespace="urn:testarray-service"
          use="encoded"/>
    </input>
    <output>
      <soap:body
          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          namespace="urn:testarray-service" use="encoded"/>
    </output>
  </operation>
</binding>

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
id="urn:testarray-service" checkMustUnderstands="false">
  <isd:provider type="java" scope="Application" methods="echoArrayByte
getArrayByte setArrayByte">
    <isd:java class="com.braintech.test.TestArray" static="false"/>
  </isd:provider>
</isd:service>
  
Thank you  in advance.


Zina.




Mime
View raw message