Issue with response from SOAP WebService

Issue with response from SOAP WebService

  
We have a webservice written using J2EE technology. It returns the data using content type  test/xml and charset utf-8 and the encoding used is UTF-8. The raw output header is as below

HTTP/1.1 200 OK
Date: Thu, 30 Apr 2015 05:08:20 GMT
Transfer-Encoding: chunked
Content-Type: text/xml; charset=utf-8
X-Powered-By: Servlet/2.5 JSP/2.1

<?xml version="1.0" encoding="UTF-8"?>

When we consume this in Outsystems 8.0.1.12, the datatype for output is set to Text and the error we receive is

Message:
Scheduler Service: Error executing request http://127.0.0.1/ProductHubConnect_Te/_TimerHandler.asmx for Timer ImportAndBootstrapInEnterpriseManager. Request duration = 0 secs. [Will retry later]
Stack:
System.InvalidOperationException: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.

Is it due to the encoding. Please help.

Thanks,
Pravin Mukhedkar
Hi Pravin,

That looks like the web reference is making the request and getting a html page (it could be an error page or proxy page for example) instead of getting the actual web service response.

Can you copy here the log line from the Web References log screen?
Also if you go in Service Center to your eSpace configuration page, in the Web Services tab what is the effective url that it displays for your web reference?

Regards,
João Rosado
Hello João,

Thanks for the response. Please find below the log from web reference log screen. We could access the WebService and execute using soapUI client.

Error Detail
Back to Log
Id:
6056e6ee-ec98-465d-998e-aace185a2afd
Time of Log:
04-30-2015 02:51:52
eSpace:
ProductHubConnect
Tenant:
Users
User:
(8455)
Session Id:
z3xkeg45fnbv0f55dmi242eq
Server:
US03OSDEVF01
Module:
Web Reference
Message:
The request failed with HTTP status 404: Not Found.
Stack:
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at ssProductHubConnect.WRefMDM_Canonical_File.WRefMDM_Canonical_File.NewOperation(String inWSpartnumber, String& outWSCanonicaloutput)
-Env-
eSpaceVer: 70 (Id=47999, PubId=52303, CompiledWith=8.0.1.25)
RequestUrl: http://dev.eapps.logitech.com/ProductHubConnect/WebServices_Connection.aspx (Method: POST)
AppDomain: /LM/W3SVC/1/ROOT/ProductHubConnect-127-130748609810439417
FilePath: D:\...\PS\running\ProductHubConnect.1693616844\WebServices_Connection.aspx
Locale: en-US
DateFormat: MM-dd-yyyy
PID: 3344 ('w3wp', Started='4/29/2015 9:07:37 AM', Priv=1005Mb, Virt=6446Mb)
TID: 95
Thread Name:
.NET: 2.0.50727.5485

Thanks,
Pravin Mukhedkar

Please find below the other response which mentions about issue with encoding and content type.

Id:
3c5b0863-3b0a-427e-9a42-4feeaabe76a2
Time of Log:
04-29-2015 03:59:40
eSpace:
ProductHubConnect_Te
Tenant:
User:
Session Id:
Server:
US03OSDEVF01
Module:
Scheduler
Message:
Scheduler Service: Error executing request
http://127.0.0.1/ProductHubConnect_Te/_TimerHandler.asmx for Timer
ImportAndBootstrapInEnterpriseManager. Request duration = 0 secs. [Will
retry later]
Stack:
System.InvalidOperationException: Client found response content type of
'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Error</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<META NAME="ROBOTS" CONTENT="NOINDEX"/>
<style type="text/css">
.NormalText { FONT-SIZE: 10pt; FONT-FAMILY: Arial, Helvetica, sans-serif
}

.ErrorMessage { FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #ff3333;
FONT-FAMILY: Arial, Helvetica, sans-serif }
.DetailButton { BORDER-RIGHT: ...</b><br>   at
OutSystems.HubEdition.RuntimePlatform.AppInfo..ctor(ESpaceInfoForAppStart
eSpaceInfo)
   at ssProductHubConnect_Te.Global.Application_Start(Object sender,
EventArgs e)<br></pre>
</div>
<p class="NormalText">
Please rewrite the application URL.
</p>
</body>
</HTML>
--.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse
(SoapClientMessage message, WebResponse response, Stream responseStream,
Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
   at OutSystems.HubEdition.Scheduler.TimerHandler.ExecuteTimer(String
ssKey, Int32 timeout, Int32 tenantId)
   at OutSystems.HubEdition.Scheduler.TimerJob.Execute()
   at
OutSystems.HubEdition.Scheduler.SchedulerProducerConsumer`1.Execute(Job
job)
-Env-
eSpaceVer: 0 (Id=0, PubId=0, CompiledWith=8.0.1.25)
RequestUrl:  (Method: )
AppDomain: Scheduler.exe
Path: D:\...\PS\
Locale:
DateFormat: yyyy-M-d
PID: 2032 ('Scheduler', Started='4/26/2015 10:49:21 AM', Priv=78Mb,
Virt=591Mb)
TID: 11
Thread Name: Timer Processor #1
.NET: 2.0.50727.5485
Hi,

You look like having 2 different problems there.

The second stack (and the one that complains about the content type) has is not related your web reference.
From what I can see it caused by an eSpace called "ProductHubConnect_Te" that is not correctly published or has errors loading. You should either republish it or delete it (since you are not saying that that module is not working most likelly it's not being used).

As for the first stack, yes that looks like a Web Reference problem.
It says "The request failed with HTTP status 404: Not Found.".

Go to Service Center -> Monitoring -> Web References.
Filter the eSpace by "ProductHubConnect".
It should say the Url that it is calling there.

Also go to Service Center -> Factory -> eSpaces
Select ProductHubConnect in the list.
Select the "Web References" tab (or "Web Services" ..not sure how that was on that version)
You should have a section with configurations for your "MDM_Canonical_File" Web Reference there.
Click on it.
What are the "Default URL" and the "Effective URL" that are configured?

Regards,
João Rosado