-
Aug 13th, 2010, 04:04 PM
#1
Create request object from WSDL
Could you please give some directions on this..
What tool should I use to get java objects corresponding xml elements in WSDL (no XSD in WSDL). Once I get those objects, I can pass in my service layer to fill out.
Thanks,
-
Aug 13th, 2010, 06:05 PM
#2
wsimport for jax-ws; wsdl2java for axis are couple examples. These commands generate necessary java classes from WSDL.
-
Aug 16th, 2010, 04:25 PM
#3
thank you for quick reply.
Yes I used wsdl2java tool and it is creating java files.. but java objects contains the methods specific to axis.. example, it has the following methods: parse(), getParser(), registerPrefix(), writeQNames(), writeAttribute(), getOMElement() etc., I do not see attributes corresponding to xml elements.
here the command which I used.
wsdl2java -ss -g -uri http://localhost:8080/echo/myecho?WSDL
What I want is, java object should have getters and setters; similary to xjc which convers xsd to java files. Since I dont have XSD, I want to extract type/schema from WSDL and generate java files.
Here is the reason I am asking, currently I have one wsdl and it has imported XSD, I used xjc tool to convert xml to java objects and used in Spring to get data. And there is another wsdl which my business partner is building has no imported XSD, schema is embedded in the WSDL and I could not use xjc to get java files.
I hope, I explained the problem I am facing here..
Thanks,
Gouri
-
Aug 17th, 2010, 03:57 AM
#4
Just do a cut and paste job and lift out the inline schema - jobs a good un.
-
Aug 18th, 2010, 11:55 AM
#5
Thank you,
I took out schema and generated java files. I am able to generate Request and while calling WebServiceTemplate.marshalSendAndReceive(), I am getting the following error:
org.springframework.ws.client.WebServiceTransportE xception: Forbidden [403]
at org.springframework.ws.client.core.WebServiceTempl ate.handleError(WebServiceTemplate.java:561)
at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:489)
at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:440)
at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 289)
at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 283)
at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 275)
at sample.CallWS.callEmpInfo(Unknown Source)
If I call the same WS by sending same request in SoapUI, I am getting response.
so I am doing something wrong, but I could not see where it is. Can you please help me.
-Gouri
-
Aug 18th, 2010, 12:13 PM
#6
I could figured it out the mistake, i made spelling mistake in my URI value in my bean. I corrected it and is working fine.
Thank you.
-
Aug 20th, 2010, 06:01 AM
#7
New to create web service client
Hi,
I am creating WebService client for the first time. I have read WebServiceTemplate tutorial to understand some of the points.
I have to call some of the methods of a webservice and I have WSDL.
I need to know how to call specific methods of WebService using WebServiceTemplate and how to pass the parameters required to call the webservice method.
I have read that I can use SoapAction to specify which method to call but not sure how to send the parameters.
Please help.
-
Aug 20th, 2010, 06:29 AM
#8
I think that is what the Uri setting is for. Which can be set either in the bean config for the WebServiceTemplate or passed into the send~ method you wish to use.
I could be wrong, pretty new to Spring-ws myself.
-
Aug 20th, 2010, 06:38 AM
#9
DefaultUri is the URL to access the WebService I guess.
What I need here is to call one of the methods of the webservice and before calling the method need to assign params.
What I think I need to do is to create WebServiceMessage and set the params in it but not sure how to do it.
Thanks for your reply though.
-
Aug 20th, 2010, 06:44 AM
#10
Ah, ok, not so sure.
My understanding was that assuming you have you Template setup correctly, you should be able to create one of the request objects generated from the wsdl, populate this with values, make this the parameter of one of the send methods, and that was all there is too it.
At least that my understanding.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules