Regex for a URL
How do I write a regex for the following URL. I am trying to write a regex rule in Oracle WebCache.
/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=198&my=247&request=gettile&zoomlevel=3
Thanks,
I would start with a not so restrictiv expression.
something like
SQL> with testdata as (select '/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=198&my=247&request=gettile&zoomlevel=3' urlstring from dual union all
2 select '/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=200&my=300&request=gettile&zoomlevel=180' urlstring from dual union all
3 select '/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&my=300&mx=200&request=gettile&zoomlevel=0' urlstring from dual union all
4 select '/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=100&my=200&request=gettile' urlstring from dual union all
5 select 'somethingelse' urlstring from dual)
6 select urlstring
7 from testdata
8 where regexp_like(urlstring,'^/myserver.domain.com:7779/mapviewer/mcserver[?]format=[PNG|SVG].+[mapcache=mvdemo.demo_map].+[request=gettile]');
URLSTRING
/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map
&mx=198&my=247&request=gettile&zoomlevel=3
/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map
&mx=200&my=300&request=gettile&zoomlevel=180
/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map
&my=300&mx=200&request=gettile&zoomlevel=0
/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map
&mx=100&my=200&request=gettile
SQL> In this example the url needs to include the mapcache, format and request parameter.
Edited by: Sven W. on Oct 29, 2008 7:23 PM
Similar Messages
-
Regex for url pattern validation
Hi,
I am trying to find a regex for Url pattern validation that is not too restrictive.
Please let me know, if anyone is using a pattern for their applications.
Thanks
Mayank Sharmaare you talking about xml schema restriction?
<xs:element name="url">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(https?://)?[-\w.]+(:\d{2,5})?(/([\w/_.]*)?)?" />
</xs:restriction>
</xs:simpleType>
</xs:element> -
HI I am validating a field which takes a url as input from the user.So the url may contain http,https,ftp links or the user may specify the ip address.So can anyone please help me out to create a suitable regex for that.I just need to check the validness of link and not that it exists or not.
here i have changed the regex as suggested by you but
it returns true even for http://com.com@
which is invalid.
So it did not worked :-(It did not work, because you did not use it correct:
public class Foo {
private static boolean isValidUrl(String url) {
return url.matches("(https?|ftp)://www\\.\\w+\\.\\w+");
public static void main(String[] args) {
String[] urls = {
"http://com.com@",
"http://www.com.com",
"http://www.com.nl",
"http://www.com.co.uk",
"http://www.com"
for(String url : urls) {
System.out.println(url+" valid? "+isValidUrl(url));
} -
I am not a programmer, but I have to write a rule for CACHING the following URL that is being generated with "GET_QUERYSTRING".
/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=198&my=247&request=gettile&zoomlevel=3
As you can see, I would like to cache all the PNG map tiles, but I don't know how to come up with Regular Expression (regex) for the above URL.
Thanks,are you talking about xml schema restriction?
<xs:element name="url">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="(https?://)?[-\w.]+(:\d{2,5})?(/([\w/_.]*)?)?" />
</xs:restriction>
</xs:simpleType>
</xs:element> -
I am trying to parse the html output of a web page. I need to grab all the URLs which are in hrefs, actions etc inside.
I am using the regex pattern
Pattern p = Pattern.compile("http.*?//\\S+[^\"]");
(basically grab anything that starts with http till you hit a double quote and white space)
When I do a find using matcher it gets me URLs which are like
href="http://www.abcd.com/" or
href="http://www.abcd.com/mypath" or
href="http://www.abcd.com/mypath?p1=v1&p2=v2"
But it doesn't work for something like
href="http://www.abcd.com"><img src="/abcd/my.gif"
Is there a good pattern to catch all of these varaints of URLs
ThanksFirst off, your regex is wrong. After matching the double slash, it gobbles up as many non-whitespace characters as it can, then looks for a character that is not a double-quote. When the attribute value is followed by a space, the \S+ will stop at that point, then the [^"] will match the space. This at least give you a usable result; all you have to do is strip off the quote and the space. But if the value is immediately followed by a closing angle-bracket, the \S+ just keeps on gobbling. In your last example, it won't stop until it hits the space after the "img"--and now all you have is garbage.
Here's a better way to extract URL's:
Pattern p = Pattern.compile(
"(href|src|background) # ...and whatever other attr's \n" +
"\\s*=\\s* \n" +
"(?: \n" +
" \"([^\"]+)\" # anything in double quotes \n" +
" | # or \n" +
" \'([^\']+)\' # anything in single quotes \n" +
" | # or \n" +
" ([^\\s>]+) # any non-WS except closing bracket \n" +
")", Pattern.COMMENTS);Instead of looking for the URL's themselves, it looks for the names of attributes that should have URL's as values. The attribute name will be captured in group(1) and the URL will be in group(2), group(3) or group(4), depending on whether it was double-quoted, single-quoted or not quoted. If need be, you can verify that the value is indeed a URL using the java.net.URL class. -
Error while creating a deployable proxy for a URL in NWDS
Hi ,
There is a requirement for calling a webservice in the .NET platform from JAVA using NWDS. The webservice of the server is pinged using the URL of the webservice. when the URL is passed in the WS navigator of CRD ( that is Development Server) , the response is retreived successfully . The version of NWDS is 7.0.23.
we are facing problem when we are trying to create a Deployable proxy in NWDS by using the following steps :
1) Create a Development Component
2) Select the Deployable Proxy
3) Create the Client Proxy Defintion of the created DC
At step 3 , when we giving the url or WSDL link like "http:// www3.authoring.syngenta/newswebservice.asmx?WSDL" (this is just for example) , it is showing as "Invalid wsdl or wsdl not found " . so that we are not able to procees further.
When we are trying to create proxy the for the WSDL link like " http:// www.authoring.syngenta/newswebservice.asmx?WSDL" , we are able to create successfully.
can anyone suggest why we are able to create the proxy for the URL "http:// www.authoring.syngenta/newswebservice.asmx?WSDL" and not for the other URL.
Any pointers or suggestions are very helpful.
Thanks and Regards,
SreedeviLate response I know, but I have solved a similar problem recently and thought I would share.
Firstly, the problem is not with the namespace. The "Namespace ..." part is just stating the namespace the "Incorrect Value" has. So this error is complaining about the value "Unknown" - which isn't very helpful.
It appears the SAP SE80 importer does not like elements like the following because it can't understand <s:element ref="s:schema" />. It appears this is a common thing to be included in .NET generated WSDLs.
<s:element minOccurs="0" maxOccurs="1" name="GetCursDynamicResult"> <s:complexType> <s:sequence> <s:element ref="s:schema" /> <s:any /> </s:sequence> </s:complexType></s:element>
SAP will also not like this example as it does not support mixed content (see: http://www.w3schools.com/schema/schema_complex_mixed.asp)
<s:element minOccurs="0" maxOccurs="1" name="SaldoXMLResult">
<s:complexType mixed="true">
<s:sequence>
<s:any />
</s:sequence>
</s:complexType>
</s:element>
You can "Fix" the problem in both cases by removing the offending text in a local copy of the WSDL file so remove line 4 in the first example and change line 2 in the second to <s:complexType> the proxy can then be generated. No idea if the resulting service will be fully operational though! -
Exception on creation of service metadata for WSDL URL
Hi expert,
im consuming a wsdl file in my wdj dc , and on trying to execute im getting exception as follows .
WsdlApp--com.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for WSDL URL 'E:\***********\MIOS_*********_********.wsdl' and service factory configuration 'null'
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:422)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.readOperationsFromWSDL(WSModelInfo.java:372)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadataInternal(WSModelInfo.java:342)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadata(WSModelInfo.java:326)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo$Cache.getModelInfo(WSModelInfo.java:199)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getModelInfoFromCacheOrCreate(WSModelInfo.java:1035)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getModelInfoFromCacheOrCreate(WSModelInfo.java:248)
at com.sap.tc.webdynpro.model.webservice.gci.WSTypedModel.<init>(WSTypedModel.java:41)
at com.*****.wsdlwdj.batch.****************Batch.<init>(******************Batch.java:51)
at com.*****.wsdlwdj.comp.*************Component.test**********Auth(************Component.java:266)
at com.*****.wsdlwdj.comp.wdp.Internal****Component.test****Auth(Internal********Component.java:331)
at com.*****.wsdlwdj.comp.WsdlView.wdDoInit(WsdlView.java:97)
at com.*****.wsdlwdj.comp.wdp.InternalWsdlView.wdDoInit(InternalWsdlView.java:129)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:182)
at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:177)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:783)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:303)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:185)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:321)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:377)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.setSpnegoParameter(RequestManager.java:963)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:157)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1064)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.WebserviceClientException: GenericServiceFactory initialization problem. Could not load web service model. See nested exception for details.
at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:158)
at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.<init>(DGenericServiceImpl.java:56)
at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:92)
at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:114)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:420)
... 55 more
Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.ProxyGeneratorException: Proxy Generator Error. Problem with WSDL file parsing. See nested message.
at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProxyGenerator.generateProxy(ProxyGenerator.java:182)
at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:155)
... 59 more
Caused by: com.sap.engine.lib.xml.util.NestedException: IO Exception occurred while parsing file:/usr/sap/*****/JC**/j2ee/cluster/server1/E:/****/FolderName/WSDLNAME.wsdl (No such file or directory) -> java.io.FileNotFoundException: /usr/sap/***/JC**/j2ee/cluster/server1/E:/WSDL FILE/FolderName/wsdlname.wsdl (No such file or directory)
at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadDOMDocument(WSDLDOMLoader.java:1039)
at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadWSDLDocument(WSDLDOMLoader.java:1126)
at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProxyGenerator.generateProxy(ProxyGenerator.java:178)
... 60 more
Caused by: java.io.FileNotFoundException: /usr/sap/***/JC**/j2ee/cluster/server1/E:/WSDL FILE/FolderName/wsdlname.wsdl (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
at java.net.URL.openStream(URL.java:913)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:201)
at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:263)
at com.sap.engine.lib.xml.parser.Parser.parse_DTDValidation(Parser.java:260)
at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:271)
at com.sap.engine.lib.xml.parser.DOMParser.parse(DOMParser.java:101)
at com.sap.engine.lib.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:127)
at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadDOMDocument(WSDLDOMLoader.java:1023)
... 62 more
Regards
Govardanim using 7.01 and here we have options to use No Logical Destinations , but now i created destinations at visual admin at Server>Services>Web Service Security>WebService Clients>Sap.com-->Dynamic WS Proxies., as WS_METADATA_DEST and WS_MODELDATA_DEST and have filled in other details too like url , user name , password etc
now im getting another error like as shown below please help
com.****.wsdlwdj.applicaiton.WsdlApp
[EXCEPTION]
com.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for WS metadata destination 'WS_METADATA_DEST' and WS interface '{http://****.com/****}MIOS_Matrix***********'. One possible reason is that the metadata destination 'WS_METADATA_DEST' has not been properly configured; check configuration.
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:440)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.readOperationsFromWSDL(WSModelInfo.java:372)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadataInternal(WSModelInfo.java:342)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadata(WSModelInfo.java:326)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo$Cache.getModelInfo(WSModelInfo.java:199)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getModelInfoFromCacheOrCreate(WSModelInfo.java:1035)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getModelInfoFromCacheOrCreate(WSModelInfo.java:248)
at com.sap.tc.webdynpro.model.webservice.gci.WSTypedModel.<init>(WSTypedModel.java:41)
at com.****.wsdlwdj.model.test.TestModel.<init>(TestModel.java:51)
at com.****.wsdlwdj.comp.VcWsdlComponent.matrixAuthExecut(VcWsdlComponent.java:448)
at com.****.wsdlwdj.comp.wdp.InternalVcWsdlComponent.matrixAuthExecut(InternalVcWsdlComponent.java:280)
at com.****.wsdlwdj.comp.VcWsdlComponent.wdDoInit(VcWsdlComponent.java:132)
at com.****.wsdlwdj.comp.wdp.InternalVcWsdlComponent.wdDoInit(InternalVcWsdlComponent.java:225)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:108)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:430)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:362)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:783)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:303)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:185)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:321)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:377)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.setSpnegoParameter(RequestManager.java:963)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:157)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1064)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
Caused by: com.sap.engine.services.webservices.espbase.discovery.BaseIOException: Invalid Response Code 500 while accessing URL: http://devpid:8000/sap/xi/engine?type=entry&version=3.0&Sender.Service=BS_****_PORTAL&Interface=http%3A%2F%2F****.com%2Fbank_report%5EMIOS_Authorizers_List_Portal&sap-user=xi_portal&sap-password=****1234. Response Message: Empty HTTP request received. Content Type: text/xml. Body Content: <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header>
</SOAP:Header>
<SOAP:Body>
<SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>SOAP:Client</faultcode><faultstring>Empty HTTP request received</faultstring><faultactor>http://sap.com/xi/XI/Message/30</faultactor><detail><SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1"><SAP:Category>XIProtocol</SAP:Category><SAP:Code area="MESSAGE">EMPTY_HTTP_REQUEST_RECEIVED</SAP:Code><SAP:P1/><SAP:P2/><SAP:P3/><SAP:P4/><SAP:AdditionalText/><SAP:ApplicationFaultMessage namespace=""/><SAP:Stack>Empty HTTP query received; message processing not possible
</SAP:Stack></SAP:Error></detail></SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>
at com.sap.engine.services.webservices.server.management.discovery.DestinationsResolver.resolveURL(DestinationsResolver.java:246)
at com.sap.engine.services.webservices.server.management.discovery.DestinationsResolver.resolveEntity(DestinationsResolver.java:130)
at com.sap.engine.services.webservices.espbase.query.WSQueryImpl.initialize(WSQueryImpl.java:184)
at com.sap.engine.services.webservices.espbase.query.WSQueryImpl.findWSInterfaces(WSQueryImpl.java:151)
at com.sap.engine.services.webservices.server.management.discovery.ServiceDiscoveryImpl.getWSDLUrl(ServiceDiscoveryImpl.java:71)
at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:134)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:429)
... 49 more -
Steps to generate Token for opendoc url call in XI3.1
Hi Guys,
I am quite new to Sdk's and java programming .
I am trying to get some help in generating token for opendoc url to avoid login while trying to access a report in Infoview.
From a previous post I got this code:
<%@ page import="com.crystaldecisions.sdk.framework.*" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
<%
boolean loginSuccessful = false;
IEnterpriseSession boEnterpriseSession = null;
String username = "Administrator";
String password = "pwd";
String cmsname = "CMS";
String authenticationType = "secEnterprise";
try {
//Log in.
boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
if (boEnterpriseSession == null) {
out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
} else {
loginSuccessful = true;
} catch (SDKException sdkEx) {
out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");
if (loginSuccessful) {
ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
String infoViewURL = null;
String tokenParam = null;
String redirectURL = null;
infoViewURL = "http://server:8080/InfoViewApp/logon.jsp";
tokenParam = "ivsLogonToken=" + logonToken;
redirectURL = infoViewURL + "&" + tokenParam;
response.sendRedirect(redirectURL);
%>
The problem is I don't know where to put this code in the opendoc.jsp file.
I tried to create a custom OpenDoc.jsp with a above code, leaving the original opendoc.jsp as it is. And used this custom jsp file in the opendoc url. This is taking me to Infoview login page and I see taht a token is created at the end of the url but it is not passed.
Can somebody help me to understand where exactly to put this code in the opendoc.jsp and any correction to this code or additional steps to get it working.
Any help is greatly appreciated!The code above is meant to redirect you to InfoView. Change the last bit of code as follows:
//add any opendocument parameters to the URL here
openDocURL = "http://server:8080/OpenDocument/opendoc/openDocument.jsp"
tokenParam = "token=" + logonToken;
redirectURL = openDocURL + "&" + tokenParam;
response.sendRedirect(redirectURL); -
The precondition on the request for the URL / evaluated to false
Hi,
I get error message when connect on secure 443 port:
"The precondition on the request for the URL / evaluated to false."
Problem in:
<Location />
SetHandler weblogic-handler
WLExcludePathOrMimeType /DocumentServer
</Location>
It works in httpd.conf, but does NOT work in ssl.conf
We are using WL8.1 and Apache 2.0.48
Thanks,
Oleg.Have you looked at the support pattern for SSL and Web Server plug-ins?
https://support.bea.com/application_content/product_portlets/support_patterns/wls/SSLAndPlug-inPattern.html -
Help on generating token for opendoc url in XI3.1
Hi Guys,
I am trying to get some help in generating token for opendoc url to avoid login while trying to access a report in Infoview.
From a previous post I got this code:
<%@ page import="com.crystaldecisions.sdk.framework.*" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
<%
boolean loginSuccessful = false;
IEnterpriseSession boEnterpriseSession = null;
String username = "Administrator";
String password = "pwd";
String cmsname = "CMS";
String authenticationType = "secEnterprise";
try {
//Log in.
boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
if (boEnterpriseSession == null) {
out.print("Unable to login.");
} else {
loginSuccessful = true;
} catch (SDKException sdkEx) {
out.print("ERROR ENCOUNTERED
" + sdkEx + "");
if (loginSuccessful) {
ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
String infoViewURL = null;
String tokenParam = null;
String redirectURL = null;
infoViewURL = "http://server:8080/InfoViewApp/logon.jsp";
tokenParam = "ivsLogonToken=" + logonToken;
redirectURL = infoViewURL + "&" + tokenParam;
response.sendRedirect(redirectURL);
%>
The problem is I don't know where to put this code in the opendoc.jsp file.
I tried to create a custom OpenDoc.jsp with a above code, leaving the original opendoc.jsp as it is. And used this custom jsp file in the opendoc url. This is taking me to Infoview login page and I see taht a token is created at the end of the url but it is not passed.
Can somebody help me to understand where exactly to put this code in the opendoc.jsp and any correction to this code or additional steps to get it working.
Any help is greatly appreciatedStratos,
Thanks for your inputs,
I changed the code as you suggested , now my whole code looks like :
<%@ page import="com.crystaldecisions.sdk.framework.*" %>
<%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
<%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
<%
boolean loginSuccessful = false;
IEnterpriseSession boEnterpriseSession = null;
String username = "user";
String password = "Password";
String cmsname = "Server";
String authenticationType = "secEnterprise";
try {
//Log in.
boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
if (boEnterpriseSession == null) {
out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
} else {
loginSuccessful = true;
} catch (SDKException sdkEx) {
out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");
if (loginSuccessful) {
ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
//String logonToken = boLogonTokenMgr.getDefaultToken();
String infoViewURL = null;
String tokenParam = null;
String redirectURL = null;
infoViewURL = "http://Server:8080/InfoViewApp/logon.jsp";
tokenParam = "ivsLogonToken=" + logonToken;
redirectURL = infoViewURL + "&" + tokenParam;
pageContext.forward( "openDocument.jsp?iDocID=" + 4668 + "&token=" + tokenParam);
%>
But I am still getting the Infoview Login Page . The url on the login page is
http://server:8080/OpenDocument/opendoc/logonTrustedAuth.do?appKind=InfoView&iDocID=4668&isApplication=true&token=ivsLogonToken%server%3A6400%4021181JIipxt70VM0kd90v21179JFd4dHn7kW2FKSBi
We can see that a token is being generated and appended to this url but it is not passing the user name and password.
Please let me know what you think about this. -
ISAPI plugin setup for Idempotent --- URL level
The document http://www.weblogic.com/docs51/admindocs/isapi.html#ini says
Idempotent=ON/OFF is a URL level flag, does this mean I can indicate which
servlet is idempotent and which is not ? but it fails to tell me how to set
it for different URL, what's the setup look like?
iisproxy.ini
weblogichost=myserver
weblogicport=7001
Idempotent=ON --- this would make everything idempontent, how about if I
want /idem/*.jsp all idempotent and /noidem/*.jsp not idempotent ?
thanks
No you cannot set it per servlet, it is an application level flag.
I think the doc is confusing so we will correct it.
Current doc says:
"This is a URL level flag. By default it will be "ON". This means that if the
servers do not respond within HungServerRecoverSecs, the plug-ins will failover.
If set to "OFF" the plug-ins will not failover. It can be
set differently for different URL's or Mime types."
The correct statement for ISAPI should be:
"This is a application level flag. But it can be set differently for different
iisproxy.ini files. By default it will be
"ON". This means that if the servers do not respond within
HungServerRecoverSecs, the plug-ins will
failover. If set to "OFF" the plug-ins will not failover."
By "It can be set differently for different iisproxy.ini files", I mean the
following. You can point to different
iisproxy.dll's for different Virtual directories in IIS. So in each of those
IISproxy.ini files
you can have a different value for the Idempotent parameter.
NSAPI and Apache plugins support multiple objects so the above statement is true
upto some extent for them.
But then again you cannot set it for each servlet differently there too, unless
you have a didicated object for
each servlet in NSAPI,. which is theoretically correct but would be a ridiculous
design :)
Thanks for pointing out. We will correct the docs. Sorry for the confusion.
--Vinod.
Tony Lu wrote:
> The document http://www.weblogic.com/docs51/admindocs/isapi.html#ini says
> Idempotent=ON/OFF is a URL level flag, does this mean I can indicate which
> servlet is idempotent and which is not ? but it fails to tell me how to set
> it for different URL, what's the setup look like?
>
> iisproxy.ini
>
> weblogichost=myserver
> weblogicport=7001
> Idempotent=ON --- this would make everything idempontent, how about if I
> want /idem/*.jsp all idempotent and /noidem/*.jsp not idempotent ?
>
> thanks
-
Hi,
im trying to capture comma from a csv string, im unable to exclude the string having comma in between text part.
eg 1)
sample string-> 4,5656,123123,'this is sample text',''
expected regex output->4{color:#ff0000},{color}5656{color:#ff0000},{color}123123{color:#ff0000},{color}'this is sample text'{color:#ff0000},{color}''
eg2)
sample string-> 4,5656,123123,'this is, sample text',''
expected regex output->4{color:#ff0000},{color}5656{color:#ff0000},{color}123123{color:#ff0000},{color}'this is, sample text'{color:#ff0000},{color}''
In above example the text containing comma in between of single quote is excluded
Can anybody guide me through this(need regex for eg2)? Any kind of assistance would be priceless!!!Encephalopathic wrote:
You may want to skip regex and look into using a Java csv parser which I heard exist in the public domain. I don't have any links but sourceforge and/or google can help.http://ostermiller.org/utils/CSV.html -
"cannot create jbcd driver of class " for connect URL 'null'" error
I am trying to get an application that is currently working fine on a Windows platform to work in a Linux environment.
One thing that is different from my setup in Windows, and also one that I have no experience with, is the Linux-Ubuntu default install of Apache uses Virtual Hosts and Tomcat's equivalent multiple sessions.
I'm running the app out of the usr/share/tomcat6/webapps/msgboard instance of Tomcat vs var/lib/tomcat6.
I am calling the application from Apache Virtual Host port 80 using mod_jk. The application cannot run under native Tomcat because of the extensive use of PHP. Everything else in the application is working correctly including a DWR (Ajax) servlet. However I also tried a simple test app from native Tomcat and got the same results.
I also tried connecting with jdbc:mysql://localhost:3306/msgboard?autoreconnect=true&user=root&password=password at the terminal prompt and got
bash: jdbc:mysql://localhost/msgboard?autoreconnect=true: No such file or directory
[1]7074
[2] 7048
[1] Exit 127 jdbc:mysql://localhost/msgboard?autoreconnect=true
[2]+ Donesyslog error is
Feb 23, 2009 3:01:51 PM org.directwebremoting.util.CommonsLoggingOutput info INFO: Exec: Online.getPosts()
Feb 23 15:01:51 ubuntu jsvc.exec[6779]: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Feb 23 15:01:51 ubuntu jsvc.exec[6779]: Caused by: java.sql.SQLException: No suitable driverFollowing is all the pertinent setup info for reference and critique. Any suggestions would be greatly appreciated.
Apache2.2
Tomcat6
JDBC
mod_jk
Java (not sure what ver, it's the default Ubuntu install ver.)
PHP
Currently I am pointing to mysql-connector-java.jar in my CLASSPATH at /usr/share/java/mysql-connector-java.jar added symlinks commons-dbcp.jar, commons-logging.jar to usr/share/tomcat6/lib
Application is deployed from usr/share/tomcat6/webapps/msgboard
The basic code snippet in class calling the jdbc
WEB-INF/classes/dbLink.class
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/msgboardDB");
WEB-INF/web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="msgboard">
<display-name>Message Board</display-name>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/msgboardDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
META-INF/context.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<Context path="/msgboard" docBase="msgboard"
debug="5" reloadable="true" crossContext="true">
<Resource name="jdbc/msgboardDB"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="root"
password="thePassword"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/msgboard?autoReconnect=true"/>
</Context>
I also included a symlink to this in var/lib/tomcat6/config named msgboard.xml
per instruction at http://ubuntuforums.org/showthread.php?t=430133 and have since removed it.
my.cnf
[client]
port = 3306
bind-address = 127.0.0.1
permissions set in /etc/tomcat6/policy.d/04webapps.policy
permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve,listen,accept";
per instruction at http://ubuntuforums.org/showthread.php?t=430133
other permiissions set /etc/tomcat6/policy.d/50local.policy
grant codeBase "file:/usr/share/tomcat6/webapps/msgboard/-" {
permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve,listen,accept";
grant codeBase "file:/usr/share/tomcat6/webapps/msgboard/WEB-INF/classes/-" {
permission java.io.FilePermission "/usr/share/tomcat6/webapps/msgboard/WEB-INF/classes/logging.properties", "read";
grant codeBase "jar:file:/usr/share/tomcat6/webapps/msgboard/WEB-INF/lib/mysql-connector-java-5.1.6.jar!/-" {
permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve,listen,accept";
I even tried setting Tomcat Security to "no" per instruction at
http://webui.sourcelabs.com/ubuntu/mail/user/threads/Tomcat_connecting_to_MySQL_-Ubuntu8.10_Server.meta
http://ubuntuforums.org/showthread.php?t=1034957&highlight=apache+tomcat+jdbc
http://ubuntuforums.org/showthread.php?t=66615
http://ubuntuforums.org/showthread.php?t=33601&highlight=java+mysql
http://ubuntuforums.org/showthread.php?t=430133
http://programminglinuxblog.blogspot.com/2008/03/connection-pooling-with-java-all.html
http://webui.sourcelabs.com/ubuntu/mail/user/threads/Tomcat_connecting_to_MySQL_-Ubuntu8.10_Server.metaSOLUTION
I had to add
<Resource name="jdbc/webappDB"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="root"
password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/webapp?autoReconnect=true"/>into /var/lib/tomcat6/conf/Catalina/localhost/ webapp.xml
Note: the above context file was created automatically after deploying the webapp. I had to add the <resource> to it.
The context I created in usr/share/tomcat_home/webapp/META_INF/context.xml is still there and has the same <resource>.defined in it. I did not verify whether or not it still needs to be there.
After that I had to add two policies
/var/lib/tomcat6/conf/policy.d/03catalina.policy
grant {
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.dbcp.*";
and 04webapps.policy
permission java.net.SocketPermission "127.0.0.1:3306", "connect,resolve,listen,accept";
That did the trick!
Other things that were done but have not been verified as to have any bearing on this issue.
I changed the active java from openjdk to java-sun
I added $tomcat_home/lib:$tomcat_home/lib/mysql-connector.jar:$tomcat_home/lib/commons-dbcp.jar to PATH
Changed CLASSPATH=usr/share/classpath:usr/share/java/commons-dbcp.jar:usr/share/java/mysql-connector.jar
Edited by: wlbragg on Feb 25, 2009 12:58 AM
Edited by: wlbragg on Feb 25, 2009 12:59 AM
Edited by: wlbragg on Feb 25, 2009 1:11 AM -
Regex For Contractions/Possessives
Hello,
I'm trying to construct a regex for contractions and possessives.
So, we want to validate strings like:
'tis
it's
Travis'
Ferdinand's
However, I can't seem to get the regex to handle the apostrophe correctly...
Here's what I have for regular contractions, (it's but not Travis' or 'tis)
token.matches("[\\w]+'[\\w]+") What should I be doing differently?
Thanks!
Edited by: chhasx on Sep 1, 2009 2:42 PMYou don't need the square brackets in this case. You shouldn't have + at the end of the second \w; there can be one or none, so it should be ?. Also it shouldn't be \w because it can only be "s". Also you're not covering the case "Travis's". Actually according to Strunk and White that's acceptable (preferred, IIRC) so maybe that's OK.
You're not checking for "his", "her", "hers", or "its".
This isn't internationalized either. -
I have been unable to find or determine how to define a ACL for a URL using
the RDBMSRealm. We have implemented the example RDBMSRealm and I have found
the following about setting ACLs on URLs
Setting ACLs on URLs
weblogic.security.urlAclFile=urlAclPolicyFile
The weblogic.security.urlAclFile property specifies the name of a policy
file that extends the access control provided by the weblogic.allow
properties for WebLogic Server servlets that serve web pages and files,
including HTML pages, HTTP Servlets, and JSP pages. In the urlAcl policy
file, you can grant users and groups access to specific files and
directories. See Controlling access on URLs for specifics on setting up your
urlAcl policy file.
I want the ACLs for URLs to be read from the RDBMSRealm not from a
urlAclPolicyFile. Can I do it?
Thanks for any help.there is no way to incorporate the ACL on URL into the RDBMSRealm. further, a
more forward-looking approach to this would be to use the URL access control
mechanisms in WebApplication DeploymentDescriptors. that way, it's J2EE
standard.
see also:
http://www.weblogic.com/docs51/classdocs/webappguide.html#dd_security
.paul
Jon Scoleri wrote:
I have been unable to find or determine how to define a ACL for a URL using
the RDBMSRealm. We have implemented the example RDBMSRealm and I have found
the following about setting ACLs on URLs
Setting ACLs on URLs
weblogic.security.urlAclFile=urlAclPolicyFile
The weblogic.security.urlAclFile property specifies the name of a policy
file that extends the access control provided by the weblogic.allow
properties for WebLogic Server servlets that serve web pages and files,
including HTML pages, HTTP Servlets, and JSP pages. In the urlAcl policy
file, you can grant users and groups access to specific files and
directories. See Controlling access on URLs for specifics on setting up your
urlAcl policy file.
I want the ACLs for URLs to be read from the RDBMSRealm not from a
urlAclPolicyFile. Can I do it?
Thanks for any help.
Maybe you are looking for
-
Smart Object as traditional link (as in InDesign or Illustrator)
Is there a way to link a smart object, so that updates are made to the originally placed object ....as opposed to creating a new vector file save in a temporaray folder. Is there a way to work with smart object like traditional links in InDesign and
-
How to open pdf document in other window by using java script
Hello All, I am working in R12 Application. My jdeveloper version is 10.1.3.3.0.3 I want to open pdf document in other window on clicking the button for that i have written following code in process request of the controller: pageContext.putJavaScrip
-
Where is the file menu on podcasts for the ipad?
I want to subscribe to something not on podcasts shop, but I need to enter the URL. I already know the URL but I can't find the location of the file menu. I want to know the location of the file menu for he IPAD, not Mac. And I don't have a Mac la
-
Debugging in script for F110 transaction
Hi all, For bank transfer form i have created a vendor document in FB60 and the corresponding document was created in F110. Script name for this bank transfer form is f110_d_avis.When customizing the script i have taken a z-copy of this script. From
-
I need people's take on iPhone cases with magnetic clasps. I want a case that covers my screen but I don't want to wreck my beautiful new iPhone!