You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Santala Arto <Ar...@tieturi.fi> on 2001/04/12 13:29:36 UTC

Content-Type: text/xml; charset=utf-8

I have a problem with Apache SOAP when attaching to Windows .NET services.
Apache sends a header like this:

Content-Type: text/xml; charset=utf-8

And server responds:
 <soap:faultstring>System.Web.Services.Protocols.SoapException: Server found
request content type to be 'text/xml; charset=utf-8', but expected
'text/xml'.
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.Invoke()
   at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</soap:f
aultstring>

So it seems clear to me that server can't handle charset declaration at
apache request. 

Question: How do I handle this? Is there any way to alter the HTTP headers
of Apache soap envelope? I didn't find any way to do this while I took a
look to the API, it was really sparsely documented. Does anyone know (or can
make an educated quess?)



---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Content-Type: text/xml; charset=utf-8

Posted by Simon Fell <so...@zaks.demon.co.uk>.
This is a bug in the .NET pieces, hopefully beta2 will be available
soon, and we can all stop doing working arounds.

Cheers
Simon

On Thu, 12 Apr 2001 14:29:36 +0300, in soap you wrote:

>
>I have a problem with Apache SOAP when attaching to Windows .NET services.
>Apache sends a header like this:
>
>Content-Type: text/xml; charset=utf-8
>
>And server responds:
> <soap:faultstring>System.Web.Services.Protocols.SoapException: Server found
>request content type to be 'text/xml; charset=utf-8', but expected
>'text/xml'.
>   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
>   at System.Web.Services.Protocols.WebServiceHandler.Invoke()
>   at
>System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</soap:f
>aultstring>
>
>So it seems clear to me that server can't handle charset declaration at
>apache request. 
>
>Question: How do I handle this? Is there any way to alter the HTTP headers
>of Apache soap envelope? I didn't find any way to do this while I took a
>look to the API, it was really sparsely documented. Does anyone know (or can
>make an educated quess?)
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Content-Type: text/xml; charset=utf-8

Posted by Wouter Cloetens <wo...@mind.be>.
Apart from the good comments about upgrading the .NET server side, there
is also a kludgy workaround to allow an Apache-SOAP client to send the
request with just "text/xml" in the Content-Type header. See some of the
examples, e.g. samples/xmethods/GetTemp.java.

bfn, Wouter
p.s. I'd like to thank all the people who gave their vote of confidence to
Apache-SOAP by suggesting that you _upgrade_ your server to Apache-SOAP
2.1. ;-)


On Thu, Apr 12, 2001 at 02:29:36PM +0300, Santala Arto wrote:
> 
> I have a problem with Apache SOAP when attaching to Windows .NET services.
> Apache sends a header like this:
> 
> Content-Type: text/xml; charset=utf-8
> 
> And server responds:
>  <soap:faultstring>System.Web.Services.Protocols.SoapException: Server found
> request content type to be 'text/xml; charset=utf-8', but expected
> 'text/xml'.
>    at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
>    at System.Web.Services.Protocols.WebServiceHandler.Invoke()
>    at
> System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</soap:f
> aultstring>
> 
> So it seems clear to me that server can't handle charset declaration at
> apache request. 
> 
> Question: How do I handle this? Is there any way to alter the HTTP headers
> of Apache soap envelope? I didn't find any way to do this while I took a
> look to the API, it was really sparsely documented. Does anyone know (or can
> make an educated quess?)

---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Content-Type: text/xml; charset=utf-8

Posted by Simon Fell <so...@zaks.demon.co.uk>.
This is a bug in the .NET pieces, hopefully beta2 will be available
soon, and we can all stop doing working arounds.

Cheers
Simon

On Thu, 12 Apr 2001 14:29:36 +0300, in soap you wrote:

>
>I have a problem with Apache SOAP when attaching to Windows .NET services.
>Apache sends a header like this:
>
>Content-Type: text/xml; charset=utf-8
>
>And server responds:
> <soap:faultstring>System.Web.Services.Protocols.SoapException: Server found
>request content type to be 'text/xml; charset=utf-8', but expected
>'text/xml'.
>   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
>   at System.Web.Services.Protocols.WebServiceHandler.Invoke()
>   at
>System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</soap:f
>aultstring>
>
>So it seems clear to me that server can't handle charset declaration at
>apache request. 
>
>Question: How do I handle this? Is there any way to alter the HTTP headers
>of Apache soap envelope? I didn't find any way to do this while I took a
>look to the API, it was really sparsely documented. Does anyone know (or can
>make an educated quess?)
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Content-Type: text/xml; charset=utf-8

Posted by Wouter Cloetens <wo...@mind.be>.
Apart from the good comments about upgrading the .NET server side, there
is also a kludgy workaround to allow an Apache-SOAP client to send the
request with just "text/xml" in the Content-Type header. See some of the
examples, e.g. samples/xmethods/GetTemp.java.

bfn, Wouter
p.s. I'd like to thank all the people who gave their vote of confidence to
Apache-SOAP by suggesting that you _upgrade_ your server to Apache-SOAP
2.1. ;-)


On Thu, Apr 12, 2001 at 02:29:36PM +0300, Santala Arto wrote:
> 
> I have a problem with Apache SOAP when attaching to Windows .NET services.
> Apache sends a header like this:
> 
> Content-Type: text/xml; charset=utf-8
> 
> And server responds:
>  <soap:faultstring>System.Web.Services.Protocols.SoapException: Server found
> request content type to be 'text/xml; charset=utf-8', but expected
> 'text/xml'.
>    at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
>    at System.Web.Services.Protocols.WebServiceHandler.Invoke()
>    at
> System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</soap:f
> aultstring>
> 
> So it seems clear to me that server can't handle charset declaration at
> apache request. 
> 
> Question: How do I handle this? Is there any way to alter the HTTP headers
> of Apache soap envelope? I didn't find any way to do this while I took a
> look to the API, it was really sparsely documented. Does anyone know (or can
> make an educated quess?)

---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


RE: Content-Type: text/xml; charset=utf-8

Posted by Giovanni Ruggiero <ru...@cefriel.it>.
Dear Santala
I attach a post by Herve Shu who answered me about similar problems
I had in calling a .NET service

--------------------------------------
I have successfully called a .Net WebService from Apache-SOAP under
following environment:
	Platform: Windows 2000
	HTTP Server: IIS 5.0 for Microsoft SOAP
	Apache-SOAP: Version 2.1 rc1
	Development tool: Visual Studio.NET beta version
	JDK: J2SE 1.3

Both MS.NET C# Web Service and Web Service using MS.NET ATL Server were
tested.

There are 2 special notes:
1. Data Type
MS.NET Web Services specify neither encoding style nor xsi:type for return
values in its Response Envelope.
So, Apache-SOAP Client throws an exception:

No Deserializer found to deserialize a
'http://schemas.xmlsoap.org/soap/envelope/:Parameter' using encoding style
'null'.

Apache-SOAP Client needs to register all necessary type mappings before
making call to server. Example:
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    ParameterSerializer ps = new ParameterSerializer();
    StringDeserializer sd = new StringDeserializer();

smr.mapTypes(null,RPCConstants.Q_ELEM_PARAMETER,Parameter.class,null,ps);
    smr.mapTypes(null,new QName("","name"),null,null,sd);
    call.setSOAPMappingRegistry(smr);

2. Content Type
Web Service using C# does not understand "text/xml; charset=utf-8" content
type which is used by Apache-SOAP. This causes a Client Fault:

System.Web.Services.Protocols.SoapException: Server found request content
type to be 'text/xml; charset=utf-8', but expected 'text/xml'.

If we change TransportMessage.java to hardcode "text/xml" for content type,
it works fine.


>From your previous mail, I think you use C# Web Service since Web Service
using ATL Server contains automatically namespace like <snp:tagname> in its
response envelope.
To work with C# Web Service, you must add a SoapMethod attribute for your
Web method like:
	[ SoapMethod(Action="urn:AddressService#GetList",
		  RequestNamespace="urn:AddressService",
		  ResponseNamespace="urn:AddressService",
		  ResponseElementName="GetListResponse") ]
Thus, the response envelope will contain a namespace definition like:
	<GetListResponse xmlns="urn:AddressService">
and Apach-SOAP can correctly unmarshall the return value.

Hope this helps

Herve
-----------------------------------------


Moreover you can find also a way of doing it programmatically, though I've
not tried it yet,
in the example lemurlabs Fortune.java in the cvs repository:

http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/samples/lemurlabs/Fort
une.java?annotate=1.1

hope this help.

Best Regards

Giovanni


-----Original Message-----
From: Santala Arto [mailto:Arto.Santala@tieturi.fi]
Sent: giovedì 12 aprile 2001 13:30
To: 'soap-user@xml.apache.org'
Subject: Content-Type: text/xml; charset=utf-8



I have a problem with Apache SOAP when attaching to Windows .NET services.
Apache sends a header like this:

Content-Type: text/xml; charset=utf-8

And server responds:
 <soap:faultstring>System.Web.Services.Protocols.SoapException: Server found
request content type to be 'text/xml; charset=utf-8', but expected
'text/xml'.
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.Invoke()
   at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</soap:f
aultstring>

So it seems clear to me that server can't handle charset declaration at
apache request.

Question: How do I handle this? Is there any way to alter the HTTP headers
of Apache soap envelope? I didn't find any way to do this while I took a
look to the API, it was really sparsely documented. Does anyone know (or can
make an educated quess?)



---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


RE: Content-Type: text/xml; charset=utf-8

Posted by Giovanni Ruggiero <ru...@cefriel.it>.
Dear Santala
I attach a post by Herve Shu who answered me about similar problems
I had in calling a .NET service

--------------------------------------
I have successfully called a .Net WebService from Apache-SOAP under
following environment:
	Platform: Windows 2000
	HTTP Server: IIS 5.0 for Microsoft SOAP
	Apache-SOAP: Version 2.1 rc1
	Development tool: Visual Studio.NET beta version
	JDK: J2SE 1.3

Both MS.NET C# Web Service and Web Service using MS.NET ATL Server were
tested.

There are 2 special notes:
1. Data Type
MS.NET Web Services specify neither encoding style nor xsi:type for return
values in its Response Envelope.
So, Apache-SOAP Client throws an exception:

No Deserializer found to deserialize a
'http://schemas.xmlsoap.org/soap/envelope/:Parameter' using encoding style
'null'.

Apache-SOAP Client needs to register all necessary type mappings before
making call to server. Example:
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    ParameterSerializer ps = new ParameterSerializer();
    StringDeserializer sd = new StringDeserializer();

smr.mapTypes(null,RPCConstants.Q_ELEM_PARAMETER,Parameter.class,null,ps);
    smr.mapTypes(null,new QName("","name"),null,null,sd);
    call.setSOAPMappingRegistry(smr);

2. Content Type
Web Service using C# does not understand "text/xml; charset=utf-8" content
type which is used by Apache-SOAP. This causes a Client Fault:

System.Web.Services.Protocols.SoapException: Server found request content
type to be 'text/xml; charset=utf-8', but expected 'text/xml'.

If we change TransportMessage.java to hardcode "text/xml" for content type,
it works fine.


>From your previous mail, I think you use C# Web Service since Web Service
using ATL Server contains automatically namespace like <snp:tagname> in its
response envelope.
To work with C# Web Service, you must add a SoapMethod attribute for your
Web method like:
	[ SoapMethod(Action="urn:AddressService#GetList",
		  RequestNamespace="urn:AddressService",
		  ResponseNamespace="urn:AddressService",
		  ResponseElementName="GetListResponse") ]
Thus, the response envelope will contain a namespace definition like:
	<GetListResponse xmlns="urn:AddressService">
and Apach-SOAP can correctly unmarshall the return value.

Hope this helps

Herve
-----------------------------------------


Moreover you can find also a way of doing it programmatically, though I've
not tried it yet,
in the example lemurlabs Fortune.java in the cvs repository:

http://xml.apache.org/websrc/cvsweb.cgi/xml-soap/java/samples/lemurlabs/Fort
une.java?annotate=1.1

hope this help.

Best Regards

Giovanni


-----Original Message-----
From: Santala Arto [mailto:Arto.Santala@tieturi.fi]
Sent: giovedì 12 aprile 2001 13:30
To: 'soap-user@xml.apache.org'
Subject: Content-Type: text/xml; charset=utf-8



I have a problem with Apache SOAP when attaching to Windows .NET services.
Apache sends a header like this:

Content-Type: text/xml; charset=utf-8

And server responds:
 <soap:faultstring>System.Web.Services.Protocols.SoapException: Server found
request content type to be 'text/xml; charset=utf-8', but expected
'text/xml'.
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.Invoke()
   at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</soap:f
aultstring>

So it seems clear to me that server can't handle charset declaration at
apache request.

Question: How do I handle this? Is there any way to alter the HTTP headers
of Apache soap envelope? I didn't find any way to do this while I took a
look to the API, it was really sparsely documented. Does anyone know (or can
make an educated quess?)



---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org