-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathGXWebProcedure.java
More file actions
117 lines (95 loc) · 2.99 KB
/
GXWebProcedure.java
File metadata and controls
117 lines (95 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package com.genexus.webpanels;
import java.io.PrintWriter;
import com.genexus.GXObjectBase;
import com.genexus.servlet.IServletContext;
import com.genexus.servlet.ServletContext;
import com.genexus.servlet.http.IHttpServletRequest;
import com.genexus.servlet.http.HttpServletRequest;
import com.genexus.servlet.http.IHttpServletResponse;
import com.genexus.servlet.http.HttpServletResponse;
import com.genexus.xml.ws.WebServiceContext;
import com.genexus.xml.ws.handler.MessageContext;
import com.genexus.ModelContext;
import com.genexus.db.UserInformation;
import com.genexus.diagnostics.core.ILogger;
import com.genexus.diagnostics.core.LogManager;
import com.genexus.internet.HttpContext;
import com.genexus.ws.GXHandlerChain;
public abstract class GXWebProcedure extends GXObjectBase
{
private static final ILogger logger = LogManager.getLogger(GXWebProcedure.class);
public static final int IN_NEW_UTL = -2;
protected abstract void initialize();
public GXWebProcedure(HttpContext httpContext)
{
super(httpContext);
}
public GXWebProcedure(WebServiceContext wsContext)
{
try
{
MessageContext msg = new MessageContext(wsContext);
IHttpServletRequest request = new HttpServletRequest(msg.get(msg.getSERVLET_REQUEST()));
IHttpServletResponse response = new HttpServletResponse(msg.get(msg.getSERVLET_RESPONSE()));
IServletContext myContext = new ServletContext(msg.get(msg.getSERVLET_CONTEXT()));
String messageBody = (String)msg.get(GXHandlerChain.GX_SOAP_BODY);
HttpContext httpContext = new HttpContextWeb(request.getMethod(), request, response, myContext);
httpContext.getHttpRequest().setSoapMessageBody(messageBody);
init(httpContext, getClass());
}
catch(Throwable e)
{
logger.error("Could not initialize Web Service", e);
}
}
public GXWebProcedure(int remoteHandle , ModelContext context)
{
this(false, remoteHandle ,context);
}
public GXWebProcedure(boolean inNewUTL, int remoteHandle , ModelContext context) {
super(remoteHandle ,context);
if(inNewUTL) {
this.remoteHandle = IN_NEW_UTL;
}
}
protected void initState(ModelContext context, UserInformation ui)
{
super.initState(context, ui);
if(httpContext.getHttpSecure() == 0)httpContext.setHeader("pragma", "no-cache");
if (!isBufferedResponse()) {
httpContext.setResponseBufferMode(HttpContext.ResponseBufferMode.DISABLED);
}
initialize();
}
protected boolean isBufferedResponse() {
return true;
}
protected void preExecute()
{
httpContext.setStream();
httpContext.GX_xmlwrt.setWriter(new PrintWriter(httpContext.getOutputStream()));
}
protected void cleanup()
{
super.cleanup();
if (httpContext != null && !httpContext.willRedirect() && httpContext.isLocalStorageSupported())
{
httpContext.deleteReferer();
}
}
public boolean isMasterPage()
{
return false;
}
public void release()
{
}
protected boolean isSpaSupported()
{
return false;
}
protected void callWebObject(String url)
{
httpContext.wjLoc = url;
}
}