jigar singh

Greenhorn
+ Follow
since Jun 17, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by jigar singh

Hi Friends,

I am using Apache cxf annotation @CrossOriginResourceSharing on my JAX-RS resource to restrict my service to be accessed only by authentic machines.

@CrossOriginResourceSharing (allowOrigins = {"http://test.caderanch.com:7001",allowCredentials = true)
@Path("/test")
public class TestRestImpl{
...
}


My question is that this same class file will be moved to Dev. INT, UAT and Prod environments. And for every environment I have different values("URLs") to be passed to this annotation @CrossOriginResourceSharing.

Is there any way to enable passing different value to this annotation during build or deployment or any other means.

Any help will be greatly appreciated.

Thanks
Kanwaljit
Hi,

I am glad to inform everyone that I have cleared java web service certification with score : 80 %.
I prepared as below:
1) Java Web Services: Up and Running by Martin Kalin
2) Ivan's notes
3) few chapters from blue print
4) Mikalai Zaikin's Free OCE WSD 6 Study Guide
5) Mikalai Zaikin's OCE WSD 6 Quiz
6) Enthuware JWS+ V6 questions

I took 2 months to prepare for this exam and had basic understanding of jax-ws and have had implemented a jax-ws example in apache cxf before I started this preperation.

I would like thanks to everyone for the help in preparing for this exam.

3 years ago
Hi,

In this we see only message addressing roper ties. Where is the other contruct of ws-addressing specification called "EndPointReference". Can you please explain how and where is this used ?
I went through Ivan A Krizsan's notes and he provided a coding example for each of these apis. I tried every example in eclipse which gave me a good understanding on these apis.

Oracle documentation should be a starting point though as it describes the basics.
Hi Friends,

I was going through WS-addressing topic and as stated Ws-addressing has two basic constructs in WS-Addressing:

>Endpoint references
>Message addressing properties

The following is an example endpoint reference that references the endpoint at the URI "http://wso2.org/addressing/sample":
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>http://wso2.org/addressing/sample</wsa:Address>
</wsa:EndpointReference>

and Message addressing properties are

MessageAddressing Property Description
wsa:To Provides the destination URI. This property indicates where the message will be sent to.
wsa:From Provides the source endpoint reference. Indicates where the message came from.
wsa:ReplyTo Provides the reply endpoint reference. Indicates where the reply for the request message should be sent to.
etc etc

I did not see where in WSDL we use EndPointReference as part of WS-addressing spec. The was:To has same meaning as was:EndpointReference so how do we exactly use was:EndpointReference in wsdl and code.

is there any wsdl example which shows both constructs ?

Thanks
Thank you so much Frits. Very good explanation.

Best Regards.
Also, in MK's notes , i did not understand below line. In the above post we using MTOM by sending binary data which is not encoded "Content-Transfer-Encoding: binary ". then why it is said we need to encode your binary data as xs:base64Binary content. ??

###################################
11.2. Use MTOM on the client.

11.2.1. Use MTOMFeature with getPort() methods.

If you want to use MTOM, you should encode your binary data as xs:base64Binary content.
###################################
Hi Friends,

Can anyone please explain me the following from the below MTOM message from MK's note:
1) In first Content-Type
Content-Type: multipart/related;
start="<rootpart*b0ef6adc-44fa-47ba-a7a7-95915eb54d9e@example.jaxws.sun.com>";
type="application/xop+xml";
boundary="uuid:b0ef6adc-44fa-47ba-a7a7-95915eb54d9e";
start-info="text/xml"

what purpose does "type" and "start-info" solves when we already have value for Content-Type as "multipart/related".

Can you please explain all three a) Content-Type b) type c) start-info

2) What is boundary used for ?

3) In the following:
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

what purpose does "type" solves when we already have value for Content-Type as "application/xop+xml".

COMPLETE MTOM MSG:
#################################################################

POST /mtomService/mtomPort HTTP/1.1
SOAPAction: ""
Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Type: multipart/related;
start="<rootpart*b0ef6adc-44fa-47ba-a7a7-95915eb54d9e@example.jaxws.sun.com>";
type="application/xop+xml";
boundary="uuid:b0ef6adc-44fa-47ba-a7a7-95915eb54d9e";
start-info="text/xml"
User-Agent: JAX-WS RI 2.1.4.1-hudson-346-
Host: localhost:9088
Connection: keep-alive
Content-Length: 890

--uuid:b0ef6adc-44fa-47ba-a7a7-95915eb54d9e
Content-Id: <rootpart*b0ef6adc-44fa-47ba-a7a7-95915eb54d9e@example.jaxws.sun.com>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:mtomOperation xmlns:ns2="http://j2ee.netbeans.org/wsdl/mtomBP/mtom">
<part1>hello</part1>
<part2>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include"
href="cid:2f3a859b-6cdb-4eba-8163-0365521f094c@example.jaxws.sun.com" />
</part2>
</ns2:mtomOperation>
</S:Body>
</S:Envelope>
--uuid:b0ef6adc-44fa-47ba-a7a7-95915eb54d9e
Content-Id: <2f3a859b-6cdb-4eba-8163-0365521f094c@example.jaxws.sun.com>
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary

[BINARY ATTACHMENT]

--uuid:b0ef6adc-44fa-47ba-a7a7-95915eb54d9e--


#################################################################

This is a question in Enthuware which asks to send a body as String. Even i am confused.method writeChars will write entity as stream of characters . This is the option I chose and was wrong.

However, method writeBytes will write the entity as stream of bytes. This is the right option as per their question bank. I wanted to know why this is correct option.
Please help with the following question:

What is the correct sequence of methods that must be added (in line //1 and line //2) in the following JAX-RS client to return a valid result. The request should be a POST request with a String as body.

public static void main(String[] args) throws IOException {
URL restURL = new URL("http://localhost:8080/SimpleRS/math/table/post");
HttpURLConnection connection = (HttpURLConnection) restURL.openConnection();
// 1
connection.connect();
String entity = "5";
// 2
}

Wrong Answer:
Why is this wrong:
Line // 1 connection.setRequestMethod("POST");
connection.setDoOutput(true);
Line // 2
DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
wr.writeChars(entity);
wr.flush(); wr.close();

Correct Answer:
why this is right:
Line // 1
connection.setRequestMethod("POST");
connection.setDoOutput(true);
Line // 2
DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
wr.writeBytes(entity);
wr.flush(); wr.close();

Thanks Frit.

Is there any other topic which I need to skip for this exam together with UDDI ?

Hi Everyone,

Is UDDI covered in OCE WSD 6 exam? I see many questions in Mk's quiz. Is this topic need to be studied properly? Please suggest.
Hi All,

I am preparing for OCE WSD 6 cert exam. I wanted to know if for practicing mock exams and practice questions only Mikalai Zaikin's quiz is enough or on top of this I still need to go through and practice Enthuware JWS+ V6 software questions.

Please suggest.

Thanks and Regards
Hi Himai,

As you said do we need to skip chapter 6 from Java Web Services_ Up and Running, 2nd Edition ? Isnt that important from exam point of view ?

I read that WS Security is very important and hence can you suggest from where can we start on this topic and get enough content to crack the exam. Also,c an you share the WSIT tutorial links please?