M
M. Posseth
Hi ,
I have the following problem
i made an app that sends a xml formatted string across a network through a
webservice ( no i can`t use remoting as i need platform indepandancy )
So to reduce banwidth i implemented Adaptive Huffman this is working
great with the strings in test application`s
### compression method ###
Friend Function strCompress(ByVal strToCompress As String) As String
Dim Bytes() As Byte =
AdaptiveHuffmanProvider.Compress(Encoding.Unicode.GetBytes(strToCompress))
Return Encoding.Unicode.GetString(Bytes)
End Function
######################
this string is normally contained in strXml wich i pass over the webservice
<?xml version="1.0" encoding="utf-16"?>
<tirep>
<errcode>0</errcode>
<Session-ID>{726418b7-b317-47ec-8d3e-473dd07479c0}</Session-ID>
</tirep>
if this string is beeing compressed to 6d#2ti{zB ]?`?c<I:
i get an error on the client side
System.Web.Services.Protocols.SoapException: Server was unable to process
request. --> There was an error generating the XML document. --> The
surrogate pair is invalid.
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
Message message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at NHSDataWebserviceTest.wsNHSBLW.NHSData.GetData(String& strXML) in
C:\Documents and
Settings\Administrator\Desktop\NHSDataWebserviceTestClient\NHSDataWebservice
Test\NHSData.vb:line 25
at NHSDataWebserviceTest.Form1.fobjXMLSendXMLRequest(String strXml,
Boolean& blnSucces) in C:\Documents and
Settings\Administrator\Desktop\NHSDataWebserviceTestClient\NHSDataWebservice
Test\FrmMain.vb:line 370
here is my WSDL
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.nohausystems.com/NHSService/NHSData"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://www.nohausystems.com/NHSService/NHSData"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified"
targetNamespace="http://www.nohausystems.com/NHSService/NHSData">
- <s:element name="GetData">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="strXML" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="GetDataResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="GetDataResult"
type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="strXML" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <wsdl:message name="GetDataSoapIn">
<wsdl
art name="parameters" element="tns:GetData" />
</wsdl:message>
- <wsdl:message name="GetDataSoapOut">
<wsdl
art name="parameters" element="tns:GetDataResponse" />
</wsdl:message>
- <wsdl
ortType name="NHSDataSoap">
- <wsdl
peration name="GetData">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">platform
independent interface wrapper , by specs of the TIREP Schnitstelle Dialog -
Business logic document of the New TIREP development team : Last mod to this
service binary 16-03-2005 , Made by : Michel Posseth [MCP] , info :
(e-mail address removed)</documentation>
<wsdl:input message="tns:GetDataSoapIn" />
<wsdl
utput message="tns:GetDataSoapOut" />
</wsdl
peration>
</wsdl
ortType>
- <wsdl:binding name="NHSDataSoap" type="tns:NHSDataSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <wsdl
peration name="GetData">
<soap
peration
soapAction="http://www.nohausystems.com/NHSService/NHSData/GetData"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl
utput>
<soap:body use="literal" />
</wsdl
utput>
</wsdl
peration>
</wsdl:binding>
- <wsdl:service name="NHSData">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
- <wsdl
ort name="NHSDataSoap" binding="tns:NHSDataSoap">
<soap:address location="http://127.0.0.1:8080/nhsdata.asmx" />
</wsdl
ort>
</wsdl:service>
</wsdl:definitions>
if strXML contains
<?xml version="1.0" encoding="utf-16"?>
<tirep>
<errcode>0</errcode>
<Session-ID>{726418b7-b317-47ec-8d3e-473dd07479c0}</Session-ID>
</tirep>
then everything works fine
if strXML contains
6d#2ti{zB ]?`?c<I:
i receive the error
what do i miss ?????
I have the following problem
i made an app that sends a xml formatted string across a network through a
webservice ( no i can`t use remoting as i need platform indepandancy )
So to reduce banwidth i implemented Adaptive Huffman this is working
great with the strings in test application`s
### compression method ###
Friend Function strCompress(ByVal strToCompress As String) As String
Dim Bytes() As Byte =
AdaptiveHuffmanProvider.Compress(Encoding.Unicode.GetBytes(strToCompress))
Return Encoding.Unicode.GetString(Bytes)
End Function
######################
this string is normally contained in strXml wich i pass over the webservice
<?xml version="1.0" encoding="utf-16"?>
<tirep>
<errcode>0</errcode>
<Session-ID>{726418b7-b317-47ec-8d3e-473dd07479c0}</Session-ID>
</tirep>
if this string is beeing compressed to 6d#2ti{zB ]?`?c<I:
i get an error on the client side
System.Web.Services.Protocols.SoapException: Server was unable to process
request. --> There was an error generating the XML document. --> The
surrogate pair is invalid.
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
Message message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at NHSDataWebserviceTest.wsNHSBLW.NHSData.GetData(String& strXML) in
C:\Documents and
Settings\Administrator\Desktop\NHSDataWebserviceTestClient\NHSDataWebservice
Test\NHSData.vb:line 25
at NHSDataWebserviceTest.Form1.fobjXMLSendXMLRequest(String strXml,
Boolean& blnSucces) in C:\Documents and
Settings\Administrator\Desktop\NHSDataWebserviceTestClient\NHSDataWebservice
Test\FrmMain.vb:line 370
here is my WSDL
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.nohausystems.com/NHSService/NHSData"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://www.nohausystems.com/NHSService/NHSData"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:schema elementFormDefault="qualified"
targetNamespace="http://www.nohausystems.com/NHSService/NHSData">
- <s:element name="GetData">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="strXML" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="GetDataResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="GetDataResult"
type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="strXML" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <wsdl:message name="GetDataSoapIn">
<wsdl
</wsdl:message>
- <wsdl:message name="GetDataSoapOut">
<wsdl
</wsdl:message>
- <wsdl
- <wsdl
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">platform
independent interface wrapper , by specs of the TIREP Schnitstelle Dialog -
Business logic document of the New TIREP development team : Last mod to this
service binary 16-03-2005 , Made by : Michel Posseth [MCP] , info :
(e-mail address removed)</documentation>
<wsdl:input message="tns:GetDataSoapIn" />
<wsdl
</wsdl
</wsdl
- <wsdl:binding name="NHSDataSoap" type="tns:NHSDataSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <wsdl
<soap
soapAction="http://www.nohausystems.com/NHSService/NHSData/GetData"
style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl
<soap:body use="literal" />
</wsdl
</wsdl
</wsdl:binding>
- <wsdl:service name="NHSData">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
- <wsdl
<soap:address location="http://127.0.0.1:8080/nhsdata.asmx" />
</wsdl
</wsdl:service>
</wsdl:definitions>
if strXML contains
<?xml version="1.0" encoding="utf-16"?>
<tirep>
<errcode>0</errcode>
<Session-ID>{726418b7-b317-47ec-8d3e-473dd07479c0}</Session-ID>
</tirep>
then everything works fine
if strXML contains
6d#2ti{zB ]?`?c<I:
i receive the error
what do i miss ?????