Application Cookies does not change - weblogic

I am using weblogic server for my application.
I have configured cookies in the weblogic.xml file with the name TEST_COOKIE as below.
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<weblogic-version>10.3</weblogic-version>
<session-descriptor>
<persistent-store-type>replicated_if_clustered</persistent-store-type>
<cookie-http-only>false</cookie-http-only>
<cookie-name>TEST_COOKIE</cookie-name>
<cookie-secure>true</cookie-secure>
<url-rewriting-enabled>false</url-rewriting-enabled>
</session-descriptor>
I would like to know how the value of cookie is generated by the server.

If you are using a single server, the value is:
JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!CREATION_TIME
If you are using a cluster, the session failover information is included like this:
JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!SECONDARY_JVM_HASH!CREATION_TIME

Related

war file deployment through weblogic

While deploying war file using weblogic-10.3.6 I am getting the exceptions like
* The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-enumeration-valid: string value '3.0' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/javaee:*
Can anyone tell me what is the problem ?
Normally this problem indicates there is an issue with your weblogic/WSDL header information. In this case:
Weblogic 10.3.6. does not support servlet spec 3
Upgrade to 12c or choose a different version of the spec in your code/WSDL/etc
Specifically switch from something like:
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
to:
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

can you use a variable in the message logging policy for host and port?

can you use a variable in the message logging policy for host and port? for example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging async="false" continueOnError="false" enabled="true" name="splunk">
<Syslog>
<Message>Message. id = {request.header.id}</Message>
<Host>{variable}</Host>
<Port>{variable}</Port>
</Syslog>
</MessageLogging>
At this time, the Host and Port entries cannot be variables.
An alternative to using variables at runtime is to set those attributes at build time using a build tool like maven.

How to configure SSL in WSDL First CXF Framework web service?

I am new to CXF framework. Recently successfully created webservices using CXF and Spring Endpoint. I am using WSDL first approach. Can you please suggest how to use SSL(https) for web services. I have idea about truststore and keystore. I am using Apache Tomcat server.
below is my ApplicationContext.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"
default-autowire="byName">
<!-- Service endpoint -->
<jaxws:endpoint id="CalculatorWebService"
implementorClass="com.web.calculator.service.CalculatorContractImpl"
implementor="#CalculatorImpl"
address="/CalculatorWS">
</jaxws:endpoint>
<bean id="CalculatorImpl" class="com.web.calculator.service.CalculatorContractImpl"/>
I believe I need to make some configuration entries for truststore here and similarly some configuration for keystore in client side in some xml. Also I think I need some Passwordcallback class for using keystores.
Can you please help me with the configurations that has to be made to enable SSL.
Your help is truly appreciated...
Thanks...
Here is great tutorial how to set up everything you need with SSL in your CXF. Please refer to section Configuring SSL Support.
And do not forget to enable https in your tomcat. The full "how to do this" is provided here. I assume that you did not try anything yet. All you need to do just follow these steps because there is everything explained very clear.

How to get the called address of a WCF Rest Request?

I have implemented a REST Webservice which returns (after an authentication via RFC 2617 HTTP Digest Authentication) an XML document with xlink's to the related resources.
Here's an example of a request:
http://172.32.42.53:8080/Service.svc/user/123
A result could look like this:
<?xml version="1.0" encoding="utf-8"?>
<UserList xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<User>
<ID>2</ID>
<UserName>CHI</UserName>
<OutlineLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://demo:8080/Service.svc/Users/2/Outline/" cache="no"/>
<SettingsLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://demo:8080/Service.svc/Users/2/Settings/" cache="no"/>
<CatalogsLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://demo:8080/Service.svc/Users/2/Catalogs/" cache="no"/>
<LastName>Test</LastName>
</User>
</UserList>
So, the problem now is:
If the user calls the webservice via the IP address, the first handshake will be over the ip address and not the DNS name. So the authentication does only work if the second call (to the specified resource) will be over the IP address again. I tried it with following command:
OperationContext.Current.IncomingMessageProperties.Via.ToString();
But my webservice returns always the dns of the server and not the "called address".
Is there a possibility to get the called address? So I can dynamically return the called address (ip or dns). Would be great to get a solution. Relative URLs aren't allowed for xlinks.
Thanks for help!
Can you try to retrieve the called address from the request's server variables? I guess your web service needs to be in asp.Net compatibility mode to access this. Something like "REMOTE_HOST", "HTTP_HOST", "SERVER_NAME", etc...
Check this link for list of server variables

SharePoint search service returns SERVER_ERROR (SQLException)

I have a simple WCF webservice client that sends a request to Microsoft Search Server (included with SharePoint 2007) on /more/_vti_bin/search.asmx
The request is sent
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Query xmlns="urn:Microsoft.Search">
<queryXml><QueryPacket xmlns="urn:Microsoft.Search.Query" Revision="1000"> <Query> <Context> <QueryText language="fr-FR" type="STRING">foo bar</QueryText></Context> </Query> </QueryPacket> </queryXml>
</Query></s:Body></s:Envelope>
But the response shows a SQLException error
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<QueryResponse xmlns="urn:Microsoft.Search">
<QueryResult><ResponsePacket xmlns="urn:Microsoft.Search.Response"><Response domain=""><Status>ERROR_SERVER</Status><DebugErrorMessage>System.Data.SqlClient.SqlException</DebugErrorMessage></Response></ResponsePacket></QueryResult>
</QueryResponse></soap:Body></soap:Envelope>
It states there's been a sql exception, coulld you check on your sql machine if any errors occurred?
there is a problem with your request. test your search service using this tool
After some further analysis, I have understood that the problem lies in the fact that the Soap query does not start with an XML declaration.
<?xml version="1.0">
This is perfectly possible and respectful of standards but SharePoint doesn't like that.
The question becomes: How to force the WCF client to starts with an XML declaration.