You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by 钱新林 <qi...@gmail.com> on 2005/03/17 09:38:07 UTC
how to transfer byte array in axis c++?
I am just using Axis(c++) to do some developing job. after downloaded
the Axis c++ release package. I integrated it with apache 2.0.52. and
all samples the axis included runs well.
but when i follow the instructions in the axis windows user docs to
create my own web service, it was a task that used the rpc to transfer
my private format data which had been convert into byte[] and deliver it
to the server, then i defined a remote call named GetErea (forgive me,
the Erea is the misspelling of word "Area"), the functions takes a
parameter as a type of byte array which is xsd__UnsignedChar_Array in
Axis, and return the same type. but i can't get my code work.
the client give me an error of "Runtime Error" and "abnormal program
terminator", can anybody point it out whether i do something wrong in
the process or Axis C++ itself didn't support this kinds of function??
Below is my webserivce's wsdl file, i write this and use wsdl2ws.jar to
automatedly generated the client and server stub code.
<?xml version="1.0" encoding="utf-8"?>
<definitions name="GetEreaSvr"
targetNamespace="http://localhost/wsdl/GetEreaSvr.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/wsdl/GetEreaSvr.wsdl"
xmlns:xsd1="http://localhost/schema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://localhost/schema">
<complexType name="ArrayOfByte">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="byte[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</types>
<message name="GetEreaSvrRequest">
<part name="byte_blk" type="xsd1:ArrayOfByte"/>
</message>
<message name="GetEreaSvrResponse">
<part name="bin_blk" type="xsd1:ArrayOfByte"/>
</message>
<portType name="EreaSvr_PortType">
<operation name="GetErea">
<input message="tns:GetEreaSvrRequest"/>
<output message="tns:GetEreaSvrResponse"/>
</operation>
</portType>
<binding name="GetErea_Binding" type="tns:EreaSvr_PortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetErea">
<soap:operation soapAction="urn:examples:GetEreaSvr"/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:GetEreaSvr" use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:GetEreaSvr" use="encoded"/>
</output>
</operation>
</binding>
<service name="GetErea_Service">
<port name="GetErea_Port" binding="tns:GetErea_Binding">
<soap:address location="http://localhost:8080/Axis/GetEreaSvr"/>
</port>
</service>
</definitions>